#brotzka-de-en_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1263074070216310825
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Here is my current code:
class StripeAccounts extends StripeObject
{
protected $client;
public function __construct()
{
$this->client = new Client([
'base_uri' => 'https://api.stripe.com/v1/',
'headers' => [
'Authorization' => 'Bearer ' . config('services.stripe.secret'),
'Content-Type' => 'application/x-www-form-urlencoded'
]
]);
}
public function getAccountSession(string $stripeAccount, array $components = [])
{
try {
$response = $this->client->post('account_sessions', [
'form_params' => [
'account' => 'acct_1Jf381GZZP7fzSzR',
'components' => [
'balances' => [
'enabled' => 'true'
]
]
]
]);
} catch(\Exception $ex) {
dd($ex->getMessage());
}
dd($response->getStatusCode(), json_decode($response->getBody()->getContents()));
if ($response->getStatusCode() !== 200) {
throw new \Exception("Could not get credentials " . $response->getReasonPhrase());
}
$data = json_decode($response->getBody()->getContents());
}
}
I cannot use the Stripe SDK for PHP as I have to use an older version of the SDK regarding our old PHP version.
hi! sounds like you used the wroing API key then (sk_test_xxx instead of sk_live_xxx or vice versa).
That was my thought as well. BUt currently I am in testmode so I use sk_test_... The account exists on our test env in Stripe. That's why I am a little bit confused.. I can access the account via https://dashboard.stripe.com/test/connect/accounts/acct_1Jf381GZZP7fzSzR/activity
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So I was assuming that I can access it via the API in testmode
I'm a bit confused, did you connect to that account over OAuth?
Yes
I've generated a Connect-link via the api which then was used to connect to account to our platform account in test mode
then I'd suggest not doing that, you should be creating new accounts directly using the approach from https://docs.stripe.com/connect/custom-accounts#create for instance, the OAuth approach is more for legacy platforms, or extensions that don't process payments.