Skip to content

The FIND enpoints are not considering the on_behalf_of flag #135

@ghostika

Description

@ghostika

I was about to implement the currency cloud API and after some debugging I realised, if I call the
$this->client->beneficiaries()->find($beneficiary, null, $payout->getOnBehalfOf()); function, the find method doesn't consider the on_behalf_of value (3rd argument). It always searches in the main account, not in the sub account.

After I changed the following line, it worked, but I'm not sure if it would create some error in other places:

AbstractEntityEntryPoint::doFind function

from this

        $response = $this->request(
            'GET',
            $entryPoint,
            call_user_func($converterToRequest, $searchModel, $onBehalfOf) + $this->convertPaginationToRequest(
                $pagination
            )
        );

to this

        $response = $this->request(
            'GET',
            $entryPoint,
            call_user_func($converterToRequest, $searchModel, $onBehalfOf) + $this->convertPaginationToRequest(
                $pagination
            ) + [
                'on_behalf_of' => $onBehalfOf
            ]
        );

Creating a beneficiary on behalf of functions.

Could you please check this issue, for the time being, I will add a custom request to our code.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions