#Retrieving Balance transactions with the php/laravel-package

1 messages · Page 1 of 1 (latest)

quaint granite
#

I'm trying to retrieve all transactions for a balance.
The docs say to use this:

$balanceTransactions = $mollie->balanceTransactions->listFor("bal_gVMhHKqSSRYJyPsuoPNFH");

But that endpoint needs a Balance resource instead of a string.

Mollie\Api\Endpoints\BalanceTransactionEndpoint::listFor(): Argument #1 ($balance) must be of type Mollie\Api\Resources\Balance, string given,

So either the docs need to be updated, or the package should accept a string? (cc @tulip terrace )

tulip terrace
#

Hi Richard, What sdk version are you using?

#

I suspect the docs are referencing v2, while the SDK v3 has been updated on a few methods like these for consistency

#

We definitely should take a look at the documentation though, thanks for the reminder

quaint granite
#

I;m still on the v2. But your link showed this:

#

And the example in the docs is:

<?php
$mollie = new \Mollie\Api\MollieApiClient();
$mollie->setAccessToken("access_Wwvu7egPcJLLJ9Kb7J632x8wJ2zMeJ");

$balanceTransactions = $mollie->balanceTransactions->listFor("bal_gVMhHKqSSRYJyPsuoPNFH");
#

So this has to be:

$balanceTransactions = $mollie->balanceTransactions->listForId("bal_gVMhHKqSSRYJyPsuoPNFH");
                                                            ^^