How can I pass shipping address to PayPal Express checkout

Pamulapati
Contributor
Contributor

 I am using PayPal Express checkout Client-side REST for our eCommerce solution. I am wondering how I can pass shipping address from our website to PayPal, so we can have the shipping address confirmed by PayPal and be eligible for Seller Protection. For your reference I am using below code:

 

<div id="paypal-button"></div>

<script src="https://www.paypalobjects.com/api/checkout.js"></script>

<script>
    paypal.Button.render({

        env: 'production', // Or 'sandbox'

        client: {
            sandbox:    'xxxxxxxxx',
            production: 'xxxxxxxxx'
        },

        commit: true, // Show a 'Pay Now' button

        payment: function(data, actions) {
            return actions.payment.create({
                payment: {
                    transactions: [
                        {
                            amount: { total: '1.00', currency: 'USD' }
                        }
                    ]
                }
            });
        },

        onAuthorize: function(data, actions) {
            return actions.payment.execute().then(function(payment) {

                // The payment is complete!
                // You can now show a confirmation message to the customer
            });
        }

    }, '#paypal-button');
</script>

Thanks for your help in advance. 

Login to Me Too
1 REPLY 1

Snow-Cat
Advisor
Advisor

That would be good question to ask the Merchant Support Community as there are other Developers there who may be able to assist.

Login to Me Too

Haven't Found your Answer?

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