Express Checkout: Reject if shipping country change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
//Reject if shipping country change
onShippingChange: function(data, actions) {
if (data.shipping_address.country != '".$country."') {
alert(data.shipping_address.country); // "undefined is shown"
return actions.reject();
}
return actions.resolve();
},
I've used the suggested script to avoid client input mismatch shipping address. However, the result is always "seller will not ship to the country". I use alert function to show the paypal data: data.shipping_address.country, but getting 'undefined' result.
Any suggestion?
Thanks in advance
- Labels:
-
Express Checkout
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Where you have
data.shipping_address.country
please change it to
data.shipping_address.country_code
Hope this helps
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Express Checkout with Bigcommerce in PayPal Payments Standard
- How do I update shipping in the popup when using onShippingAddressChange() in REST APIs
- User is asked for shipping address when creating a credit card order in REST APIs
- PAYER_ACTION_REQUIRED returned for Capture intent when calling v2 checkout orders in Sandbox Environment
- Error: "Unable to change shipping method. Please try again." in PayPal popup in REST APIs