Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate gateways implementation - step II #7944

Merged
merged 8 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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