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?
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 adata.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?