Skip to content

Commit

Permalink
more optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
frosso committed Jul 16, 2024
1 parent 89ff452 commit ab7b7f7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions client/tokenized-payment-request/cart-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit ab7b7f7

Please sign in to comment.