$STRIPE_DEST is the account, $linkaccount->id is the ID. I guess I don't understand why I need to pass the 'id' identifier in the object call.
THE API response call to $stripe->accounts->retrieveExternalAccount is something like below. All I really want to do is call the objects account, and then run a conditional on whether or not the objects response name is 'card', or 'bank_account'. If a card, display last 4.
example api call
$stripe = new \Stripe\StripeClient(
'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
);
$stripe->accounts->retrieveExternalAccount(
'acct_1032D82eZvKYlo2C',
'card_1Kwvu72eZvKYlo2CGz2YgiVz',
[]
);
Response:
{
"id": "card_1Kwvu72eZvKYlo2CGz2YgiVz",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 8,
"exp_year": 2023,
"fingerprint": "Xt5EWLLDS7FJjR1c",
"funding": "credit",
"last4": "4242",
"metadata": {},
"name": null,
"tokenization_method": null,
"account": "acct_1032D82eZvKYlo2C"
}_