Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased (develop)

- added: Klarna and PayPal payment options on the Banxa buy path.
- added: Remote enable/disable of gift card providers via the info server's giftCardInfo config, supporting whole-provider disabling for Phaze and Bitrefill and per-brand disabling for Phaze.

## 4.49.0 (staging)
Expand Down
8 changes: 8 additions & 0 deletions src/__tests__/util/paymentTypeIcons.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ describe('paymentTypeIcons', () => {
expect(getPaymentTypeThemeKey('sepa')).toBe('paymentTypeLogoBankTransfer')
expect(getPaymentTypeThemeKey('wire')).toBe('paymentTypeLogoBankTransfer')
})

it('should return null for payment types without a dedicated icon', () => {
expect(getPaymentTypeThemeKey('klarna')).toBeNull()
})
})

describe('getPaymentTypeIcon', () => {
Expand All @@ -56,5 +60,9 @@ describe('paymentTypeIcons', () => {
const invalidTheme = {} as any
expect(getPaymentTypeIcon('applepay', invalidTheme)).toBeUndefined()
})

it('should return undefined for payment types mapped to null', () => {
expect(getPaymentTypeIcon('klarna', mockTheme)).toBeUndefined()
})
})
})
2 changes: 2 additions & 0 deletions src/__tests__/util/paymentTypeUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ describe('paymentTypeUtils', () => {
expect(getPaymentTypeDisplayName('credit')).toBe('Credit and Debit Card')
expect(getPaymentTypeDisplayName('venmo')).toBe('Venmo')
expect(getPaymentTypeDisplayName('sepa')).toBe('SEPA Bank Transfer')
expect(getPaymentTypeDisplayName('klarna')).toBe('Klarna')
expect(getPaymentTypeDisplayName('paypal')).toBe('Paypal')
})

it('should return original value for unknown payment types', () => {
Expand Down
1 change: 1 addition & 0 deletions src/locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2162,6 +2162,7 @@ const strings = {
instant_ach_bank_transfer: 'Instant ACH Bank Transfer',
ideal: 'iDEAL',
interac_e_transfer: 'Interac e-Transfer',
klarna: 'Klarna',
mexico_bank_transfer: 'Mexico Bank Transfer',
payid: 'PayID',
paypal: 'Paypal',
Expand Down
1 change: 1 addition & 0 deletions src/locales/strings/enUS.json
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,7 @@
"instant_ach_bank_transfer": "Instant ACH Bank Transfer",
"ideal": "iDEAL",
"interac_e_transfer": "Interac e-Transfer",
"klarna": "Klarna",
"mexico_bank_transfer": "Mexico Bank Transfer",
"payid": "PayID",
"paypal": "Paypal",
Expand Down
1 change: 1 addition & 0 deletions src/plugins/gui/fiatPluginTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const asFiatPaymentType = asValue(
'ideal',
'interac',
'iobank',
'klarna',
'mexicobank',
'payid',
'paypal',
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/ramps/banxa/banxaRampPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ const allowedPaymentTypes: AllowedPaymentTypes = {
ideal: true,
interac: true,
iobank: true,
klarna: true,
payid: true,
paypal: true,
pix: true,
sepa: false, // Leave this to Bity for now
turkishbank: true
Expand Down Expand Up @@ -151,10 +153,12 @@ const asBanxaPaymentType = asValue(
'DLOCALPIX',
'DLOCALZAIO',
'IDEAL',
'KLARNACKO',
'MANUALPAYMENT',
'MONOOVAPAYID',
'PRIMERAP',
'PRIMERCC',
'PRIMERPAYPAL',
'WORLDPAYGOOGLE',
'ZHACHSELL'
)
Expand Down Expand Up @@ -331,10 +335,12 @@ const typeMap: Record<BanxaPaymentType, FiatPaymentType> = {
DLOCALPIX: 'pix',
DLOCALZAIO: 'iobank',
IDEAL: 'ideal',
KLARNACKO: 'klarna',
MANUALPAYMENT: 'turkishbank',
MONOOVAPAYID: 'payid',
PRIMERAP: 'applepay',
PRIMERCC: 'credit',
PRIMERPAYPAL: 'paypal',
WORLDPAYGOOGLE: 'googlepay',
ZHACHSELL: 'ach'
}
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/ramps/utils/getSettlementRange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export function getBuySettlementRange(
case 'iobank':
// Not listed in GUI plugin lists; assume typical window
return RANGE(5, 'minutes', 24, 'hours')
case 'klarna':
return RANGE(5, 'minutes', 24, 'hours')
case 'mexicobank':
return RANGE(5, 'minutes', 24, 'hours')
case 'payid':
Expand Down Expand Up @@ -116,6 +118,8 @@ export function getSellSettlementRange(
case 'iobank':
// Not listed in GUI plugin lists; assume typical window
return RANGE(5, 'minutes', 24, 'hours')
case 'klarna':
return RANGE(5, 'minutes', 24, 'hours')
case 'mexicobank':
return RANGE(5, 'minutes', 24, 'hours')
case 'payid':
Expand Down
1 change: 1 addition & 0 deletions src/util/paymentTypeIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const paymentTypeToThemeKey: Record<FiatPaymentType, keyof Theme | null> = {
ideal: 'paymentTypeLogoIdeal',
interac: 'paymentTypeLogoInterac',
iobank: 'paymentTypeLogoBankTransfer', // Using bank transfer as fallback
klarna: null, // No dedicated Klarna asset yet; falls back to the provider icon. TODO: add an official Klarna logo
mexicobank: 'paymentTypeLogoBankTransfer', // Using bank transfer as fallback
payid: 'paymentTypeLogoPayid',
paypal: 'paymentTypeLogoPaypal',
Expand Down
1 change: 1 addition & 0 deletions src/util/paymentTypeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const paymentTypeDisplayNames: Record<string, string> = {
ideal: lstrings.ideal,
interac: lstrings.interac_e_transfer,
iobank: lstrings.bank_transfer,
klarna: lstrings.klarna,
mexicobank: lstrings.mexico_bank_transfer,
payid: lstrings.payid,
paypal: lstrings.paypal,
Expand Down
Loading