Skip to content

Commit 0e5dee6

Browse files
committed
Enable Klarna and PayPal on the Banxa buy path
Banxa already exposes Klarna (KLARNACKO, SEK) and PayPal (PRIMERPAYPAL, EUR) via its payment-methods API, but the GUI dropped both because their payment-type codes were not recognized. Add a klarna FiatPaymentType, map the two Banxa codes, and allow both on the Banxa buy path so the options surface in the ramp flow. PayPal reuses the existing logo and string; Klarna falls back to the provider icon until a dedicated asset is added.
1 parent 80029ae commit 0e5dee6

16 files changed

Lines changed: 32 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- added: Changelly swap provider
88
- added: NYM swap provider (`nymswap`)
99
- added: Optional Bridgeless swap referral id via the `BRIDGELESS_INIT` env config, passed through to the swap plugin.
10+
- added: Klarna and PayPal payment options on the Banxa buy path.
1011
- changed: Route maestro test builds to a dedicated Zealot channel so they no longer appear in the production release list.
1112
- changed: Hide the wallet "Get Raw Keys" option behind Developer Mode, while still showing it for wallets that fail to load.
1213
- fixed: Share button referral link now uses the dl.edge.app deep-link domain so appreferred attribution is tracked

src/__tests__/util/paymentTypeIcons.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ describe('paymentTypeIcons', () => {
1212
paymentTypeLogoGooglePay: { uri: 'google-pay-icon.png' },
1313
paymentTypeLogoIdeal: { uri: 'ideal-icon.png' },
1414
paymentTypeLogoInterac: { uri: 'interac-icon.png' },
15+
paymentTypeLogoKlarna: { uri: 'klarna-icon.png' },
1516
paymentTypeLogoPayid: { uri: 'payid-icon.png' },
1617
paymentTypeLogoPaypal: { uri: 'paypal-icon.png' },
1718
paymentTypeLogoPix: { uri: 'pix-icon.png' },
@@ -24,6 +25,7 @@ describe('paymentTypeIcons', () => {
2425
expect(getPaymentTypeThemeKey('applepay')).toBe('paymentTypeLogoApplePay')
2526
expect(getPaymentTypeThemeKey('credit')).toBe('paymentTypeLogoCreditCard')
2627
expect(getPaymentTypeThemeKey('paypal')).toBe('paymentTypeLogoPaypal')
28+
expect(getPaymentTypeThemeKey('klarna')).toBe('paymentTypeLogoKlarna')
2729
})
2830

2931
it('should return bank transfer key for fallback payment types', () => {
@@ -41,6 +43,9 @@ describe('paymentTypeIcons', () => {
4143
expect(getPaymentTypeIcon('credit', mockTheme)).toEqual({
4244
uri: 'credit-card-icon.png'
4345
})
46+
expect(getPaymentTypeIcon('klarna', mockTheme)).toEqual({
47+
uri: 'klarna-icon.png'
48+
})
4449
})
4550

4651
it('should return bank transfer icon for fallback payment types', () => {

src/__tests__/util/paymentTypeUtils.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ describe('paymentTypeUtils', () => {
1010
expect(getPaymentTypeDisplayName('credit')).toBe('Credit and Debit Card')
1111
expect(getPaymentTypeDisplayName('venmo')).toBe('Venmo')
1212
expect(getPaymentTypeDisplayName('sepa')).toBe('SEPA Bank Transfer')
13+
expect(getPaymentTypeDisplayName('klarna')).toBe('Klarna')
14+
expect(getPaymentTypeDisplayName('paypal')).toBe('Paypal')
1315
})
1416

1517
it('should return original value for unknown payment types', () => {
17.7 KB
Loading

src/locales/en_US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,6 +2167,7 @@ const strings = {
21672167
instant_ach_bank_transfer: 'Instant ACH Bank Transfer',
21682168
ideal: 'iDEAL',
21692169
interac_e_transfer: 'Interac e-Transfer',
2170+
klarna: 'Klarna',
21702171
mexico_bank_transfer: 'Mexico Bank Transfer',
21712172
payid: 'PayID',
21722173
paypal: 'Paypal',

src/locales/strings/enUS.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,7 @@
16641664
"instant_ach_bank_transfer": "Instant ACH Bank Transfer",
16651665
"ideal": "iDEAL",
16661666
"interac_e_transfer": "Interac e-Transfer",
1667+
"klarna": "Klarna",
16671668
"mexico_bank_transfer": "Mexico Bank Transfer",
16681669
"payid": "PayID",
16691670
"paypal": "Paypal",

src/plugins/gui/fiatPluginTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const asFiatPaymentType = asValue(
5757
'ideal',
5858
'interac',
5959
'iobank',
60+
'klarna',
6061
'mexicobank',
6162
'payid',
6263
'paypal',

src/plugins/ramps/banxa/banxaRampPlugin.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ const allowedPaymentTypes: AllowedPaymentTypes = {
9292
ideal: true,
9393
interac: true,
9494
iobank: true,
95+
klarna: true,
9596
payid: true,
97+
paypal: true,
9698
pix: true,
9799
sepa: false, // Leave this to Bity for now
98100
turkishbank: true
@@ -152,10 +154,12 @@ const asBanxaPaymentType = asValue(
152154
'DLOCALPIX',
153155
'DLOCALZAIO',
154156
'IDEAL',
157+
'KLARNACKO',
155158
'MANUALPAYMENT',
156159
'MONOOVAPAYID',
157160
'PRIMERAP',
158161
'PRIMERCC',
162+
'PRIMERPAYPAL',
159163
'WORLDPAYGOOGLE',
160164
'ZHACHSELL'
161165
)
@@ -332,10 +336,12 @@ const typeMap: Record<BanxaPaymentType, FiatPaymentType> = {
332336
DLOCALPIX: 'pix',
333337
DLOCALZAIO: 'iobank',
334338
IDEAL: 'ideal',
339+
KLARNACKO: 'klarna',
335340
MANUALPAYMENT: 'turkishbank',
336341
MONOOVAPAYID: 'payid',
337342
PRIMERAP: 'applepay',
338343
PRIMERCC: 'credit',
344+
PRIMERPAYPAL: 'paypal',
339345
WORLDPAYGOOGLE: 'googlepay',
340346
ZHACHSELL: 'ach'
341347
}

src/plugins/ramps/utils/getSettlementRange.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export function getBuySettlementRange(
6161
case 'iobank':
6262
// Not listed in GUI plugin lists; assume typical window
6363
return RANGE(5, 'minutes', 24, 'hours')
64+
case 'klarna':
65+
return RANGE(5, 'minutes', 24, 'hours')
6466
case 'mexicobank':
6567
return RANGE(5, 'minutes', 24, 'hours')
6668
case 'payid':
@@ -116,6 +118,8 @@ export function getSellSettlementRange(
116118
case 'iobank':
117119
// Not listed in GUI plugin lists; assume typical window
118120
return RANGE(5, 'minutes', 24, 'hours')
121+
case 'klarna':
122+
return RANGE(5, 'minutes', 24, 'hours')
119123
case 'mexicobank':
120124
return RANGE(5, 'minutes', 24, 'hours')
121125
case 'payid':

src/theme/variables/edgeDark.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import paymentTypeLogoGiftCard from '../../assets/images/paymentTypes/paymentTyp
1515
import paymentTypeLogoGooglePay from '../../assets/images/paymentTypes/paymentTypeLogoGooglePay.png'
1616
import paymentTypeLogoIdeal from '../../assets/images/paymentTypes/paymentTypeLogoIdeal.png'
1717
import paymentTypeLogoInterac from '../../assets/images/paymentTypes/paymentTypeLogoInterac.png'
18+
import paymentTypeLogoKlarna from '../../assets/images/paymentTypes/paymentTypeLogoKlarna.png'
1819
import paymentTypeLogoPayid from '../../assets/images/paymentTypes/paymentTypeLogoPayid.png'
1920
import paymentTypeLogoPaynow from '../../assets/images/paymentTypes/paymentTypeLogoPaynow.png'
2021
import paymentTypeLogoPaypal from '../../assets/images/paymentTypes/paymentTypeLogoPaypal.png'
@@ -477,6 +478,7 @@ export const edgeDark: Theme = {
477478
paymentTypeLogoGooglePay,
478479
paymentTypeLogoIdeal,
479480
paymentTypeLogoInterac,
481+
paymentTypeLogoKlarna,
480482
paymentTypeLogoPayid,
481483
paymentTypeLogoPaynow,
482484
paymentTypeLogoPaypal,

0 commit comments

Comments
 (0)