#bazizten
1 messages ยท Page 1 of 1 (latest)
It should! But not retrosepctively
Hmm, cause when I create the customer I do it with preferred_locales: ['sv-SE']
Still all my invoices is retrieved with english locale
Also tried it in the "Test clock simulator". Same thing
I must be missing something ๐
Can you share an example in_xxx?
Maybe sv-SE isn't supported? https://stripe.com/docs/invoicing/customize#customer-language
Swedish is supported. Sorry I have to move away from my desk. Can I write here later?
Sure
I just did a test and sv-SE does work for me at least.
Ok. I do not create my invoices manually. They are automatically created by stripe and when I fetch the subsciption and expand the invoice I always get it in english. Let me show a code example:
thanks, that would be helpful; and also the in_xxx Invoice ID in question
const customer = await this.stripe.customers.create({
name: orgName,
email: userEmail,
preferred_locales: ['sv-SE'],
metadata: { userId, orgId },
});
This is when we create a customer
const subscription = await this.stripe.subscriptions.create({
customer: customerId,
items: [{ price: this.config.get('STRIPE_PRICE'), quantity: employeeCount }],
payment_behavior: 'default_incomplete',
payment_settings: { save_default_payment_method: 'on_subscription' },
expand: ['latest_invoice.payment_intent'],
metadata: {
orgId,
userId,
},
});
...and the subscription
const subscription = await this.stripe.subscriptions.retrieve(subscriptionId, {
expand: ['latest_invoice.payment_intent'],
});
const invoice = subscription.latest_invoice as Stripe.Invoice;
const paymentIntent = invoice.payment_intent as Stripe.PaymentIntent;
return {
subscriptionId: subscription.id,
clientSecret: paymentIntent.client_secret,
amountToPay: invoice.amount_remaining,
items: invoice.lines.data.map((d) => ({
amount: d.amount,
description: d.description,
})),
};
...the last code snippet is done just before the user fills in card details. We want to display what the user is paying for in the correct languages
unfortuantely we don't translate the line item descriptions(you can see the same in my screenshot where it says "One <billing interval> of <name of Product>")
well you know the amount and the currency and so, you could build your own string representation of the information
Yeah the problem is I get items like "Remaining somthing somethin ffrom XX April"
Sry I do not remember exactly ๐ I got it while using the test clock (Which is awesome btw)
yeah, the generated items for proration are unlocalised, sorry(it's feedback I've raised multiple times over a few years, hasn't been prioritised yet)
You can kind of build your own string I think;. I know proration:true is set on the item, and then https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-period is the date the proration applies to, from whence you can get the "XX April" information)
Alright! I'll try that! Thank so much for taking your time to help me
oh hmm
I think they are translated in the PDF, as of some recent work. The situation in the API is more complicated since it's not really being directly viewed by someone, it's meant to just be the technical description
(testing something)
๐ฟ