paypal / PayPal-node-SDK

node.js SDK for PayPal RESTful APIs
Other
1.28k stars 451 forks source link

Calculate shipping cost based on destination submitted? #420

Open kolomiytsevs opened 5 years ago

kolomiytsevs commented 5 years ago

Issue description: I am trying to execute and order in the following way. On my website, before checking out the user is able to select the country that he is shipping to (just the country - not the full address). This immediately calculates the shipping cost (dependent on the destination) which can then be sent to paypal. The issue of course is that the user could tell my site that he is shipping to the UK at which point my website would calculate a cost of 5 GBP and send this to PayPal. Once the user is redirected to PayPal, he can then choose to set the shipping address as US and only pay 5 GBP - the UK tariff (instead of say 8 GBP that it costs to ship to the US).

Is there any way of avoiding this? One option of course is to have the user fill out his shipping information on my website, but I would prefer the customer to do this in PayPal. Is there a way to either set shipping tariffs within PayPal itself (based on shipping destination) or to simply send just the country code to PayPal during the payment creation stage? Alternatively perhaps there is a way of updating the shipping cost based on the shipping destination entered in PayPal?

I am new to this, so any help would be greatly appreciated!

kolomiytsevs commented 5 years ago

Turns out that there is no easy way around it. Wix sites who use PayPal checkout have this issue too. You can for example choose free shipping to the US and then once you are in PayPal change your country and still benefit from the free shipping.

Would love to know if I am missing something.

omar09091993 commented 4 years ago
  • SDK/Library version: Node SDK
  • Environment: Sandbox
  • Language, language version, and OS:

Issue description: I am trying to execute and order in the following way. On my website, before checking out the user is able to select the country that he is shipping to (just the country - not the full address). This immediately calculates the shipping cost (dependent on the destination) which can then be sent to paypal. The issue of course is that the user could tell my site that he is shipping to the UK at which point my website would calculate a cost of 5 GBP and send this to PayPal. Once the user is redirected to PayPal, he can then choose to set the shipping address as US and only pay 5 GBP - the UK tariff (instead of say 8 GBP that it costs to ship to the US).

Is there any way of avoiding this? One option of course is to have the user fill out his shipping information on my website, but I would prefer the customer to do this in PayPal. Is there a way to either set shipping tariffs within PayPal itself (based on shipping destination) or to simply send just the country code to PayPal during the payment creation stage? Alternatively perhaps there is a way of updating the shipping cost based on the shipping destination entered in PayPal?

I am new to this, so any help would be greatly appreciated!