@jjmu15 We’d probably be able to help more if you told us exactly what issues you were facing?
The Stripe React library will just be a set of a pre-built components that let you create payment methods using Elements, that you then submit to your server to work with subscriptions.
Specifically i'm looking for the flow to enter card details and use those right away to sign up to a recurring subscription.
As far as I can tell Laravel Cashier only supports the setupIntent method which gets applied to the react elements library in stripe for the card field to store it as a payment method to be used at a later date but instead of that I want to have one single entry of card details during signup which are then used to create a recurring subscription.
The problem was that the React Stripe library documentation is incomplete as far as I can tell. They only provide an example for setting up a single payment intent with React rather than a subscription. The page in question can be found here (https://stripe.com/docs/stripe-js/react).
Behind the scenes of this is the standard Stripe elements library so what you need to do is set it up using the structure of the React Stripe documentation but then instead of using the stripe.createPaymentMethod() method they suggest, use the stripe.confirmCardSetup() method instead.
I want to use Stripe to manage my customer subscriptions and I need to integrate it with a Laravel backend API working with a React frontend.
I'm a bit confused with the workflow too.
Could you tell me if I'm on the wrong way plz ?
I think I have to use Laravel Cashier to deal with stripe and manage customer subscriptions, backend side.
I need to create backend API routes for front deal with back subscription controller.
What is React Stripe library for ? Is it just a set of UI components as form inputs to enter subscriptions infos
or does it directly deal with stripe account and what for ?
Yes, your logic is correct with using the API endpoints to use Laravel Cashier methods.
The React Stripe library is some of the fancy javascript they use to allow you to take payments on page without needing to leave the site. Sometimes you need levels of PCI compliance that are quite hard to obtain to take payments on-site without a lot of extra work but by using some additional security in the frontend they can secure the requests.
Anyway, you need to register the request with the frontend component and then send that data to Stripe via the Laravel Cashier methods.
@laugre I am having the same conceptual issue. How to use cashier. From what I see the developer has a choice. We can use the react library and handle it all in the front end - or - hard code the UI and capture the CC information and pass it to the controller to allow the cashier code to handle the rest. For me, I am leaning to use the react library and skip the cashier code because I'm uncertain and haven't found any reliable example that wasn't in the weeds.
Hello, I am also trying to make an application that uses subscriptions. I am trying to make it with Laravel Cashier (Stripe), Laravel Passport API (for the api part) and ReactJS (as frontend).
As @laugre also said, I'm confused too about the whole setup I need to do. So I have a question for you or anyone that has over done this.
I know it may be a lot that I am asking but I would appreciate if someone could help me.
Does anyone already have a setup with the things I wrote above or maybe an example I can look at. Personally seeing an example makes me understand it better and quicker than using the documentation.
I know it is a lot and it is really big. I am just curious.