Skip to content

Commit

Permalink
Consolidate gateways implementation - step II (#7944)
Browse files Browse the repository at this point in the history
Co-authored-by: Timur Karimov <[email protected]>
Co-authored-by: Timur Karimov <[email protected]>
  • Loading branch information
3 people authored Dec 29, 2023
1 parent 60f7e86 commit 62c69cb
Show file tree
Hide file tree
Showing 25 changed files with 1,016 additions and 2,046 deletions.
4 changes: 4 additions & 0 deletions changelog/cleanup-upe-gateways-II
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: dev

Cleanup the deprecated payment gateway processing - part VI
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 62c69cb

Please sign in to comment.