mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Allow GooglePay use for non referral merchants
This commit is contained in:
parent
c30ddd3b64
commit
8c6a58d05c
4 changed files with 28 additions and 24 deletions
|
@ -10,8 +10,6 @@ declare(strict_types=1);
|
|||
namespace WooCommerce\PayPalCommerce\Googlepay;
|
||||
|
||||
use Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry;
|
||||
use WooCommerce\PayPalCommerce\AdminNotices\Entity\Message;
|
||||
use WooCommerce\PayPalCommerce\AdminNotices\Repository\Repository;
|
||||
use WooCommerce\PayPalCommerce\Button\Assets\ButtonInterface;
|
||||
use WooCommerce\PayPalCommerce\Googlepay\Helper\ApmProductStatus;
|
||||
use WooCommerce\PayPalCommerce\Googlepay\Helper\AvailabilityNotice;
|
||||
|
@ -62,13 +60,21 @@ class GooglepayModule implements ModuleInterface {
|
|||
$button->initialize();
|
||||
|
||||
// Check if this merchant can activate / use the buttons.
|
||||
if ( ! $c->get( 'googlepay.available' ) ) {
|
||||
// We allow non referral merchants as they can potentially still use GooglePay, we just have no way of checking the capability.
|
||||
if ( ( ! $c->get( 'googlepay.available' ) ) && $c->get( 'googlepay.is_referral' ) ) {
|
||||
$availability_notice = $c->get( 'googlepay.availability_notice' );
|
||||
assert( $availability_notice instanceof AvailabilityNotice );
|
||||
$availability_notice->execute();
|
||||
return;
|
||||
}
|
||||
|
||||
// Show notice and continue if merchant isn't onboarded via a referral.
|
||||
if ( ! $c->get( 'googlepay.is_referral' ) ) {
|
||||
$availability_notice = $c->get( 'googlepay.availability_notice' );
|
||||
assert( $availability_notice instanceof AvailabilityNotice );
|
||||
$availability_notice->execute();
|
||||
}
|
||||
|
||||
// Initializes button rendering.
|
||||
add_action(
|
||||
'wp',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue