mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Fix ApplePay token update
This commit is contained in:
parent
8d82e51506
commit
0cf3f946c6
2 changed files with 7 additions and 2 deletions
|
@ -13,7 +13,7 @@ class BaseHandler {
|
|||
isVaultV3Mode() {
|
||||
return this.ppcpConfig?.save_payment_methods?.id_token // vault v3
|
||||
&& ! this.ppcpConfig?.data_client_id?.paypal_subscriptions_enabled // not PayPal Subscriptions mode
|
||||
&& this.ppcpConfig?.ppcpConfig.can_save_vault_token; // vault is enabled
|
||||
&& this.ppcpConfig?.can_save_vault_token; // vault is enabled
|
||||
}
|
||||
|
||||
validateContext() {
|
||||
|
|
|
@ -105,8 +105,13 @@ class VaultingModule implements ModuleInterface {
|
|||
return $tokens;
|
||||
}
|
||||
|
||||
$is_post = isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] === 'POST';
|
||||
|
||||
// Exclude ApplePay tokens from payment pages.
|
||||
if ( is_checkout() || is_cart() || is_product() ) {
|
||||
if (
|
||||
( is_checkout() || is_cart() || is_product() )
|
||||
&& ! $is_post // Don't check on POST so we have all payment methods on form submissions.
|
||||
) {
|
||||
foreach ( $tokens as $index => $token ) {
|
||||
if ( $token instanceof PaymentTokenApplePay ) {
|
||||
unset( $tokens[ $index ] );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue