#cw
1 messages · Page 1 of 1 (latest)
Btw this is a recurring monthly payment. Forgot to say that.
If this is for subscription, https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements is the correct guide to look into.
Every subscription is linked to a person who subscribes, i.e. a customer in Stripe context. Therefore, a customer should be created first in order to create a subscription, so that Stripe knows whose subscription belongs to
Every subscription will create a Payment Intent which it can be passed to frontend Elements to collect payment method information. Appearance API is used to customize the design/UI of the Elements
Let me wrap my head around your response then ask a follow up. 2 minute pls
Thanks for your time by the way.
Is there a way to do this in one single flow?
Or do I have to collect their email / name in a form first. Then create customer. Then pay. ?
I would ideally like to do it all in one single flow. How is that achievable if they never submit anything?
I'm afraid it's not possible to do with one single Subscription API request.
How do you identify the customers if you don't collect their information?
How does prebuilt checkout do it then?
Then that would mean that this is impossible to achieve
There are two integrations approach:
- Checkout Session using Stripe hosted page (your screenshot)
- Built your self with Elements
In pre-built Checkout Session, the form will collect customer's email and create the customer first, then create the subscription behind the scene.
If you wish to do it yourself using custom integration, you'd need to collect customer information on your own and create customer first
If you do not wish to handle customer information collect, I recommend using Checkout Session, so that it can be done with one single API request
Yes I understand. For simplicity’s sake, let’s pretend my custom integration looks exactly the same.
Customer enters their email.
I can create CustomerID just by them typing their email?
Yes! Customer can be created just with email address: https://stripe.com/docs/api/customers/create
….. so I can literally create a customer LIVE as they are typing it?
Is that using a webhook or something?
No! You should only create a customer once his/her fill in his/her information completely
You can use Customer API to create a customer. I'd recommend reading up the guide as it clearly explains how a customer can be created: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
Oh….. so he/ she puts their email. Then their card. Then their zip. Then customer is created before they click pay.
And last question - what’s the problem in creating the customer ID after they pay? That’s how my dev did it.
You can also create a customer while the customer clicks pay button with the steps:
- Make first request to create a customer
- Make second request to create a subscription from the customer in step 1
Multiple requests can be made to Stripe
what’s the problem in creating the customer ID after they pay? That’s how my dev did it.
You can't create a subscription without a customer. The request will fail
Okay. Is there an advantage of using elements as opposed to plain react js?
Hm. I still don’t understand how cart abandonment work then if they never sign up or submit their email. Maybe it’s magic
Is there an advantage of using elements as opposed to plain react js?
As part of PCI compliance, only merchants with level 1 certificate is allowed to get customer's raw card data. Most of the merchants are not PCI level 1 certified, so you can't collect raw card information such as card number. You'd need to use payment service provider such as Stripe (with level 1 certified) to collect card information on your behalf for payment processing
Oh okay. I meant react js with stripe payment intent backend. But that’s good to know
Elements can be plain javascript or react. Stripe supports both
Stripe only supports payment, i.e. after customers select their items and confirm to pay. Cart management including abondomnent should be managed by yourself