UNPKG

@unchainedshop/plugins

Version:

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

14 lines (13 loc) 427 B
import { OrderPricingSheet } from '@unchainedshop/core'; const roundedAmountFromOrder = (order) => { const pricing = OrderPricingSheet({ calculation: order.calculation, currencyCode: order.currencyCode, }); const { currencyCode, amount } = pricing.total({ useNetPrice: false }); return { currencyCode, amount: Math.round(amount), }; }; export default roundedAmountFromOrder;