UNPKG

@unchainedshop/plugins

Version:

Official plugin collection for the Unchained Engine with payment, delivery, and pricing adapters

28 lines (27 loc) 892 B
import { PaymentPricingAdapter, PaymentPricingDirector, } from '@unchainedshop/core'; export const PaymentFreePrice = { ...PaymentPricingAdapter, key: 'shop.unchained.pricing.payment-free', label: 'Free Payment', version: '1.0.0', orderIndex: 0, isActivatedFor: () => { return true; }, actions: (params) => { const pricingAdapter = PaymentPricingAdapter.actions(params); return { ...pricingAdapter, calculate: async () => { pricingAdapter.resultSheet().addFee({ amount: 0, isNetPrice: false, isTaxable: false, meta: { adapter: PaymentFreePrice.key }, }); return pricingAdapter.calculate(); }, }; }, }; PaymentPricingDirector.registerAdapter(PaymentFreePrice);