Skip to content

feat(BTI-584): update Klarna MOR to DataRequestKey flow#11

Merged
vildanbina merged 1 commit into
developfrom
BTI-584-klarna-mor
Jul 7, 2026
Merged

feat(BTI-584): update Klarna MOR to DataRequestKey flow#11
vildanbina merged 1 commit into
developfrom
BTI-584-klarna-mor

Conversation

@vildanbina

Copy link
Copy Markdown
Collaborator

What

Updates the existing Klarna MOR (klarna) builder to the new BPS spec: Klarna no longer returns a reservation number, so every follow-up references the prior Reserve through the Buckaroo DataRequestKey (a service parameter), posted to /json/DataRequest.

Changes

  • Fix cancelReservation — was posting to /json/transaction with OriginalTransactionKey; now posts to /json/DataRequest with DataRequestKey, per docs.
  • Add updateReservation and extendReservation DataRequest actions.
  • Align allowed params + required_fields per action with the BPS Klarna docs: operatingCountry mandatory on Reserve, billing/shipping optional; Pay requires an invoice.
  • Remove AddShippingInfo — the gateway rejects it for the klarna service (Unknown action 'AddShippingInfo'). Shipping details ride on the Pay request (shippingMethod/company/trackingNumber), matching the up-to-date docs. Note: BTI-584 lists AddShippingInfo, but it does not exist for this service.
  • Refund keeps the base OriginalTransactionKey path.

Verification

  • Full suite green (2272 tests), ruff clean.
  • Live end-to-end against the Buckaroo test gateway with a completed Klarna sandbox checkout:
    • Reserve → 791 + redirect
    • hosted-page approval → Reserve push captured (real DataRequestKey)
    • ExtendReservation → 190
    • Pay → 190 (€10 captured)
    • Refund → 190 (€10 credited)
    • CancelReservation routing/action accepted

Klarna no longer returns a reservation number; follow-up actions reference
the prior Reserve through the Buckaroo DataRequestKey service parameter.

- Fix cancelReservation to post to /json/DataRequest with DataRequestKey
  (was posting to /json/transaction with OriginalTransactionKey)
- Add updateReservation and extendReservation DataRequest actions
- Align allowed service parameters and required_fields per action with the
  BPS Klarna docs (operatingCountry mandatory on Reserve; Pay requires an
  invoice)
- Remove AddShippingInfo: the gateway rejects it for the klarna service
  (ActionUnknown); shipping details ride on the Pay request instead
- Refund keeps the base OriginalTransactionKey path

Verified end-to-end against the Buckaroo test gateway: Reserve -> hosted-page
approval -> ExtendReservation -> Pay (captured) -> Refund all succeed.
@vildanbina
vildanbina merged commit bf500ab into develop Jul 7, 2026
6 checks passed
@vildanbina
vildanbina deleted the BTI-584-klarna-mor branch July 7, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants