Have a joint account. In my case it's a closed one.
Install tinker and run ./go-pro to get a production config file
Run the attached piece of code within the tinker folder
What should happen:
It lists the monetary accounts without a problem
What happens:
Decoding the response fails, apparently on one of the LabelUser objects within the CoOwner object of the joint account
Traceback
Fatal error: Uncaught TypeError: Argument 1 passed to bunq\Model\Core\BunqModel::createFromResponseArray() must be of the type array, string given, called in /Users/mathijsb/tinkerbug/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php on line 236 and defined in /Users/mathijsb/tinkerbug/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php:97
Stack trace:
#0 /Users/mathijsb/tinkerbug/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php(236): bunq\Model\Core\BunqModel::createFromResponseArray('[uuid here]...', NULL)
#1 /Users/mathijsb/tinkerbug/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php(201): bunq\Model\Core\BunqModel::createListFromResponseArray(Array)
#2 /Users/mathijsb/tinkerbug/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php(159): bunq\Model\Core\BunqModel::determineFieldContents(Object(ReflectionProperty), Array)
#3 /Users/mathijsb/tinkerbug/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php(113): bunq\Model\Core\BunqModel::createInstanceFromResponseArray(Array)
#4 /Users/mathijsb/tinkerbug/vendor/bunq/sdk_php/src/Model in /Users/mathijsb/tinkerbug/vendor/bunq/sdk_php/src/Model/Core/BunqModel.php on line 97
Sample code
<?php
use bunq\Context\ApiContext;
use bunq\Context\BunqContext;
use bunq\Model\Generated\Endpoint\MonetaryAccount;
require 'vendor/autoload.php';
// Config file produced via Tinker/go-pro. The code works fine when using 'bunq-sandbox.conf'.
$configPath = 'bunq-production.conf';
$apiContext = ApiContext::restore($configPath);
$apiContext->ensureSessionActive();
BunqContext::loadApiContext($apiContext);
$allAccount = MonetaryAccount::listing();
Steps to reproduce:
./go-pro
to get a production config fileWhat should happen:
What happens:
LabelUser
objects within theCoOwner
object of the joint accountTraceback
Sample code
SDK version and environment