Thank you for your help, however a small problem. I modified the code and added shipping_address to my code. Now I am able to pass the shipping address to PayPal page. Now the problem is: On success or Failure onAuthorize, onCancel, onError functions are not working/fired. PayPal popup is closed and my old page is displayed without PayPal button and without any redirection. Below is my modified 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' }, invoice_number: '48787589673', item_list: { items: [ { name: 'hat', description: 'Brown hat.', quantity: '5', price: '3', tax: '0.01', sku: '1', currency: 'USD' }, { name: 'handbag', description: 'Black handbag.', quantity: '1', price: '15', tax: '0.02', sku: 'product34', currency: 'USD' } ], shipping_address: { recipient_name: 'Brian Robinson', line1: '4th Floor', line2: 'Unit #34', city: 'San Jose', country_code: 'US', postal_code: '95131', phone: '011862212345678', state: 'CA' } } } ] } }); }, 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 window.location="https://mydomain.com/success.php"; }); }, onCancel: function(data, actions) { /* * Buyer cancelled the payment */ window.location="https://mydomain.com/failure.php"; }, onError: function(err) { /* * An error occurred during the transaction */ window.location="https://mydomain.com/failure.php"; } }, '#paypal-button'); </script>
... View more