♻️ Move config object to appropriate file

This commit is contained in:
Philipp Stracker 2024-07-30 13:51:16 +02:00
parent ef6632c85f
commit 490cd1958b
No known key found for this signature in database
2 changed files with 25 additions and 18 deletions

View file

@ -6,6 +6,30 @@ export const PaymentMethods = {
GOOGLEPAY: 'ppcp-googlepay',
};
/**
* List of valid context values that the button can have.
*
* The "context" describes the placement or page where a payment button might be displayed.
*
* @type {Object}
*/
export const PaymentContext = {
Product: 'product',
Cart: 'cart',
Checkout: 'checkout',
PayNow: 'pay-now',
MiniCart: 'mini-cart',
BlockCart: 'cart-block',
BlockCheckout: 'checkout-block',
Preview: 'preview',
// Block editor contexts.
Blocks: [ 'cart-block', 'checkout-block' ],
// Custom gateway contexts.
Gateways: [ 'checkout', 'pay-now' ],
};
export const ORDER_BUTTON_SELECTOR = '#place_order';
export const getCurrentPaymentMethod = () => {