@unchainedshop/plugins
Version:
Official plugin collection for the Unchained Engine with payment, delivery, and pricing adapters
31 lines (30 loc) • 903 B
JavaScript
import { PaymentAdapter, PaymentDirector } from '@unchainedshop/core';
import { PaymentProviderType } from '@unchainedshop/core-payment';
const InvoicePrepaid = {
...PaymentAdapter,
key: 'shop.unchained.invoice-prepaid',
label: 'Invoice pre-paid',
version: '1.0.0',
initialConfiguration: [],
typeSupported: (type) => {
return type === PaymentProviderType.INVOICE;
},
actions: (config, context) => {
return {
...PaymentAdapter.actions(config, context),
configurationError: () => {
return null;
},
isActive: () => {
return true;
},
isPayLaterAllowed: () => {
return false;
},
charge: async () => {
return false;
},
};
},
};
PaymentDirector.registerAdapter(InvoicePrepaid);