#it-aurimasauvika_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1283697425340698645
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Note: We have also tried the same process on incognito mode (to not have any pre-existing cookies etc. possibly affect the flow), the result seems to be the same.
Another thought we had this could possibly be related to payment method attaching through endpoint /payment_methods/[pm_id..]/attach which was done in the past, before realising Klarna does not use customer attaching to payment method
hi! not sure I understand, can you elaborate a little? I looked at your first request ID and it passes it for Italy.
Yes, but it always results in billing country mismatch error and its always thinking Ireland was passed, even though the logs clearly show another country ('it' in this case)
(Choosing Ireland does not have the issue ofcourse)
ok so you're saying it's specifically inside this Klarna dialog it says Ireland?
yes
what code do you use to accept the payment/present Klarna? if you have a PaymentIntent pi_xxx or SetupIntent seti_xxxx where this happened, share that too
its one of those requests I put in the start, give me a minute I'll find the specific ones for this example
this is for payment intent : req_6znMth3d8nJofg
The basic flow we implemented is : create a customer -> create a payment method (klarna in this case) -> create a payment_intent -> create a session and redirect to stripe checkout page
And neither customer nor payment method is being re-used per session. We made sure every time the process starts, a new user instance is created and with it, a new payment_method instance is created, so it shouldnt be bound to previous data, right ?
maybe you're logged into a Klarna account in Ireland or something? I'd try an icognito window
We thought about that, going incognito does not affect the results, its the same outcome , sadly
ultimately I have no idea, this is a dialog and page on Klarna's side that we just redirect to. I also don't speak Italian so I don't know what that screenshot is showing or what part of the flow is.
The error roughly translates to (in english) :
Country does not match
The country of the purchase with matches the country of the profile billing address. You can log back in using another account.
Country of purchase
Italy
Country of the billing address set in the account
Ireland
you could open a support ticket at https://support.stripe.com/?contact=true with the examples and maybe we can investigate and find something. It seems unlikely to be anytihng you can control in your code or API calls, they all seem very standard to me
alright, I will try that
although your flow is odd, I've never heard of manually creating a Klarna PaymentMethod manually
the usual flow is you just confirm the PaymentIntent and that does the redirect and creates the PaymentMethod automatically
you seem to not use stripe.js?
no, it's all in php backend, each step constructed using cURL requests, then once payment is ready, the client is redirected to stripe checkout page for further action
actually, that's not entirely correct, we do use stripe.js, but separately, in frontend, just to fetch the payment installment details for Klarna
yeah that's an odd flow, I'd recommend using our default integration instead where you create the PaymentIntent in the backend and call the confirm methods in stripe.js to authenticate + collect the PaymentMethod.
Not sure if this is related to this issue but maybe it is.
I will look into it, thanks.
Also not entirely related, but there was a small issue with fetching installment details for Belgium on Klarna. Every country seemed to work except for Belgium. Could you confirm that Belgium is eligible for Klarna use? It does seem to be listed both in documentation and in our dashboard under klarna's settings where you toggle countries on/off
what does 'fetching installment details' mean, what API call is that?
It's using stripe.js and creating an element that contains payment options
const stripe = Stripe(stripe_client_pubk)
const elements = stripe.elements();
const options = {.data goes here..}
const PaymentMessageElement = elements.create('paymentMethodMessaging', options);
I see; and when you say it "doesn't work", what specifically is the unusual behavior?
Ive tested what is the input that is given and the output that is received and I noticed, that country code is in fact being read correctly. I could provide examples of a working and not working requests made by the script and the very last piece of data fetched in them
one moment
Obviously, the code snippet I provided was not complete, afterwards the PaymentMessageLement is mounted underneath the Klarna's UI element in our page PaymentMessageElement.mount('.ourlocationclassIsHere');
A working JS request example on url that seems to contain correctly taken country data (FR in this case):
https://ppm.stripe.com/config?amount=1759¤cy=EUR&country=FR&locale=en&referrer=https%3A%2F%2Fwww.lll.localhost%2Fcallback%2Fcheckout&key=pk_test_51K6txTG9TgROgBQb7HYSOl6a2FHhodJJpdAbM14byWqb1WaKQa6Y4dXjvPW8jghfXk7vSx1qdGoUch150uZ0kyO200OlcXtv3T&payment_methods[0]=klarna
And the data from that url is as such :
I looked at our demo on https://docs.stripe.com/payments/payment-method-messaging and yes, seems like it doesn't render when you pick Klarna. I don't know why, the internal API response does provide data
Another case (not working), this time choosing BElgium, the url JS last acceses is:
https://ppm.stripe.com/config?amount=898¤cy=EUR&country=BE&locale=en&referrer=https%3A%2F%2Fwww.lll.localhost%2Fcallback%2Fcheckout&key=pk_test_51K6txTG9TgROgBQb7HYSOl6a2FHhodJJpdAbM14byWqb1WaKQa6Y4dXjvPW8jghfXk7vSx1qdGoUch150uZ0kyO200OlcXtv3T&payment_methods[0]=klarna
And the data returned is :
yeah I don't know, I'd suggest another support ticket
yeah, I thought this might seem like a lot, I will do that