🚧 New Gateway for Apple Pay

This commit is contained in:
Philipp Stracker 2024-07-22 18:29:39 +02:00
parent 10439ff02b
commit eb216425fb
No known key found for this signature in database
12 changed files with 516 additions and 268 deletions

View file

@ -1,3 +1,5 @@
/* global PayPalCommerceGateway */
import CheckoutActionHandler from '../ActionHandler/CheckoutActionHandler';
import { setVisible, setVisibleByClass } from '../Helper/Hiding';
import {
@ -181,9 +183,14 @@ class CheckoutBootstap {
const isSeparateButtonGateway = [ PaymentMethods.CARD_BUTTON ].includes(
currentPaymentMethod
);
const isApplePayMethod =
currentPaymentMethod === PaymentMethods.APPLEPAY;
const isSavedCard = isCard && isSavedCardSelected();
const isNotOurGateway =
! isPaypal && ! isCard && ! isSeparateButtonGateway;
! isPaypal &&
! isCard &&
! isSeparateButtonGateway &&
! isApplePayMethod;
const isFreeTrial = PayPalCommerceGateway.is_free_trial_cart;
const hasVaultedPaypal =
PayPalCommerceGateway.vaulted_paypal_email !== '';
@ -227,6 +234,8 @@ class CheckoutBootstap {
}
}
setVisible( '#ppc-button-ppcp-applepay', isApplePayMethod );
jQuery( document.body ).trigger( 'ppcp_checkout_rendered' );
}

View file

@ -3,6 +3,7 @@ export const PaymentMethods = {
CARDS: 'ppcp-credit-card-gateway',
OXXO: 'ppcp-oxxo-gateway',
CARD_BUTTON: 'ppcp-card-button-gateway',
APPLEPAY: 'ppcp-applepay',
};
export const ORDER_BUTTON_SELECTOR = '#place_order';