Search code examples
javascriptlaravelvue.jsstripe-paymentslaravel-cashier

How to use confirmCardSetup Method Stripe, for multiples Elements. Laravel Cashier / Vue App


How to send inputs separately from stripe, through the confirmCardSetup method, since the documentation only receives one cardElement element.

https://stripe.com/docs/js/setup_intents/confirm_card_setup -> documentation.

I was researching around here, and other sites on the Internet, and found these components separately, but currently, I'm working with a setup token attempt that comes from the backend, as I can send all these elements separately to the endpoint that provides me with the documentation.

https://prnt.sc/toyr9n -> My currents Elements

https://prnt.sc/toyrmt -> My Stripe endpoint implementation.

Note: How can I make a custom form for stripe, without having to use the cardElement, or manipulate the inputs separately.

I would be very grateful for your responses, and suggestions.


Solution

  • When using split elements, Stripe.js will automatically infer all the elements needed by just passing in one element.

    In your case, you can just pass in the cardNumber element when confirming your SetupIntent and Stripe.js will find all the other elements and evaluate those automatically.