Skip to content

Commit

Permalink
merge upe gateway into legacy gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Karimov committed Dec 26, 2023
1 parent 611f124 commit 1255ed4
Show file tree
Hide file tree
Showing 24 changed files with 1,062 additions and 1,642 deletions.
33 changes: 0 additions & 33 deletions client/checkout/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,39 +440,6 @@ export default class WCPayAPI {
} );
}

/**
* Process checkout and update payment intent via AJAX.
*
* @param {string} paymentIntentId ID of payment intent to be updated.
* @param {Object} fields Checkout fields.
* @param {string} fingerprint User fingerprint.
* @return {Promise} Promise containing redirect URL for UPE element.
*/
processCheckout( paymentIntentId, fields, fingerprint ) {
return this.request(
buildAjaxURL( getConfig( 'wcAjaxUrl' ), 'checkout', '' ),
{
...fields,
wc_payment_intent_id: paymentIntentId,
'wcpay-fingerprint': fingerprint,
}
)
.then( ( response ) => {
if ( response.result === 'failure' ) {
throw new Error( response.messages );
}
return response;
} )
.catch( ( error ) => {
if ( error.message ) {
throw error;
} else {
// Covers the case of error on the Ajaxrequest.
throw new Error( error.statusText );
}
} );
}

/**
* Submits shipping address to get available shipping options
* from Payment Request button.
Expand Down
Loading

0 comments on commit 1255ed4

Please sign in to comment.