I am using the GoCardless API to get a customers bank account name and last two digits of their account number.
I have followed their guide and pulling back the deatails:
Code
'access_token' => 'XXXXX-XXXXX',
'environment' => \GoCardlessPro\Environment::LIVE
));
$BankName=$client->customerBankAccounts()->get("BA000Q7C01AP71");
printing $BankName
shows me something similar to the below:
CustomerBankAccount Class stdClass Object ( [id] => BA000Q7C01AP60 [created_at] => 2020-01-21T20:56:53.381Z [account_number_ending] => 11 [account_holder_name] => S TEST [account_type] => [bank_name] => HSBC BANK LIMITED [currency] => GBP [country_code] => GB [metadata] => stdClass Object ( ) [enabled] => 1 [links] => stdClass Object ( [customer] => CU000QFVZRF7 ) )
How do i split this string, as i only want [bank_name]
and [account_number_ending]