Add locale to stripe elements options to display messages in right language

List of supported language by stripe elements:
https://stripe.com/docs/js/appendix/supported_locales
This commit is contained in:
Jean-Baptiste Bellet
2022-01-17 15:10:51 +01:00
parent c5c5738382
commit c22f3ec1db
2 changed files with 2 additions and 2 deletions

View File

@@ -9,7 +9,7 @@ angular.module('Darkswarm').directive "stripeElements", ($injector, StripeElemen
if $injector.has('stripeObject')
stripe = $injector.get('stripeObject')
card = stripe.elements().create 'card',
card = stripe.elements({ locale: I18n.base_locale }).create 'card',
hidePostalCode: true
style:
base:

View File

@@ -18,7 +18,7 @@ export default class extends Controller {
// Initialize Stripe JS
this.stripe = Stripe(this.data.get("key"));
this.stripeElement = this.stripe.elements().create("card", {
this.stripeElement = this.stripe.elements({ locale: I18n.base_locale }).create("card", {
style: this.constructor.styles,
hidePostalCode: true
});