Allow GooglePay use for non referral merchants

This commit is contained in:
Pedro Silva 2023-10-11 08:51:22 +01:00
parent c30ddd3b64
commit 8c6a58d05c
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
4 changed files with 28 additions and 24 deletions

View file

@ -50,6 +50,14 @@ return array(
return true;
},
// We assume it's a referral if we can check product status without API request failures.
'googlepay.is_referral' => static function ( ContainerInterface $container ): bool {
$status = $container->get( 'googlepay.helpers.apm-product-status' );
assert( $status instanceof ApmProductStatus );
return ! $status->has_request_failure();
},
'googlepay.availability_notice' => static function ( ContainerInterface $container ): AvailabilityNotice {
return new AvailabilityNotice(
$container->get( 'googlepay.helpers.apm-product-status' ),