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
|
|
|
|
>;
|
2022-06-15 09:56:52 +00:00
|
|
|
export type ExtensionNamespace =
|
|
|
|
keyof NamespacedCanMakePaymentExtensionsCallbacks;
|
2021-09-15 16:36:02 +00:00
|
|
|
export type PaymentMethodName = keyof CanMakePaymentExtensionCallbacks;
|
|
|
|
|
|
|
|
// Keeps callbacks registered by extensions for different payment methods
|
|
|
|
// eslint-disable-next-line prefer-const
|
2022-06-15 09:56:52 +00:00
|
|
|
export const canMakePaymentExtensionsCallbacks: NamespacedCanMakePaymentExtensionsCallbacks =
|
|
|
|
{};
|
2021-09-15 16:36:02 +00:00
|
|
|
|
|
|
|
export const extensionsConfig = {
|
|
|
|
canMakePayment: canMakePaymentExtensionsCallbacks,
|
|
|
|
};
|