Answers for "Customer cus_ does not have a linked source with ID tok_ stripe"

0

Customer cus_ does not have a linked source with ID tok_ stripe

Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));

$customer = \Stripe\Customer::create([
    'name' => 'Jenny Rosen',
    'email' => '[email protected]',
    'address' => [
        'line1' => '510 Townsend St',
        'postal_code' => '98140',
        'city' => 'San Francisco',
        'state' => 'CA',
        'country' => 'US',
    ],
]);

\Stripe\Customer::createSource(
    $customer->id,
    ['source' => $request->stripeToken]
);

Stripe\Charge::create ([
    "customer" => $customer->id,
    "amount" => 100 * 100,
    "currency" => "usd",
    "description" => "Test payment from stripe.test." , 
]);
Posted by: Guest on September-29-2021

Code answers related to "Customer cus_ does not have a linked source with ID tok_ stripe"

Browse Popular Code Answers by Language