Merge pull request #2259 from woocommerce/PCP-3136-enable-shipping-callback-for-wc-subscriptions

Enable shipping callback for WC subscriptions (3136)
This commit is contained in:
Emili Castells 2024-06-03 14:25:36 +02:00 committed by GitHub
commit 3aba8d7dea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 211 additions and 91 deletions

View file

@ -398,6 +398,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);