paypal-js icon indicating copy to clipboard operation
paypal-js copied to clipboard

[Bug] PayPalButtons onShippingAddressChange not able to update shipping costs

Open jqrn opened this issue 1 year ago • 7 comments

Library used

react-paypal-js

🐞 Describe the Bug

The docs for PayPalButtons onShippingAddressChange state that it can be used to update shipping costs after the buyer has selected an address in PayPal:


image

However, unlike the now-deprecated onShippingChange, onShippingAddressChange does not provide a data.actions.order.patch() that can be used to patch the order with the new shipping costs. It only provides a reject method for when the new address isn't one the seller can support.

After an order is first created via PayPalButtons createOrder (actions.order.create()), and then the buyer has logged into PayPal and selected their shipping address, how can we update the order with the shipping cost recalculated using the buyer's address?

jqrn avatar Jul 12 '24 05:07 jqrn

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Oct 11 '24 00:10 github-actions[bot]

This is still an issue.

chowey avatar Oct 14 '24 22:10 chowey

Is there an update on when this issue will be resolved?

This is affecting one of our customers. They require the shipping methods to be updated when an address is entered, this works fine for existing Paypal users as the call back is triggered. However when signing up for a new account or using it in the guest flow, the call back is not triggered to update the shipping methods and so the order validation fails.

ederoyd46 avatar Nov 12 '24 10:11 ederoyd46

This is still an issue.

rinkoo-webkul avatar Nov 26 '24 08:11 rinkoo-webkul

For react-paypal-js and for braintree users: I fixed it temporarily by using the newest version of braintree-web (at least version 3.90.0), and then injecting the two client objects with the braintreeNamespace param into the <BraintreePayPalButtons>.

This provides the updated version in the actions param in the createOrder callback (actions.braintree: BraintreePayPalCheckout), where you can save it in a Ref, and then use the containing updatePayment() method (braintreePayPalCheckoutClientRef.current.updatePayment(...)) in the mentioned onShipping**Changed callbacks.

Docs for updatePayment(): https://braintree.github.io/braintree-web/current/PayPalCheckout.html#updatePayment

AStaege avatar Jan 09 '25 09:01 AStaege

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Apr 10 '25 00:04 github-actions[bot]

bump

chowey avatar Apr 10 '25 03:04 chowey

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Jul 10 '25 00:07 github-actions[bot]

Bump

ederoyd46 avatar Jul 10 '25 16:07 ederoyd46

bump

Flysky12138 avatar Aug 11 '25 09:08 Flysky12138

Still an issue.

Cmac2712 avatar Aug 15 '25 08:08 Cmac2712

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Nov 14 '25 00:11 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information.

github-actions[bot] avatar Nov 22 '25 00:11 github-actions[bot]