CurrencyCloud / currencycloud-php

MIT License
15 stars 38 forks source link

Can't get the sub-account's Beneficiaries #154

Open raycao871218 opened 1 year ago

raycao871218 commented 1 year ago

I tried 3 ways to get the sub-accounts' Beneficiaries but it keep response the house-account's beneficiaries.

1st way:

$currencyCloud->getSession()->setOnBehalfOf($contactId);
$beneficiaries = $currencyCloud->beneficiaries()->find();

2ed way: $beneficiaries = $currencyCloud->beneficiaries()->find(null, null, $contactId); 3rd way:

$beneficiaries = $currencyCloud->onBehalfOf($contactId, function($currencyCloud){
                $data = $currencyCloud->beneficiaries()->find();
                dd($data);
            });

I hard code the contact id into the sdk source code(BeneficiariesEntryPoint->convertBeneficiaryToRequest), it works fine.

CNimmo16 commented 5 months ago

I have raised a PR to resolve this https://github.com/CurrencyCloud/currencycloud-php/pull/161