I'm trying to take charge from customer of connected account,
I have this error Cannot use stripe token more than once
This is my code:
$customer = \Stripe\Customer::create(array(
"email" => $customer_email,
"source" => $token,
),
array("stripe_account" => $stripe_connected_account)
);
$charge = \Stripe\Charge::create(array(
"amount" => $the_fix_fee_convert,
"currency" => "eur",
"source" => $token,
"description" => "Charge for subscription"
));
I tried to use customer
instead source
:
$charge = \Stripe\Charge::create(array(
"amount" => $the_fix_fee_convert,
"currency" => "eur",
"customer" => $customer->id,
"description" => "Charge for subscription"
));
But Stripe does not find the customer->id
because its from $stripe_connected_account
I also tried this:
$charge = \Stripe\Charge::create(array(
"amount" => $the_fix_fee_convert,
"currency" => "eur",
"customer" => $customer->id,
"description" => "Charge for subscription"
),
array("stripe_account" => $stripe_connected_account)
);
It works but charge is transfert on the connected account and not on the app account.
Any idea about this?