Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TokenQrRequestIdeal returns the wrong type #80

Closed
mbernson opened this issue Dec 10, 2017 · 0 comments · Fixed by #107, #110 or #111
Closed

TokenQrRequestIdeal returns the wrong type #80

mbernson opened this issue Dec 10, 2017 · 0 comments · Fixed by #107, #110 or #111

Comments

@mbernson
Copy link
Contributor

mbernson commented Dec 10, 2017

Steps to reproduce:

  1. Try to create a TokenQrRequestIdeal using the SDK.

What should happen:

  1. The item is created and a TokenQrRequestIdeal object is returned.

What happens:

  1. The API returns a RequestResponse object, but the SDK tries to cast it to a TokenQrRequestIdeal, resulting in an error.

Logs

Together topic: https://together.bunq.com/topic/does-tokenqrrequestidealcreate-code-wrong

Report from user @china1688:

Dear Bunqer,
i am testing TokenQrRequestIdeal class, when i call TokenQrRequestIdeal::create, there is always error as below:

PHP Notice: Undefined index: TokenQrRequestIdeal in D:\xampp\htdocs\bunq_test\vendor\bunq\sdk_php\src\Model\Core\BunqModel.php on line 127
Notice: Undefined index: TokenQrRequestIdeal in D:\xampp\htdocs\bunq_test\vendor\bunq\sdk_php\src\Model\Core\BunqModel.php on line 127

i check the function of TokenQrRequestIdeal::create, the coding is different from Payment::create, RequestInquiry::create, IdealMerchantTransaction::create,
then i guess the code of TokenQrRequestIdeal::create as below mark in bold is wrong coding?

/******************TokenQrRequestIdeal::create ************************************
public static function create(ApiContext $apiContext, array $requestMap, int $userId, array $customHeaders = []): BunqResponseTokenQrRequestIdeal
{ ....
return BunqResponseTokenQrRequestIdeal::castFromBunqResponse(
static::fromJson($responseRaw, self::OBJECT_TYPE)
);}
/******************Payment::create ************************************
public static function create(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, array $customHeaders = []): BunqResponseInt
{...
return BunqResponseInt::castFromBunqResponse(
static::processForId($responseRaw)
);}
/******************IdealMerchantTransactionList::create ************************************
public static function create(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, array $customHeaders = []): BunqResponseInt
{
return BunqResponseInt::castFromBunqResponse(
static::processForId($responseRaw)
);}
/******************RequestInquiry::create ************************************
public static function create(ApiContext $apiContext, array $requestMap, int $userId, int $monetaryAccountId, array $customHeaders = []): BunqResponseInt
{...
return BunqResponseInt::castFromBunqResponse(
static::processForId($responseRaw)
);}

Could anyone help check the code?

Extra info:

@mbernson mbernson added the bug label Dec 10, 2017
@OGKevin OGKevin added this to the 0.12.5 milestone Dec 11, 2017
OGKevin added a commit that referenced this issue Jan 16, 2018
OGKevin added a commit that referenced this issue Jan 17, 2018
andrederoos added a commit that referenced this issue Jan 17, 2018
…_returns_the_wrong_type

Token qr request ideal returns the wrong type. (#80)
OGKevin added a commit that referenced this issue Feb 1, 2018
@OGKevin OGKevin reopened this Feb 1, 2018
andrederoos added a commit that referenced this issue Feb 15, 2018
OGKevin added a commit that referenced this issue Mar 1, 2018
OGKevin added a commit that referenced this issue Mar 1, 2018
OGKevin added a commit that referenced this issue Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment