• javascript variables on PayPal button

    From Daniele Ferrarese@21:1/5 to All on Fri Mar 4 06:52:16 2022
    A greeting to all participants in the NG

    I'm trying to insert the HTML code, from PayPal, to insert a button "bynow" on my ecommerce (see code)

    <div id="smart-button-container">
    <div style="text-align: center;">
    <div id="paypal-button-container"></div>
    </div>
    </div>
    <script src="https://www.paypal.com/sdk/js?client-id=my_id&enable-funding=venmo&currency=EUR" data-sdk-integration-source="button-factory"></script>
    <script>
    function initPayPalButton() {
    paypal.Buttons({
    style: {
    shape: 'rect',
    color: 'gold',
    layout: 'vertical',
    label: 'paypal',

    },

    createOrder: function(data, actions) {
    return actions.order.create({
    purchase_units: [{"description":"Order N.","amount":{"currency_code":"EUR","value":10}}]
    });
    },

    onApprove: function(data, actions) {
    return actions.order.capture().then(function(orderData) {

    // Full available details
    console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));

    // Show a success message within this page, e.g.
    const element = document.getElementById('paypal-button-container'); element.innerHTML = '';
    element.innerHTML = '<h3>Thank you for your payment!</h3>';

    // Or go to another URL: actions.redirect('thank_you.html');

    });
    },

    onError: function(err) {
    console.log(err);
    }
    }).render('#paypal-button-container');
    }
    initPayPalButton();
    </script>

    trying to replace "description:Order N." with a variable $_SESSION['customer_id'], and total EUR 10 with variable $_SESSION['total_order'] already in my checkout page. I'm not able to find the right syntax.
    Besides I would like, if payment success, activate function "validateForm()" which is sending all records to database.


    Thank you for help.
    Rgds.
    Daniele

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kristjan Robam@21:1/5 to All on Mon Apr 4 04:06:58 2022
    Something for You.

    Can You help me out with 2100 euros ?

    I want to buy a new Iphone.



    Kristjan Robam

    Daniele Ferrarese kirjutas Reede, 4. märts 2022 kl 16:52:27 UTC+2:
    A greeting to all participants in the NG

    I'm trying to insert the HTML code, from PayPal, to insert a button "bynow" on my ecommerce (see code)

    <div id="smart-button-container">
    <div style="text-align: center;">
    <div id="paypal-button-container"></div>
    </div>
    </div>
    <script src="https://www.paypal.com/sdk/js?client-id=my_id&enable-funding=venmo&currency=EUR" data-sdk-integration-source="button-factory"></script>
    <script>
    function initPayPalButton() {
    paypal.Buttons({
    style: {
    shape: 'rect',
    color: 'gold',
    layout: 'vertical',
    label: 'paypal',

    },

    createOrder: function(data, actions) {
    return actions.order.create({
    purchase_units: [{"description":"Order N.","amount":{"currency_code":"EUR","value":10}}]
    });
    },

    onApprove: function(data, actions) {
    return actions.order.capture().then(function(orderData) {

    // Full available details
    console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));

    // Show a success message within this page, e.g.
    const element = document.getElementById('paypal-button-container'); element.innerHTML = '';
    element.innerHTML = '<h3>Thank you for your payment!</h3>';

    // Or go to another URL: actions.redirect('thank_you.html');

    });
    },

    onError: function(err) {
    console.log(err);
    }
    }).render('#paypal-button-container');
    }
    initPayPalButton();
    </script>

    trying to replace "description:Order N." with a variable $_SESSION['customer_id'], and total EUR 10 with variable $_SESSION['total_order'] already in my checkout page. I'm not able to find the right syntax.
    Besides I would like, if payment success, activate function "validateForm()" which is sending all records to database.


    Thank you for help.
    Rgds.
    Daniele

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ace of diamonds@21:1/5 to All on Wed Jul 6 09:18:20 2022
    Hey guy. Would You want to get rich with me doing programming? If yes, call me !!!!!!!!!

    ✆☎☏📱📞 : 372 53900660


    Daniele Ferrarese kirjutas Reede, 4. märts 2022 kl 16:52:27 UTC+2:
    A greeting to all participants in the NG

    I'm trying to insert the HTML code, from PayPal, to insert a button "bynow" on my ecommerce (see code)

    <div id="smart-button-container">
    <div style="text-align: center;">
    <div id="paypal-button-container"></div>
    </div>
    </div>
    <script src="https://www.paypal.com/sdk/js?client-id=my_id&enable-funding=venmo&currency=EUR" data-sdk-integration-source="button-factory"></script>
    <script>
    function initPayPalButton() {
    paypal.Buttons({
    style: {
    shape: 'rect',
    color: 'gold',
    layout: 'vertical',
    label: 'paypal',

    },

    createOrder: function(data, actions) {
    return actions.order.create({
    purchase_units: [{"description":"Order N.","amount":{"currency_code":"EUR","value":10}}]
    });
    },

    onApprove: function(data, actions) {
    return actions.order.capture().then(function(orderData) {

    // Full available details
    console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));

    // Show a success message within this page, e.g.
    const element = document.getElementById('paypal-button-container'); element.innerHTML = '';
    element.innerHTML = '<h3>Thank you for your payment!</h3>';

    // Or go to another URL: actions.redirect('thank_you.html');

    });
    },

    onError: function(err) {
    console.log(err);
    }
    }).render('#paypal-button-container');
    }
    initPayPalButton();
    </script>

    trying to replace "description:Order N." with a variable $_SESSION['customer_id'], and total EUR 10 with variable $_SESSION['total_order'] already in my checkout page. I'm not able to find the right syntax.
    Besides I would like, if payment success, activate function "validateForm()" which is sending all records to database.


    Thank you for help.
    Rgds.
    Daniele

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)