Klarna provides the merchant_reference1 field, which should be used to set the order number - otherwise the merchant won't easily be able to match the Klarna invoice with the Commerce order. I see that the problem is here that we create the Klarna invoice before we have the order number (as it isn't placed at that time).
However we could easily act on the order place transition and send an update request to Klarna... Patch to follow
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3013336-6.patch | 2.2 KB | agoradesign |
Comments
Comment #2
agoradesign commentedThis should do the trick - however the Klarna Playground went into maintenance a few seconds before I could verify that the order number was set correctly... I'll comment on this later
Comment #3
agoradesign commentednext try
Comment #4
agoradesign commentedNow it works as expected
Comment #5
tuutti commentedI think we should check if merchant_reference1 field has value before updating it so we don't accidentally override it.
Comment #6
agoradesign commentedAdded the check... need to another test now, b/c I currently have 3 patches applied, it's easier to post the patch first, then test ;)
Comment #7
agoradesign commentedstill works for me
Comment #9
tuutti commentedYep, seems to work. Nice work!
Comment #10
agoradesign commentedthanks for all the quick responses and commits :)