#JimP
1 messages · Page 1 of 1 (latest)
if you do GET /v1/account (not /v1/accounts) with a key, it gets the details of the account owning the key
Great! Sorry to be dumb: how can I do that using the PHP API? Or how do I pass the key?
I tried $stripe->accounts->all() but got an empty list
$stripe = new \Stripe\StripeClient(
'sk_xxx'
);
$acct = $stripe->account->retrieve([]);
it's that I think
there's no function account->retrieve, just accounts->retrieve()
yeah we might not expose it in the SDK since there's usually no reason to do this and it's more of a leftover API
OK so what's the parameter I pass in the GET?
Actually I don't really want to expose a secret key in a GET request, so probably best to leave this one.
hmm I mean like no, it's not exposed
it works like any other request, it's in the Authentication HTTP header and the request is using HTTPS in transit, there's no security risk making a GET request
ultimately we expect that you don't integrate this way, if you have multiple accounts that interact with each other you generally use Connect which means you only need one account's keys(the platform's) https://stripe.com/docs/connect/authentication. If you're doing something like building a plugin that uses the same code but with multiple independent accounts and just configure with their keys, that is indeed a bit of a pain unfortunately
what I said initially does work and in our Node library I can just do it
we probably just don't expose it in the PHP library because /v1/account to get your own account is kind of a crufty thing we mostly forgot exists
They don't interact. It's just that I've had a case where the test key was put in earlier than the live key, and the live key was accidentally put in from another account!
maybe
\Stripe\Stripe::setApiKey("sk_xxx");
$stripeAccount = \Stripe\Account::retrieve();
works
if not, there's probably no easy option beyond making a HTTP request directly without the library
Bingo! You are a star!!! Thank you so much. 👍