#Unai-Klarna

1 messages · Page 1 of 1 (latest)

jade hollow
#

Hi, can you provide the guide you are following? Where are you calling that Klarna.Payments.authorize()?

dense token
#

I am on Spain so the only available option is pay_later

jade hollow
#

Was the Source creation succeed?

#

Also can you see on your Dashboard log the request that failed?

dense token
#

How can I check if the stripe.createSource is succeed?

#

No error is thrown so I guess it is correctly created

jade hollow
#

If it didn't return error then yeah it was succeed.

#

Could you check your Dashboard for request logs?

dense token
#

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

jade hollow
#

hmm

dense token
dense token
#

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

jade hollow
#

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?

dense token
#

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

signal basin
#

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

dense token
#

Could it be an issue of Klarna/Stripe configuration managed on the Stripe panel?

signal basin
#

not sure!

dense token
#

I am using another email "unai@..."

#

The log I sent you seems to be fine, right?

signal basin
#

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

dense token
#

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?

signal basin
#

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?

dense token
#

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

signal basin
#

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

dense token
#

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?

signal basin
#

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

dense token
#

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