File size: 735 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import { translate } from 'i18n-calypso';
/**
* Return a string that represents the User facing name for payment method
*
* Returns the original string if a known payment method cannot be found.
*/
export function paymentMethodName( method: string ): string {
const paymentMethodsNames = {
alipay: 'Alipay',
bancontact: 'Bancontact',
card: translate( 'Credit or debit card' ),
eps: 'EPS',
ideal: 'iDEAL',
netbanking: 'Net Banking',
paypal: 'PayPal',
p24: 'Przelewy24',
'apple-pay': 'Apple Pay',
wechat: translate( 'WeChat Pay', {
comment: 'Name for WeChat Pay - https://pay.weixin.qq.com/',
} ),
sofort: 'Sofort',
};
return ( paymentMethodsNames as Record< string, string > )[ method ] || method;
}
|