Smart Payment Buttons JS SDK

benlau
Contributor
Contributor

Hi there,

 

we are trying to use the Smart Payment Buttons to capture a payment for a non-physical good (callcenter hotline).

 

Both Sandbox and Live Environment are working fine, we only have two minor problems:

 

  1. We NEED to receive the phone number of the customer. We already changed the settings in our PayPal Account (required phone number field), but when a customer pays with PayPal, we do not receive his number.
  2. We want to display "billing address" on the PayPal page instead of "shipping address" / "ship to". Is that possible? We tried shipping_preference: "NO_SHIPPING" but this completely disables all address fields. 

 

This is our JS snippet:

paypal.Buttons({       
        createOrder: function (data, actions) {
            return actions.order.create({
                purchase_units: [{
                    amount: {
                        value: amount
                    }
                }]
            });
        },
        onApprove: function (data, actions) {
            return actions.order.capture().then(function (details) {
                console.log(data);
                console.log(details);
                // Call your server to save the transaction
                // ...
        },
        style: {
            layout: 'vertical',
            color: 'silver',
            shape: 'rect',
            label: 'paypal'
        }
    }).render('#paypal-button-container');

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.