Add filter to status check

This commit is contained in:
carmenmaymo 2023-09-18 13:23:45 +02:00
parent 2234b895da
commit 7cf1105b51
No known key found for this signature in database
GPG key ID: 6023F686B0F3102E

View file

@ -31,12 +31,15 @@ return array(
);
},
'applepay.enabled' => static function ( ContainerInterface $container ): bool {
$status = $container->get( 'applepay.apple-product-status' );
assert( $status instanceof AppleProductStatus );
/**
* If merchant isn't onboarded via /v1/customer/partner-referrals this returns false as the API call fails.
*/
return apply_filters( 'woocommerce_paypal_payments_applepay_product_status', $status->apple_is_active() );
if ( apply_filters( 'woocommerce_paypal_payments_applepay_validate_product_status', false ) ) {
$status = $container->get( 'applepay.apple-product-status' );
assert( $status instanceof AppleProductStatus );
/**
* If merchant isn't onboarded via /v1/customer/partner-referrals this returns false as the API call fails.
*/
return apply_filters( 'woocommerce_paypal_payments_applepay_product_status', $status->apple_is_active() );
}
return true;
},
'applepay.server_supported' => static function ( ContainerInterface $container ): bool {
return ! empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] !== 'off';