user upgrades: add bank payment methods for European countries.

Add the following bank redirect payment methods:

* https://stripe.com/docs/payments/bancontact
* https://stripe.com/docs/payments/eps
* https://stripe.com/docs/payments/giropay
* https://stripe.com/docs/payments/ideal
* https://stripe.com/docs/payments/p24

These methods are used in Austria, Belgium, Germany, the Netherlands,
and Poland.

These methods require payments to be denominated in EUR, which means we
have to set prices in both USD and EUR, and we have to automatically
detect which currency to use based on the user's country. We also have
to automatically detect which payment methods to offer based on the
user's country. We do this by using Cloudflare's CF-IPCountry header to
geolocate the user's country.

This also switches to using prices and products defined in Stripe
instead of generated on-the-fly when creating the checkout.
This commit is contained in:
evazion
2020-12-31 04:32:07 -06:00
parent bf09940a55
commit d0bb4ed398
7 changed files with 219 additions and 43 deletions

View File

@@ -375,6 +375,27 @@ module Danbooru
def stripe_webhook_secret
end
def stripe_gold_usd_price_id
end
def stripe_platinum_usd_price_id
end
def stripe_gold_to_platinum_usd_price_id
end
def stripe_gold_eur_price_id
end
def stripe_platinum_eur_price_id
end
def stripe_gold_to_platinum_eur_price_id
end
def stripe_promotion_discount_id
end
def twitter_api_key
end