Reputation: 91
This is my stripe code in which I receive the error
The provided key does not have access to account in stripe
\Stripe\Stripe::setApiKey('sk_test_...');
$fees=($request->amount*10)/100;
$fees=$fees*100;
$withfee = \Stripe\Charge::create(
array(
"amount" => 10000,//1000, //$amount amount in cents
"currency" => "usd",
"source" => "tok_1BGovzDnnXvdHsSaayDkULRU",//'tok_18L6hjL6useUrEYbtObKz15s',
//$token
"description" => "Example charge",//"Example charge", //$title
"application_fee" => 1000 // amount in cents //$fees
),
array("stripe_account" => "cus_Be21HSwLO1XMhF" ) // $acc_token
);
Upvotes: 5
Views: 7103
Reputation: 17505
You are passing a customer ID ("cus_..."
) in the stripe_account
field.
When processing a charge with Connect, you need to provide the ID of the account ("acct_..."
) on behalf of which you are processing the charge. Customers are payment sources (i.e. they provide funds) while accounts are payment destinations (i.e. they receive funds).
Upvotes: 13