mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Dispaly googlepay payment method only if googlepay button is enabled
This commit is contained in:
parent
e52939200f
commit
f8ed3328a8
1 changed files with 8 additions and 3 deletions
|
@ -173,10 +173,15 @@ class GooglepayModule implements ModuleInterface {
|
|||
return $methods;
|
||||
}
|
||||
|
||||
$googlepay_gateway = $c->get( 'googlepay.wc-gateway' );
|
||||
assert( $googlepay_gateway instanceof WC_Payment_Gateway );
|
||||
$settings = $c->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof Settings );
|
||||
|
||||
$methods[] = $googlepay_gateway;
|
||||
if ( $settings->has( 'googlepay_button_enabled' ) && $settings->get( 'googlepay_button_enabled' ) ) {
|
||||
$googlepay_gateway = $c->get( 'googlepay.wc-gateway' );
|
||||
assert( $googlepay_gateway instanceof WC_Payment_Gateway );
|
||||
|
||||
$methods[] = $googlepay_gateway;
|
||||
}
|
||||
|
||||
return $methods;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue