MyOnlineStore / omnipay-klarna-checkout

Klarna Checkout gateway for Omnipay

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug when capture has no response body (correctly so)

CedNet opened this issue · comments

Hi! In Klarnas API the capture request has an empty response body.

In the file
https://github.com/MyOnlineStore/omnipay-klarna-checkout/blob/master/src/Message/AbstractRequest.php

On line 211 you are forcing a returntype of array.

The only way around handling this is catching a TypeError exception.

Maybe you should allow the API to handle a null response?

you mean : https://github.com/MyOnlineStore/omnipay-klarna-checkout/blob/master/src/Message/AbstractRequest.php#L211 (you can also link to lines in github :) )

I guess your are right, we can catch the \TypeError in the method and return an empty array.

For future reference : https://developers.klarna.com/api/#order-management-api-create-capture