mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
♻️ Restore correct order of payload creation
The token must be added after the last filter, to maintain backwards compatibility!
This commit is contained in:
parent
8cb66440d3
commit
54046cd307
1 changed files with 10 additions and 3 deletions
|
@ -67,7 +67,6 @@ class PartnerReferralsData {
|
||||||
'woocommerce_paypal_payments_partner_config_override_return_url',
|
'woocommerce_paypal_payments_partner_config_override_return_url',
|
||||||
admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway' )
|
admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway' )
|
||||||
);
|
);
|
||||||
$return_url = add_query_arg( array( 'ppcpToken' => $onboarding_token ), $return_url );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the label of the "Return to your shop" button.
|
* Filter the label of the "Return to your shop" button.
|
||||||
|
@ -118,8 +117,16 @@ class PartnerReferralsData {
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the partners referrals data.
|
* Filter the final partners referrals data collection.
|
||||||
*/
|
*/
|
||||||
return apply_filters( 'ppcp_partner_referrals_data', $payload );
|
$payload = apply_filters( 'ppcp_partner_referrals_data', $payload );
|
||||||
|
|
||||||
|
// Add the nonce in the end, to maintain backwards compatibility of filters.
|
||||||
|
$payload['partner_config_override']['return_url'] = add_query_arg(
|
||||||
|
array( 'ppcpToken' => $onboarding_token ),
|
||||||
|
$payload['partner_config_override']['return_url']
|
||||||
|
);
|
||||||
|
|
||||||
|
return $payload;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue