#ionu_unexpected

1 messages ยท Page 1 of 1 (latest)

pine creekBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1328676621288210493

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

west delta
#

Can you share the code you use to initialise Stripe.js

misty chasm
#

this.stripe = await loadStripe(this.authentication.public_key);
I have the public key sent from backend

#

this.elements = this.stripe.elements(options);
this.elements.create('payment').mount('.js_stripe_payment_cc_div');

#

try {
this.stripe = await loadStripe(this.authentication.public_key);
} catch (e) {
let errorMessage = 'There seems to be an issue with your gateway configuration, please check it.';
if (e.message) {
errorMessage = e.message;
}
throw new Error(errorMessage);
}

    let options;

       options = {
            mode: 'payment',
            amount: 10000,
            currency: 'eur',
            // setup_future_usage: 'off_session',/// for single payment we do not use this
            // Fully customizable with appearance API.
            appearance: {
                theme: 'flat',
            },

            // payment_method_types: ['card'],
            // payment_method_types: ['card', 'revolut_pay'],
            capture_method: 'automatic', // Set to 'automatic' for immediate capture / this needs to come from the backend (free trial will be manual)
        };


    this.elements = this.stripe.elements(options);
    this.elements.create('payment').mount('.js_stripe_payment_cc_div');
#

this is the whole code snippet

west delta
misty chasm
#

I do createConfirmationToken in the front, than create and confirm a payment intent in the backend, based on that confirmation token

west delta
#

OK, but that doesn't answer my question. Can you share an ID from an intent you've created? pi_xx

misty chasm
#

pi_3Qf6ANEah6jYoDai0TKcp2tI this is for example one done via credit card. But my problem is before the creation of the pi. Because the pi is agnostic of the payment method type. I need to create a pi with klarna, and the only way I can get it done is by specifying payment_method_types: ['card', 'klarna'], in the options

#

this is with the same code but payment_method_types: ['card', 'klarna'], added to the options

#

I understood that if the payment option is set in the account, and I do not specify any payment_method_types, stripe will handle the payment option cards. It works for revolut pay for example (on/off in the account). But klarna does not appear unless I specify it in payment_method_types

west delta
#

Yep, you already said that. I'm looking at the intent you're creating, patience please

misty chasm
#

sure, I just wanted to be clear. Thanks

west delta
#

I don't see acct_1A8P8ZG5NORjrd4m used anywehre when creating the payment

misty chasm
#

sorry, let me do another payment right now. I think I took a wrong test pi

#

pi_3Qh80dG5NORjrd4m0XuNKQgi this is done with the klarna payment option added, but with credit card

#

req_zENCwNvYbPuFpD

west delta
#

Can you get me an intent where you don't pass payment_method_types? The ones you shared specifically pass Klarna so it's hard to debug

#

I need a pi_xxx that demonstrates the problem

misty chasm
#

sure

#

just a sec

#

pi_3Qh8N7G5NORjrd4m0Mvvj4b5
req_Qm7BphsZOvEKaI

west delta
#

OK, let me take a look

misty chasm
#

but I do not understand. The display of the payment option cards is done before the payment intent is initiated

west delta
#

Where are you located?

misty chasm
#

romania

#

in the setting locations romania is checked

#

for klarna

west delta
#

Is there somewhere I can reproduce this?

misty chasm
#

yes, but I need a few minutes to set it up

#

brb ๐Ÿ™‚

#

right now it is on my local machine

west delta
#

ngrok is fine

#

Currently don't understand why Klarna isn't there, tbh

misty chasm
west delta
#

OH, I'm so stupid

pine creekBOT
west delta
#

Klarna is a domestic payment method only, meaning you can only charge customers in your country (FR) using their native currency (EUR). However but you're in RO where EUR is not the native currency

#

(I just leanred that โ€“ forgive me)

#

So we hide it automatically โ€“ I don't see it either as I'm in UK (GBP)

misty chasm
#

oh, makes sense

#

than I will try to do it in ron (romanian currency), and with euro and vpn

#

thank you very much

#

I was out of ideas

west delta
#

Yeah my bad. It was so obvious all along I just assumed RO was EUR

#

(forgive my ignorance)

misty chasm
#

haha, I wish

#

neah, I like your version better (with euro instead of ron)

#

ok, I will try with the vpn, and thank you again

west delta
#

Sure, the VPN may help โ€“ we see mixed results

#

I think you can override the IP lookup by setting a shipping address on the customer

#

Yep, that'll work

#

A shipping address takes precedence over the IP lookup. So add a FR address to your customer and you should see Klarna