Clean AppSwitch hash params on Pay for Order page
Some checks are pending
CI / PHP 7.4 (push) Waiting to run
CI / PHP 8.0 (push) Waiting to run
CI / PHP 8.1 (push) Waiting to run
CI / PHP 8.2 (push) Waiting to run
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
PR Playground Demo / prepare_version (push) Waiting to run
PR Playground Demo / build_plugin (push) Blocked by required conditions
PR Playground Demo / create_archive (push) Blocked by required conditions
PR Playground Demo / Comment on PR with Playground details (push) Blocked by required conditions

This commit is contained in:
Himad M 2025-07-28 20:31:23 -04:00
parent af71409850
commit bde2eb8fbe
No known key found for this signature in database
GPG key ID: 5FC769E9888A7B98

View file

@ -1,7 +1,14 @@
import resumeFlowHelper from '../Helper/ResumeFlowHelper';
const onApprove = ( context, errorHandler, spinner ) => {
return ( data, actions ) => {
spinner.block();
errorHandler.clear();
// Pay Now submits via form (not AJAX), so we can't detect payment errors.
// Preemptively remove hash params to prevent reload issues.
if ( resumeFlowHelper.isResumeFlow() ) {
resumeFlowHelper.cleanHashParams();
}
return fetch( context.config.ajax.approve_order.endpoint, {
method: 'POST',