| 12345678910111213141516171819202122232425 |
- import Big from 'big.js';
- import {paymentMethodImageMap} from "@/utils/constants";
- export function getPaymentMethodLogo(payment: string) {
- return paymentMethodImageMap[payment] || paymentMethodImageMap.default;
- }
- export function getPaymentDescription(param: {payment: string; grandTotal: number; symble: string;}) {
- switch (param.payment) {
- case 'klarna':
- case 'awxklarna':
- case 'awxafterpay':
- case 'afterpay':
- const n = Big(param.grandTotal).div(4).toFixed(2);
- return `4 interest-free payments of ${param.symble}${n}`;
- case 'applepay':
- return 'Apple Pay';
- case 'paypal_smart_button':
- return 'Paypal';
- case 'airwallex':
- return '';
- default:
- return '';
- }
- }
|