[Bug] PayPalButtons onShippingAddressChange not able to update shipping costs
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:
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?
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!
This is still an issue.
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.
This is still an issue.
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
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!
bump
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!
Bump
bump
Still an issue.
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!
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.