mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Update the shipping option for subscriptions on address change
This commit is contained in:
parent
ac42b18592
commit
4967c472e7
2 changed files with 15 additions and 2 deletions
|
@ -391,6 +391,21 @@ const PayPalComponent = ({
|
|||
|
||||
await shippingData.setShippingAddress(address);
|
||||
|
||||
const res = await fetch(config.ajax.update_shipping.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: config.ajax.update_shipping.nonce,
|
||||
order_id: data.orderID,
|
||||
})
|
||||
});
|
||||
|
||||
const json = await res.json();
|
||||
|
||||
if (!json.success) {
|
||||
throw new Error(json.data.message);
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue