How does a Checkout Page take the user input information and pass it to Stripe? - node.js

So far I've created a product modal and upon proceeding to checkout, Stripe popup appears and the user can proceed with the payment.
https://streamable.com/30p4eh
Although, I have to change the checkout button to popup a checkout page first so the user can enter his delivery address and so on. How does a checkout page deliver the information the user has input, into Stripe? How does the whole process work? Do I have to add all my products into Stripe product page? Can Stripes checkout page be used like in this Firebase video? Firebase

The Checkout payments guide now includes a nice diagram that I think should help understand what you're asking about.
You create a Checkout Session with the payment information and then redirect your customer to Stripe. Stripe displays the information about the purchase and collects payment information from your customer, then redirects them back to the URL you specify. In the background, you're notified about the success of the payment and you can manage order fulfillment.
If you need more information about a particular piece of this, please feel free to ask with more details!
Update: on a second review, I see that I missed that your video is showing the Legacy Checkout integration. Stripe has a new Checkout integration that supports a wide range of payment methods and supports SCA-compliant authentication challenges. Take a look at the migration guide to update your integration.

Related

Stripe create Subscription with payment method in one go instead of two

for my subscription based product I want to have a possibility to subscribe and enter payment details at once with stripe and struggle with that with the api.
In https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements I see an option to create a subscription with payment_behavior='default incomplete' and then enter the details to confirm the payment intent. So far so good. However if I create the subscription like that even before the customer confirms payment details stripe already generates an invoice which is not really what I want before final confirmation by customer.
Options I see:
create setupintent, have this filled by customer via elements and then have the customer subscribe. Technically works nicely but for a sales and customer perspective is not good as it has two steps thus probably reduces conversion.
create the subscription in the background before final subscription confirmation by customer and use the clientsecret of it to pass back to browser and then have customer enter his payment data and submit that and finish the setup of subscription and payment info. Technically works - however I realize that when I create the subscription to get the clientsecret to pass to elements before the customer enters his payment data and confirms the subscription the subscription is not only created but an invoice too - which would be really, i.e. an invoice created before customers really confirms the contract
create setupintent and submit it via elements and in metadata of it add the info of product that customers wants so that when the paymentmethod gets created and I get webhook event I do the booking of the product given in metainfo. May however mean the customer gets to success page but the webhook has not notified yet and thus the customer is not really subscrubed at the point in time but gets a success message he is
same as 3 except do not pass info via metadata but via successUrl parameters which refers to and endpoint at my backend which upon being called after setupintent was setup will do the subscription and then redirect to my frontend which shows success page. That seems like a error prone workaround however.
Create a workflow which is a 2 step sign up and asks for paymentinfo, sets that up and then brings customer to a final confirmation page where the submit triggers subscription creation. Seems a bit complicated from a user flow, but so far probably the best option?
Any better options?
Cheers
Tom
ps: Interestingly enough on discord stripe support told me #2 is the way to go - find it hard to believe ...
As far as I know, there isn't a workaround for this unfortunately. It is just how Subscriptions API is designed by Stripe. You can learn more about that here where they talk about "how subscriptions work".

How do you generate a stripe invoice after a successfull checkout session

Quite suprisingly, it is not possible to automatically generate an invoice after as successfull checkout session with Stripe.
An invoice must always come before a payment in the stripe system.
I am left with having to recreate the invoice through a bunch of API calls fetching the PaymentIntent or the CheckoutSession that was just performed to recompute the data for the invoice and mark it as paid (not even sure I can retrieve everything I need)
This seems quite hacky... Is this the right way to do it or shall I just handle invoicing outside of stripe (quite annoying too) ?
just want clarify if you need Invoice or Receipt, because they are two different things
Invoice is something you send to customer to ask for payment (before payment)
Receipt is a proof of succeeded payment (after payment)
My understanding is that the payment is already collected upon a succeeded checkout session, so you probably want to send receipts to customers. To enable email receipts, you can go to Settings -> Emails and tick the Email customers about Successful payment box. Please note that emails won't be sent in test mode.
Let me explain a solution that you can use to generate invoices after payment in stripe. This solution is based on Zapier connectors.
There are three systems that we should connect.
Stripe
Zapier
Plumsail Documents
First, you have to set up a Stripe connection to Zapier. Go to Zapier, create a Zap, find the Stripe connection, and select "New Payment" as the trigger event. Then, connect your Stripe account with Zapier and make a test in Zap. If everything ok, go to the second step.
Second. After you have done the Zap connection for Stripe, go to Plumsail Documents, create the process, and make a template for your invoice.
Third. Set up a Plumsail Documents connection to Zapier. Go to your Zap (where you have made the connection to Stripe before), find the Plumsail Documents action, and set the Start Process as Action Event. Next, you have to select your process and match output data from Stripe payment with your invoice template in Plumsail Documents.
It seems a bit complicated, so you can read the article with a more detailed description of this solution. Also, there are screenshots for all processes.
As a result, you will get a fully automated custom invoice generation whenever you will get a payment in Stripe.
Max, product manager at Plumsail.

Stripe and validate payments synchronously

I am integrating Stripe in my site and I have the following question. I have read in the official documentation that is needed to use Payment Intents / Checkout to accomplish with 3d secure payments but my doubt is: How can I validate a payment made through this methods in a synchronous way to allow customers to instant download a product without waiting to the webhook call?
I am using Symfony to build the front and the back of the system.
thanks
You don't need to wait for a webhook to get confirmation that a payment was successful. stripe.handleCardPayment will immediately tell you if the payment was successful or not. See the then promise fulfillment here.
If you're using new Checkouts, users will be directed to your payment success page on completion of payment. A webhook is sent to inform you of the payment completion in case the user closes the browser or tab before the redirect can happen.

Stripe - One Click Upsell Possible with stripe.js?

I'm making a simple stripe checkout using Leadpages. With that said, I'm only able to use stripe.js rather than all of the massive API features that Stripe has to offer.
After entering the credit card information, the customer will be sent to an upsell page. Is it possible to do a 1-click upsell using Stripe.js?
If not, I may have to look into other options.

Online Reservation and Payment System

we created an online reservation and payment system, we are going to use paypal to pay for the reservation fee.
how do we exactly save the information of our customer and reservation info to our database, after confirming their payment.
how do we confirm that they also paid it?
thanks in advance. as of now we're using the 'pay now' button
You should save the info to the database FIRST, then they can go to the PayPal site. After that, you can use Instant Payment Notification to mark the order as complete.
https://www.paypal.com/ipn
Paypal provide different methods to make payment; you can redirect user to PayPal from your application without taking customer information (e.g. name, phone, email). PayPal API is rich with multiple set of methods like SetExpressCheckOut, GetExpressCheckOut, DoExpressChckOut.
First please make a contract with PayPal and get the Merchant information; later you can have detailed documented API to talk to them.
Thank you

Resources