#coldrain
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ can you elaborate a bit? What specifically are you trying to do? What product(s) are you using (e.g. Invoices, Payment Intents, Payment Element, Card Element, etc.)?
payment
shipping_address_collection: {
allowed_countries: ['US', 'CA'],
},
I need to allow all countries except SOME
What Stripe product are you using? Checkout or Payment Link?
Okay, you'll have to hard-code all the accepted countries somewhere and pass them as an array to shipping_address_collection.
Is this a joke? ๐ I need to manually add EVERY country out of 200? ๐
Yes, and note that there is a documented list of unsupported country codes:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-shipping_address_collection-allowed_countries
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Can s1 give me array of countries?
Pardon?
['US', 'CA'] array of all countries so I don't have to do it manually
They're all listed in the API spec, you can copy from there
['AC','AD','AE','AF','AG','AI','AL','AM','AO','AQ','AR','AT','AU','AW','AX','AZ','BA','BB','BD','BE','BF','BG','BH','BI','BJ','BL','BM','BN','BO','BQ','BR','BS','BT','BV','BW','BY','BZ','CA','CD','CF','CG','CH','CI','CK','CL','CM','CN','CO','CR','CV','CW','CY','CZ','DE','DJ','DK','DM','DO','DZ','EC','EE','EG','EH','ER','ES','ET','FI','FJ','FK','FO','FR','GA','GB','GD','GE','GF','GG','GH','GI','GL','GM','GN','GP','GQ','GR','GS','GT','GU','GW','GY','HK','HN','HR','HT','HU','ID','IE','IL','IM','IN','IO','IQ','IS','IT','JE','JM','JO','JP','KE','KG','KH','KI','KM','KN','KR','KW','KY','KZ','LA','LB','LC','LI','LK','LR','LS','LT','LU','LV','LY','MA','MC','MD','ME','MF','MG','MK','ML','MM','MN','MO','MQ','MR','MS','MT','MU','MV','MW','MX','MY','MZ','NA','NC','NE','NG','NI','NL','NO','NP','NR','NU','NZ','OM','PA','PE','PF','PG','PH','PK','PL','PM','PN','PR','PS','PT','PY','QA','RE','RO','RS','RU','RW','SA','SB','SC','SE','SG','SH','SI','SJ','SK','SL','SM','SN','SO','SR','SS','ST','SV','SX','SZ','TA','TC','TD','TF','TG','TH','TJ','TK','TL','TM','TN','TO','TR','TT','TV','TW','TZ','UA','UG','US','UY','UZ','VA','VC','VE','VG','VN','VU','WF','WS','XK','YE','YT','ZA','ZM','ZW','ZZ']
This is a copy of that list from the docs, with apostrophes and commas added
omg thanks
vscode + regex find & replace
nice one