2021-09-15 16:36:02 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2021-09-24 13:34:07 +00:00
|
|
|
import { CanMakePaymentExtensionCallback } from '@woocommerce/type-defs/payments';
|
2021-09-15 16:36:02 +00:00
|
|
|
|
|
|
|
type CanMakePaymentExtensionCallbacks = Record<
|
|
|
|
string,
|
2021-09-24 13:34:07 +00:00
|
|
|
CanMakePaymentExtensionCallback
|
2021-09-15 16:36:02 +00:00
|
|
|
>;
|
|
|
|
export type NamespacedCanMakePaymentExtensionsCallbacks = Record<
|
|
|
|
string,
|
|
|
|
CanMakePaymentExtensionCallbacks
|
|
|
|
>;
|
|
|
|
export type ExtensionNamespace = keyof NamespacedCanMakePaymentExtensionsCallbacks;
|
|
|
|
export type PaymentMethodName = keyof CanMakePaymentExtensionCallbacks;
|
|
|
|
|
|
|
|
// Keeps callbacks registered by extensions for different payment methods
|
|
|
|
// eslint-disable-next-line prefer-const
|
|
|
|
export const canMakePaymentExtensionsCallbacks: NamespacedCanMakePaymentExtensionsCallbacks = {};
|
|
|
|
|
|
|
|
export const extensionsConfig = {
|
|
|
|
canMakePayment: canMakePaymentExtensionsCallbacks,
|
|
|
|
};
|