Add ApplePay subscription validations in block pages.

This commit is contained in:
Pedro Silva 2024-01-30 17:46:28 +00:00
parent be7ece91da
commit c342a4a0d8
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
5 changed files with 13 additions and 7 deletions

View file

@ -9,9 +9,14 @@ class BaseHandler {
this.ppcpConfig = ppcpConfig;
}
isVaultV3Mode() {
return this.ppcpConfig?.save_payment_methods?.id_token // vault v3
&& ! this.ppcpConfig.data_client_id.paypal_subscriptions_enabled; // not PayPal Subscriptions mode
}
validateContext() {
if ( this.ppcpConfig?.locations_with_subscription_product?.cart ) {
return false;
return this.isVaultV3Mode();
}
return true;
}

View file

@ -7,7 +7,7 @@ class PayNowHandler extends BaseHandler {
validateContext() {
if ( this.ppcpConfig?.locations_with_subscription_product?.payorder ) {
return false;
return this.isVaultV3Mode();
}
return true;
}

View file

@ -9,7 +9,7 @@ class SingleProductHandler extends BaseHandler {
validateContext() {
if ( this.ppcpConfig?.locations_with_subscription_product?.product ) {
return false;
return this.isVaultV3Mode();
}
return true;
}