I need to use the PayPal API for an online store. The user sets his shipping information (Name and Address) in the store interface and then clicks the "Pay with PayPal" button. Now I need to pass that information to the PayPal API so that the field "shipping address" in the PayPal checkout interface displays the correct address. I implemented it like shown in the API documentation (https://developer.paypal.com/docs/api/orders/v2/#definition-shipping_detail.address_portable), but it does not seem to work, since the shipping address and name in the PayPal checkout interface is still the default sandbox address for John Doe. Here is how I implemented it, but it has to be wrong, since it does not work:
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '34'
},
shipping_detail: {
name: {
full_name: 'Hans Muller'
},
address_portable: {
address_line_1: 'Rohrd. 16',
address_line_2: 'Rohrdorfer Street',
admin_area_2: 'Stephanskirchen',
admin_area_1: 'Bayern',
postal_code: '83071',
country_code: 'DE',
},
},
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
console.log('Success');
});
},
onError: function (err) {
console.error(err);
}
But the PayPal sandbox interface still shows the (german) default shipping address:
In addition it should not be possible to change that address later on in the PayPal interface. Any advice on what I did wrong here would be appreciated.