How to handle shipment based on the country of the user and how to block payment.

webtek-dev
Contributor
Contributor

Hi ,

How can i handle different shipping methods based on country of the user? 

With paypal express checkout i can access user informations only after they authorize the payment and then i can add shipping fees based on that and execute the payment.

In sandbox this works but i found this really weird.. 

The user will authorize for example 100$ and then you withdraw 120$ because shipping to this country is 20$ without even him knowing that. 

I tried an order in sandbox with 100000$ shipping fees not authorized by the user and the payment work.

User-experience-wise i can at least show a review of the payment before executing the payment but i wonder if in production this kind of thing will work. 

The other problem i have is to block payment to some nations. 

If for example i don't want to ship to France can i just not execute the payment after the authorization of the user? 

Is there some way to abort the payment?

 

 

Login to Me Too
3 REPLIES 3

MTS_Andre
Moderator
Moderator

Hi, yes ExpressCheckout allows to specify a different amount from the creation (SetExpressCheckout) to the execution (DoExpressCheckout) of the payment as it gives the possibility to add for example the shipping fees. So it is correct that allows that.

 

You could place a sort of alert on your website saying that based on the shipping country there will be a fee applied to the amount.

For blocking some countries for the payment you need to set this before the checkout, in your website, with a sort of filter or allows to see the checkout only to those countries that you want to ship to.

Login to Me Too

webtek-dev
Contributor
Contributor

Can i also check the address after authorization and don't proceed with the execution because the address is not in the allowed countries or is that against paypal policy? 

Login to Me Too

MTS_Andre
Moderator
Moderator

Hi, indeed you can, once you create the payment with SetExpressCheckout and you checked the country of the buyer you are then redirected to your website where if you want to process the payment then you call DoExpressCheckout to execute it, but if you don't want to process it (because of the country that is not in your shipping country list) then do not call DoExpressCheckout and instead show a message about that.

 

If you didn't develop the integration on your own but you are using a third party module / eCommerce then you need to check with them how to achieve that.

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.