My PHP application is using Stripe. People sell their products on my platform and I'm getting my fee from it. I already have a link that makes it possible for users to connect their Stripe accounts to my platform. I get authentication code and then I use it to get access token. The response is as follows (replaced long random strings with abcd):
{
"token_type": "bearer",
"stripe_publishable_key": "pk_test_abcd",
"scope": "read_write",
"livemode": false,
"stripe_user_id": "acct_abcd",
"refresh_token": "rt_abcd",
"access_token": "sk_test_abcd"
}
Then, I'm trying to create a test charge for a connected account:
$charge = Stripe\Charge::create([
'amount' => 1000,
'currency' => 'usd',
'source' => 'sk_test_abcd',
], ['stripe_account' => 'acct_abcd']);
But I'm getting the following error:
No such token: sk_test_abcd
What am I doing wrong?