Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • NPina 32 posts 183 karma points
    Feb 02, 2023 @ 10:54
    NPina
    0

    Vendr Checkout and Stripe payment

    Hi Matt, a quick question.

    When the vendr checkout redirects to the stripe payment page, how to send the current culture that is being used, to translate the stripe page?

    Imagine, during the checkout process with vendr checkout, I am using Portuguese, but when it redirect to the stripe payment page, it comes in English.

    Is there any way to handle this?

    /NPina

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 02, 2023 @ 11:03
    Matt Brailsford
    0

    Hi NPina,

    Good question. It does look like the Stripe Checkout API supports a Locale https://stripe.com/docs/api/checkout/sessions/create#createcheckoutsession-locale but it doesn't look like we pass anything through https://github.com/vendrhub/vendr-payment-provider-stripe/blob/v2/dev/src/Vendr.PaymentProviders.Stripe/StripeCheckoutPaymentProvider.cs#L263-L281

    I think we might need to look at passing the order.LanguageIsoCode or better yet, trying to parse it into one of the supported Locales.

    I'll need to raise this on our issue tracker, but right now it's unfortunately not supported. You can of course pull the Stripe payment provider source and try implmenting it (and maybe submit a PR) otherwise we'll take a look as soon as we can.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Feb 02, 2023 @ 11:26
    Matt Brailsford
    0

    Actually, I've had a really quick look and I think I may have been able to quickly add this.

    I've pushed a build to our unstable feed at https://nuget.outfield.digital/unstable/vendr/v3/index.json so if you wanted to try using the v2.0.2-beta0002 that is on there, that should now pass the best matching locale it can find based on the orders LanguageIsoCode.

    This will initially look for an exact match for supported locales by Stripe, but if that fails, it'll split the ISO code on the '-' character and take the country part and try and find that locale. If that fails, it will fall back to the "auto" locale that is used by default (based on your browser).

  • NPina 32 posts 183 karma points
    Feb 02, 2023 @ 12:05
    NPina
    0

    Hi Matt

    Thank you for your quick response. I'm glad you implemented this quickly.

    Sure, I'll try it in a demo project to check it out.

    Thank you very much

    /NPina.

Please Sign in or register to post replies

Write your reply to:

Draft