mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Add filter to status check
This commit is contained in:
parent
2234b895da
commit
7cf1105b51
1 changed files with 9 additions and 6 deletions
|
@ -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';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue