Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
Payment method fails - Laravel & Stripe

I'm working with Laravel and Stripe, and I want to create a customer via code. Still, I can't do it cause the payment method fails. Stripe puts the default card, and I want to create it before the payment method. I'm working with Omnipay, so I can't get the card number and other properties from my card. It's necessary to create my payment method to assign it to my customer. The card element doesn't permit me to get that information. How can I get the information from my card to register a specific payment method and create my customer after that?

$metodopago = \Stripe\PaymentMethod::create([
    'type' => 'card',
    'card' => [
        'number' => 4242424242424242,
        'exp_month' => 8,
        'exp_year' => 2022,
        'cvc' => '314',
    ],
]);

I want to get this information from my card element.

'number' => ?,
'exp_month' => ?,
'exp_year' => ?,
'cvc' => ?,

When I get my payment method only need 'ID' to payment_method.

$customer = \Stripe\Customer::create([
    'name' => '',
    'email' => '',
    'payment_method' => 'pm_card_visa',
    'invoice_settings' => [
        'default_payment_method' => 'pm_card_visa',
    ],
]);
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!