diff --git a/modules/ppcp-blocks/src/Endpoint/UpdateShippingEndpoint.php b/modules/ppcp-blocks/src/Endpoint/UpdateShippingEndpoint.php index c8e0417ab..43032c588 100644 --- a/modules/ppcp-blocks/src/Endpoint/UpdateShippingEndpoint.php +++ b/modules/ppcp-blocks/src/Endpoint/UpdateShippingEndpoint.php @@ -23,7 +23,7 @@ use WooCommerce\PayPalCommerce\Button\Endpoint\RequestData; */ class UpdateShippingEndpoint implements EndpointInterface { const ENDPOINT = 'ppc-update-shipping'; - const WC_STORE_API_ENDPOINT = '/wp-json/wc/store/cart/'; + const WC_STORE_API_ENDPOINT = '/wp-json/wc/store/v1/cart/'; /** * The Request Data Helper. diff --git a/modules/ppcp-button/resources/js/modules/Helper/ShippingHandler.js b/modules/ppcp-button/resources/js/modules/Helper/ShippingHandler.js index ae86ddea0..03952b14a 100644 --- a/modules/ppcp-button/resources/js/modules/Helper/ShippingHandler.js +++ b/modules/ppcp-button/resources/js/modules/Helper/ShippingHandler.js @@ -21,8 +21,8 @@ export const handleShippingOptionsChange = async ( data, actions, config ) => { credentials: 'same-origin', headers: { 'Content-Type': 'application/json', - 'X-WC-Store-API-Nonce': - config.ajax.update_customer_shipping.wp_rest_nonce, + 'Nonce': + config.ajax.update_customer_shipping.wp_rest_nonce, }, body: JSON.stringify( { rate_id: shippingOptionId, @@ -106,9 +106,9 @@ export const handleShippingAddressChange = async ( data, actions, config ) => { credentials: 'same-origin', headers: { 'Content-Type': 'application/json', - 'X-WC-Store-API-Nonce': - config.ajax.update_customer_shipping - .wp_rest_nonce, + 'Nonce': + config.ajax.update_customer_shipping + .wp_rest_nonce, }, body: JSON.stringify( { shipping_address: cartData.shipping_address,