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:
@@ -112,12 +112,12 @@
|
||||
<td><%= link_to "Get #{Danbooru.config.canonical_app_name} Platinum", login_path(url: new_user_upgrade_path), class: "login-button" %></td>
|
||||
<% elsif @recipient.level == User::Levels::MEMBER %>
|
||||
<td></td>
|
||||
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", user_upgrades_path(user_id: @recipient.id, upgrade_type: "gold"), remote: true, disable_with: "Redirecting..." %></td>
|
||||
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Platinum", user_upgrades_path(user_id: @recipient.id, upgrade_type: "platinum"), remote: true, disable_with: "Redirecting..." %></td>
|
||||
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", user_upgrades_path(user_id: @recipient.id, upgrade_type: "gold", country: params[:country]), remote: true, disable_with: "Redirecting..." %></td>
|
||||
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Platinum", user_upgrades_path(user_id: @recipient.id, upgrade_type: "platinum", country: params[:country]), remote: true, disable_with: "Redirecting..." %></td>
|
||||
<% elsif @recipient.level == User::Levels::GOLD %>
|
||||
<td></td>
|
||||
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", nil, disabled: true %></td>
|
||||
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Platinum", user_upgrades_path(user_id: @recipient.id, upgrade_type: "gold_to_platinum"), remote: true, disable_with: "Redirecting..." %></td>
|
||||
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Platinum", user_upgrades_path(user_id: @recipient.id, upgrade_type: "gold_to_platinum", country: params[:country]), remote: true, disable_with: "Redirecting..." %></td>
|
||||
<% else %>
|
||||
<td></td>
|
||||
<td><%= button_to "Get #{Danbooru.config.canonical_app_name} Gold", nil, disabled: true %></td>
|
||||
@@ -150,7 +150,10 @@
|
||||
<summary>What payment methods do you support?</summary>
|
||||
|
||||
<p>We support all major credit and debit cards, including international
|
||||
cards. Payments are securely handled by <a href="https://www.stripe.com">Stripe</a>.
|
||||
cards. We also support bank payments in several European countries,
|
||||
including Austria, Belgium, Germany, the Netherlands, and Poland.</p>
|
||||
|
||||
<p>Payments are securely handled by <a href="https://www.stripe.com">Stripe</a>.
|
||||
We don't support PayPal or Bitcoin at this time.</p>
|
||||
</details>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user