Skip to content

MonetaryAccount listing succeeds on sandbox but fails on production #145

@mbernson

Description

@mbernson

Steps to reproduce:

  1. Have a joint account. In my case it's a closed one.
  2. Install tinker and run ./go-pro to get a production config file
  3. Run the attached piece of code within the tinker folder

What should happen:

  1. It lists the monetary accounts without a problem

What happens:

  1. 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();

SDK version and environment

  • Tested on 0.13.1
  • Production (problem occurs)
  • Sandbox (problem can't occur because I have no joint accounts there and didn't bother to set them up)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions