hmm, Ive got 2 sites running Klarna version 1 dll. But I think I might have got a special build of TeaCommerce.PaymentProviders.dll that Ive got from teacommerce support (back in 2014) that fixes some problems..
what do you mean I should test and whats the issue you are having?
Just to let you know, I started a PR this morning to create an updated version of the Klarna payment provider using the v3 API. It should compile but it is completely un-tested currently. You are welcome to give it a try (you'll have to clone the git repository and compile it):
I'll try an get it tested, but it'll probably take a few days fitting around other bits I have on. In the mean time, you can either test it yourself if you are up to it, or continue to see if you can get the current version working (from my research, it appeared the v2 API is still active).
Hmm, I'm not sure why those wouldn't work. I've done some testing and not hit any issues with those.
I've updated my PR on GitHub if you want to try it. I've run several orders through it and it should all work. I still need to write the docs for it though.
I will say, I've ultimately made the provider work the same as the previous provider which I think has some specific setup requirements, in that, when using this payment provider I don't think you are meant to collection billing / shipping info yourself, it appears to be built such that the checkout captures these and then the payment provider writes them back to the order so anything you do capture will get overridden.
Also, this payment provider doesn't itself support capturing / refunding so this will all need to be done via the Klarna UI. As I say though, this is as per the current payment provider.
I do think a better provider could be produced that supports all of these things, but unfortunately it's not currently high on my priority list.
Do you planning to implement the new provider in the Tea commerce package or do you need to create one for all the functions that Klarna has?
Or shall I run with this code for now?
Regarding the checkout step it feels like the shipping step is abit overkill when you use Klarna, but can you skip that collection of data in checkout for Tea commerce?
I don't think you need to collect your shipping info as I think you can tell Klarna to collect it and then like I mentioned above, it is setup to copy all the values back, so when using Klarna you should be able to pretty much go from Cart to Klarna Checkout.
Oh, the one thing you might want to do is create a TC admin order view that uses the relevant named order properties as fetched from Klarna (I don't think the default one uses the same property aliases)
The Klarna provider only sends through a single item which represents the order as a whole. This is how the original provider was developed so I just replicated the behaviour.
Implement Klarna?
Hi! Is there someone here that have implemented Klarna with Tea Commerce 3.2.5?
Shall I update the Klarna.Checkout.dll? It´s version 1.0.1.0 now.
My problem is to get the Checkout form to display with only test data not form Tea commerce order data yet.
Hi Adam,
just to let you know, we've put a tweet out to see if anyone can help with this https://twitter.com/teacommerce/status/1101441731831185408
We'll see if anyone with experience using it has any advise first before we try and dig into the code for it.
Matt
Ive got an OLD site running with TC 2.2.3 and Klarna. Its running Klarna.Checkout.dll 1.0.1.0. This is how we show the klarnaform
(sorry this code is ooold)
and this is how we show the confirmation-iframe from klarna:
this is our config in TC backend
Thanks @Tobbe.
I got the same issue with the url as you had 2014 :)
Merchant.id and sharedSecret from Klarna is created, but the domain url is http://www.myteststore.com.
Can you test if your test account still works? id: 200 secret:test?
It can be that the Tea commerce klarna provider just works with older version of Klarna Checkout, like V2.
hmm, Ive got 2 sites running Klarna version 1 dll. But I think I might have got a special build of TeaCommerce.PaymentProviders.dll that Ive got from teacommerce support (back in 2014) that fixes some problems..
what do you mean I should test and whats the issue you are having?
The issue now is that I got credentials for Checkout V3 not V2.
I did an request here: https://developers.klarna.com/kco-v2/apply-for-test-account
Or is there an property setting for switching the api call url?
oh, no you cant change the url for the api call. Here's the source code: https://github.com/TeaCommerce/Payment-Providers/blob/master/Source/TeaCommerce.PaymentProviders/Inline/Klarna.cs#L20
You might be able to copy that and try to change the api url (and name of the provider at line 17)
I run Klarna.cs now and it throws an exception on this row:
257 data["locale"] = settings["locale"];
I have set the site culture to sv-SE and locale settings to sv-se, is this something you have faced to?
nope, what does the exception say?
Just to let you know, I started a PR this morning to create an updated version of the Klarna payment provider using the v3 API. It should compile but it is completely un-tested currently. You are welcome to give it a try (you'll have to clone the git repository and compile it):
https://github.com/TeaCommerce/Payment-Providers/pull/26
I'll try an get it tested, but it'll probably take a few days fitting around other bits I have on. In the mean time, you can either test it yourself if you are up to it, or continue to see if you can get the current version working (from my research, it appeared the v2 API is still active).
Great! I will try that! I have a account request for the old V2 at Klarna but the customer is running V3 so this code will be good for testing.
First test did end up here : // If no Klarna order was found to update or the session expired - then create new Klarna order
ex = BadRequest (400)
Finally :) It was "Bad value: purchase_country (must match \"^[A-Za-z]{2,2}$\")" that was set wrong. Thanks Tobbe and Matt
Awesome. Is this using the v2 or v3 provider? If the later, did you need to change any of the code?
It's the V3 provider but the code from the clone didnt work so I copy your code directly and put it in a new Klarna.cs file.
Sorry I was in a great mode yesterday that I forget that I didnt get this row to work:
var klarnaOrderId = order.TransactionInformation.TransactionId;
and this:
LoggingService.Instance.Error
Hmm, I'm not sure why those wouldn't work. I've done some testing and not hit any issues with those.
I've updated my PR on GitHub if you want to try it. I've run several orders through it and it should all work. I still need to write the docs for it though.
I will say, I've ultimately made the provider work the same as the previous provider which I think has some specific setup requirements, in that, when using this payment provider I don't think you are meant to collection billing / shipping info yourself, it appears to be built such that the checkout captures these and then the payment provider writes them back to the order so anything you do capture will get overridden.
Also, this payment provider doesn't itself support capturing / refunding so this will all need to be done via the Klarna UI. As I say though, this is as per the current payment provider.
I do think a better provider could be produced that supports all of these things, but unfortunately it's not currently high on my priority list.
Never the less, I hope this helps.
Matt
It´s works with your latest code!
Do you planning to implement the new provider in the Tea commerce package or do you need to create one for all the functions that Klarna has?
Or shall I run with this code for now?
Regarding the checkout step it feels like the shipping step is abit overkill when you use Klarna, but can you skip that collection of data in checkout for Tea commerce?
Thanks!
Adam
Hey Adam,
You can use it for now yea, it won't hurt.
I don't think you need to collect your shipping info as I think you can tell Klarna to collect it and then like I mentioned above, it is setup to copy all the values back, so when using Klarna you should be able to pretty much go from Cart to Klarna Checkout.
Oh, the one thing you might want to do is create a TC admin order view that uses the relevant named order properties as fetched from Klarna (I don't think the default one uses the same property aliases)
Hi Matt,
Did you get all the products from cart in too Klarna in your testing?
Only got 1 line in and the total sum correct.
Hi Adam,
The Klarna provider only sends through a single item which represents the order as a whole. This is how the original provider was developed so I just replicated the behaviour.
Ok, then it´s not an bug :) Thanks!
is working on a reply...