From ab7b7f75c68f39132f89f7861381e577684f794d Mon Sep 17 00:00:00 2001 From: frosso Date: Tue, 16 Jul 2024 13:19:06 +0200 Subject: [PATCH] more optimizations --- client/tokenized-payment-request/cart-api.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/tokenized-payment-request/cart-api.js b/client/tokenized-payment-request/cart-api.js index d79c554fd0c..5467d5eace4 100644 --- a/client/tokenized-payment-request/cart-api.js +++ b/client/tokenized-payment-request/cart-api.js @@ -37,6 +37,8 @@ export default class PaymentRequestCartApi { ).currency_code.toUpperCase(), } ), headers: { + // the Store API nonce, which could later be overwritten. + Nonce: getPaymentRequestData( 'nonce' ).tokenized_order_nonce, // needed for validation of address data, etc. 'X-WooPayments-Express-Payment-Request-Nonce': getPaymentRequestData( 'nonce' ).tokenized_cart_nonce || @@ -108,14 +110,12 @@ export default class PaymentRequestCartApi { * @return {Promise} Cart response object. */ async createSeparateCart() { - return await this._request( { - method: 'GET', - path: '/wc/store/v1/cart', - headers: { - // sending an empty value, so that the custom session handler is leveraged to create a separate cart. - 'X-WooPayments-Tokenized-Cart-Session': '', - }, - } ); + this.cartRequestHeaders = { + // sending an empty value, so that the custom session handler is leveraged to create a separate cart. + 'X-WooPayments-Tokenized-Cart-Session': '', + }; + + return Promise.resolve(); } /**