Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

updateTransaction unnecessary data #72

Open
davidrushton opened this issue Mar 24, 2020 · 2 comments
Open

updateTransaction unnecessary data #72

davidrushton opened this issue Mar 24, 2020 · 2 comments

Comments

@davidrushton
Copy link
Contributor

Hi there. Hope you're keeping safe!

I've recently launched a new website with Klarna integration using your package - thanks for the resource.

The issue i'm having is that our checkout / order process only sets the merchant_reference1 once the Klarna checkout has been created and acknowledged. The code I'm using is:

$response = $this->gateway()->updateTransaction([
    'transactionReference' => $payment->identifier,
    'merchant_reference1' => $checkout->order->ref,
])->send();

However, that is returning a Klarna error:

{
  "error_code": "BAD_VALUE",
  "error_messages": [
    "Bad value: order_amount"
  ],
  "correlation_id": "1fcf6105-ed10-42b9-9723-27808c3446b6",
  "service_version": "1.0.20200320090732"
}

I believe it is because your data is always populated with amount, tax, currency, country, etc - https://github.com/MyOnlineStore/omnipay-klarna-checkout/blob/master/src/Message/UpdateTransactionRequest.php#L24. The body sent to Klarna for the above was:

{
  "order_amount": null,
  "order_tax_amount": 0,
  "order_lines": [],
  "purchase_currency": null,
  "purchase_country": null,
  "merchant_reference1": "1001"
}

Would a new Request type be the preferred approach for allowing only some fields to be sent to update an order, or would it be possible to update the existing TransactionRequest to handle?

Thanks,
David,

@dalholm
Copy link

dalholm commented Dec 27, 2020

@davidrushton it seems that this repo is "dead" so created a new package for this with some changes. omnipay-klarna

one of the features that you ask about has a separate method updateMerchantReferences in my project.

@chrillep
Copy link

@fred-jan @frankverhoeven @Feijs is the package still alive?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants