Express Checkout: Reject if shipping country change

KittieC
Contributor
Contributor

//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

 

Login to Me Too
1 REPLY 1

Brisbane22
Contributor
Contributor

Hi,

 

Where you have

data.shipping_address.country

please change it to

data.shipping_address.country_code

 

Hope this helps

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.