StephD
StephD

Reputation: 304

Only allowing purchases in the US with Stripe

Novice programmer here, using this setup for stripe (mostly vanilla js and node).

I wanted to make it so only people in the US and Canada can buy a t-shirt from me. I see on Stripe's docs that this API is depreciated.

Any suggestions as to how I would do this?

Upvotes: 1

Views: 1643

Answers (1)

koopajah
koopajah

Reputation: 25572

The best option is to use Radar which lets you build custom rules to control which payments you want to accept and which ones you want to block. This would let you create a rule blocking any payment coming from a card that wasn't issued in Canada or the United States. This is documented here and the rule would look like this:

NOT (:card_country: IN ('FR','IE','ES'))

Otherwise, if you want to do this programmatically, the best option is to look at the country property of a card PaymentMethod and reject payments if the country is not US or CA.

Upvotes: 2

Related Questions