#Unai-Klarna
1 messages · Page 1 of 1 (latest)
Hi, can you provide the guide you are following? Where are you calling that Klarna.Payments.authorize()?
Hi, the guide I am following is this one: https://stripe.com/docs/sources/klarna, the code is already included on the Stripe Cartridge for Salesforce
I am on Spain so the only available option is pay_later
Was the Source creation succeed?
Also can you see on your Dashboard log the request that failed?
How can I check if the stripe.createSource is succeed?
No error is thrown so I guess it is correctly created
Did you use this method by stripe.js? https://stripe.com/docs/js/tokens_sources/create_source
Complete reference documentation for the Stripe JavaScript SDK.
If it didn't return error then yeah it was succeed.
Could you check your Dashboard for request logs?
That is the last log
I can see this error on the console after calling the authorize, but I don't know why it says that, seems that everything is correctly loaded
hmm
The createSource used in the cartridge does not receive 2 parameters
Seems to be problem of the Klarna API, but I don't know if this is the cause of the failure, does not seem to be the cause
Hmm at least we are seeing errors on console. Can you resolve that error first and see how it goes?
That's on api.js and might be another scripts?
I don't know where does the error come from, but since I am receiving the response from the server and the error comes after that, I think it should not be the original problem
I don't think the problem is on another script, the "AplicationNotLoadedError" comes from the klarna API
for what it's worth "always receiving { approved: false, show_form: false }" just means Klarna is not offering the customer any payment options for whatever reason
it's not really a development/coding question
Could it be an issue of Klarna/Stripe configuration managed on the Stripe panel?
not sure!
what email address do you use? For example this is expected if you use test+red@example.com as it simulates this behaviour https://stripe.com/docs/sources/klarna#testing-klarna-payments
yes I'm looking at it
ultimately I don't know unfortunately! It just means Klarna is opting not to give the customer that payment option, for some reason
you could contact our support team at https://support.stripe.com/email but overall I'd suggest using the new integration of Klarna(https://stripe.com/docs/payments/klarna/accept-a-payment) using PaymentIntents since it's better supported. Not sure if you can with that Salesforce set up you have
Yes, that integration seems to be better but as the code on the cartridge is the one that uses source codes I have to use that
I will talk to Stripe support via email, Thank you both for your help!
The console error shouldn't be related to the authorize response, right?
The Klarna API I am using is this one, https://x.klarnacdn.net/kp/lib/v1/api.js, it seems to be the correct one
as far as I know that is correct yep. I don't get such errors in my own code for using Klarna at least
what is this stripe.checkout.js, did you write that?
That file is a client side script that comes with the app_stripe_sfra cartridge, It comes with the Klarna.Payments.init, load and authorize functions already implemented
we can only really support you if you develop your own code, we don't really know what this catridge does or if it might have bugs
if it helps you could try putting your publishable key into this : https://jsfiddle.net/kLegqod1/ and see if it works the same
It works fine there! I guess the key and the klarna/stripe config is okay, maybe it is just a problem with the source object?
well you can change how the Source object is created(the parameters are all in the code there)
maybe try changing to exactly what you used and see if there's some specific change/value that makes it not work
I have managed to make it work by changing the flow of our checkout, the authorize has worked fine, the problem is that out checkout has another step after the submit payment step, when you click place order in the next step the authorize is triggered but there is where it fails, we are using the window variable to store Klarna, so we do window.Klarna.Payments... maybe the step change is the problem and that may be the reason why Klarna thinks the payment is not loaded
I see that the test page https://jsfiddle.net/kLegqod1/ has the attribute instance_id on the payments load and in the authorize, why that variable does not appear on Klarna docs? "payment_method_category" is suposed to be used on the authorize, not the instance_id