mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
23 lines
602 B
JavaScript
23 lines
602 B
JavaScript
export const PaymentMethods = {
|
|
PAYPAL: 'ppcp-gateway',
|
|
CARDS: 'ppcp-credit-card-gateway',
|
|
OXXO: 'ppcp-oxxo-gateway',
|
|
CARD_BUTTON: 'ppcp-card-button-gateway',
|
|
GOOGLEPAY: 'ppcp-googlepay',
|
|
};
|
|
|
|
export const ORDER_BUTTON_SELECTOR = '#place_order';
|
|
|
|
export const getCurrentPaymentMethod = () => {
|
|
const el = document.querySelector( 'input[name="payment_method"]:checked' );
|
|
if ( ! el ) {
|
|
return null;
|
|
}
|
|
|
|
return el.value;
|
|
};
|
|
|
|
export const isSavedCardSelected = () => {
|
|
const savedCardList = document.querySelector( '#saved-credit-card' );
|
|
return savedCardList && savedCardList.value !== '';
|
|
};
|