mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🐛 Fix issue with missing button in checkout
When the separate “Google Pay gateway” is disabled, the Google Pay button should be rendered inside the “PayPal gateway” container.
This commit is contained in:
parent
d9a0c6e19a
commit
2944ecc786
1 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,7 @@ import { apmButtonsInit } from '../Helper/ApmButtons';
|
|||
import {
|
||||
getCurrentPaymentMethod,
|
||||
PaymentContext,
|
||||
PaymentMethods,
|
||||
} from '../Helper/CheckoutMethodState';
|
||||
import {
|
||||
ButtonEvents,
|
||||
|
@ -673,6 +674,10 @@ export default class PaymentButton {
|
|||
|
||||
// Events relevant for buttons inside a payment gateway.
|
||||
if ( PaymentContext.Gateways.includes( this.context ) ) {
|
||||
const parentMethod = this.isSeparateGateway
|
||||
? this.methodId
|
||||
: PaymentMethods.PAYPAL;
|
||||
|
||||
// Hide the button right after the user selected _any_ gateway.
|
||||
observeButtonEvent( {
|
||||
event: ButtonEvents.INVALIDATE,
|
||||
|
@ -682,7 +687,7 @@ export default class PaymentButton {
|
|||
// Show the button (again) when the user selected the current gateway.
|
||||
observeButtonEvent( {
|
||||
event: ButtonEvents.RENDER,
|
||||
paymentMethod: this.methodId,
|
||||
paymentMethod: parentMethod,
|
||||
callback: () => ( this.isVisible = true ),
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue