Search code examples
stripe-paymentslaravel-cashierlaravel-6.2

how to pass name and address in laravel cashier to stripe?


Iam using stripe through laravel cashier.when using charge method

$stripeCharge = $user->charge(100, $paymentMethod,[
          'customer' => 'test',
          'description' => 'test description',
          'amount' => 2000,
          "name"=>"kjdkjdksdsd"
]);

I got this error 'Received unknown parameter: name'. When trying to do transaction without name getting the error 'Export transactions require a customer name and address'. I tried with shipping address too.

"shipping"=> [
            'address'=>[
      "line1"=> "hjkjhjhhjj",
      "line2"=> null,
      "postal_code"=>"44424",
      "state"=> null
            ],
            "name"=> "erferwer"
          ],

but still got the same error. Anyone can help me with correct format for passing name and address in laravel cashier


Solution

  • This looks like you're trying to create Export charges from India. To do so, there are some requirements you must meet. Note that one of the requirements is a Customer billing address, so you will need to create a customer. Shipping address can go there as well, or directly on the charge.