@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
17 lines (14 loc) • 484 B
text/typescript
import { OrderPricingSheet } from '@unchainedshop/core';
import { Order } from '@unchainedshop/core-orders';
const roundedAmountFromOrder = (order: Order): { currency: string; amount: number } => {
const pricing = OrderPricingSheet({
calculation: order.calculation,
currency: order.currency,
});
const { currency, amount } = pricing.total({ useNetPrice: false });
return {
currency,
amount: Math.round(amount),
};
};
export default roundedAmountFromOrder;