Skip to content

Commit 63411e6

Browse files
committed
Restrict paypal to a set of countries
The list of supported countries is copied from the `buyPluginList.json` and `sellPluginList.json`.
1 parent e8e81f8 commit 63411e6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/plugins/ramps/rampConstraints.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,20 @@ function* constraintGenerator(
4949
FR, GR, HR, HU, IE, IS, IT, LI, LT, LU, LV,
5050
MT, NL, NO, PL, PT, RO, SE, SI, SK, JP, NZ,
5151
SG, CH, GB, IO, IM, JE, GG, GF, GP, YT,
52-
MQ, RE, MF
53-
`
52+
MQ, RE, MF `
53+
.replace(/\s/g, '')
54+
.split(',')
55+
56+
yield forCountries.includes(params.regionCode.countryCode)
57+
}
58+
59+
if (params.paymentType === 'paypal') {
60+
const forCountries = `
61+
AE, AR, AT, AU, BE, BR, CA, CH, CL, CO,
62+
CZ, DE, DK, EG, ES, FI, FR, GH, GR, HK,
63+
HU, IE, IN, IT, JP, KE, KR, MX, MY,
64+
NG, NL, NO, NZ, PE, PH, PL, PT, RU, SA,
65+
SE, SG, TH, TR, TZ, US, VN, ZA`
5466
.replace(/\s/g, '')
5567
.split(',')
5668

0 commit comments

Comments
 (0)