Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The provided key does not have access to account in stripe

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 
);
like image 780
sulay panchal Avatar asked Oct 26 '17 05:10

sulay panchal


People also ask

How do I find my Stripe client ID and secret key?

To get Client ID, go to Your account - Account settings in your Stripe account. Open the Connect tab and you should see the value for client_id for development (for testing purposes) and production (to use in a live store).

How do I delete a connected account on Stripe?

If you have access to the standard Stripe dashboard, you can disconnect your financial accounts at any time by visiting your linked accounts settings page and unlinking any of the linked accounts by clicking “Manage” and selecting “Remove account".


1 Answers

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).

like image 155
Ywain Avatar answered Sep 20 '22 14:09

Ywain