UNPKG

@unchainedshop/plugins

Version:

Because of a Typescript issue with upstream "postfinancecheckout", the Postfinance plugin has been disabled from transpilation, import the source ts files from src and enable node_module tsc or copy over the src/payment/postfinance-checkout to your projec

40 lines 1.28 kB
import { DeliveryAdapter, DeliveryDirector } from '@unchainedshop/core'; import { DeliveryProviderType } from '@unchainedshop/core-delivery'; const PickMup = { ...DeliveryAdapter, key: 'shop.unchained.stores', label: 'Pre-configured Stores', version: '1.0.0', typeSupported: (type) => { return type === DeliveryProviderType.PICKUP; }, actions: (config, context) => { const getStores = () => { return config.reduce((current, item) => { if (item.key === 'stores') return JSON.parse(item.value); return current; }, []); }; return { ...DeliveryAdapter.actions(config, context), isActive() { return true; }, isAutoReleaseAllowed() { return false; }, configurationError() { return null; }, pickUpLocationById: async (id) => { return getStores().find((store) => store._id === id); }, pickUpLocations: async () => { return getStores(); }, }; }, }; DeliveryDirector.registerAdapter(PickMup); //# sourceMappingURL=stores.js.map