1
votes

I'm using PayPal Checkout, which isn't well-documented but doesn't support automatically adding shipping costs in the account dashboard as far as I can tell. I need to charge users different amounts for shipping depending on their location, which I don't receive from PayPal until the user authorizes a payment. Without re-authorizing, how can I charge an additional fee for shipping? I saw this behavior implemented on this site recently while making a purchase – I authorized a payment using what appears to be PayPal Checkout, after which I was able to select a shipping method (some of which cost up to $30 extra) and it seemed I was able to complete my payment without reauthorizing.

I haven't found anything in the PayPal Checkout documentation or by inspecting the object passed into onAuthorize that seems to expose this functionality. I did find a PATCH /payments/payment/{id} endpoint in the docs for the Payments API, but I have no idea how to access this from the PayPal Checkout flow on my website, nor whether my site is considered a "Third Party Provider in the context of PSD2 regulation."

How can I add a shipping cost to a payment after authorization using PayPal Checkout?

1

1 Answers

0
votes

You can find more required info here :https://developer.paypal.com/docs/checkout/integration-features/shipping-callback

paypal.Buttons({
onShippingChange: function(data, actions) {
    console(data);
} 
}).render('#paypal-button-container');