How do you generate a paid invoice PDF for a Stripe checkout session? - stripe-payments

My web app currently emails customers their Stripe receipt after purchase via stripe checkout. However for some customers this isn't enough – they want a paid invoice for the purchase with the information of my business and their business on it. How do you generate a PDF with this info?
I've investigated Stripe Invoices, but that seems to be a system for collecting payment. I already have payment from the checkout sessions. I just want to send the customer a souped-up receipt, really.
I've also considered using some js PDF library to generate the PDF myself, but it felt like there must be an easy way to do what I want with the Stripe API.

I've asked Stripe support the same thing.
They said creating invoices with Stripe Checkout is a common feature request but it sounds like it won't be coming for many months.
The only workaround for now is to use invoicing instead of Checkout:
https://stripe.com/docs/invoicing/integration
And for a similar UI to Checkout, use this:
https://stripe.com/docs/invoicing/hosted-invoice-page

Since ~November 2022 there is a feature just for this:
https://stripe.com/docs/payments/checkout/post-payment-invoices
It lets you generate an invoice just by setting a parameter in the request for creating Checkout Session.

Related

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.

How to create an invoice for one-time payments in Stripe checkout

So, I noticed the following behavior. When I create a checkout session with at least on recurring item (subscription), an invoice is automatically created. When the customer opens their Customer Portal, he will see the previous invoices for all subscriptions.
But, when I create a checkout session with no recurring items (one-time payment), invoice is not automatically created. Because of that, when customer opens Customer Portal, he will not see invoices for these orders.
I would like to show all customer invoices in the Customer Portal, both for recurring and one-time payments. So, is there a way generate an invoice for one-time payment and link it to the checkout session?
I contacted Stripe Support for this:
With regards to the invoices for one time charge, the checkout session
for one-time payment doesn't generate an invoice. I understand that it
is helpful for your business to create invoices for a one time charge
on the checkout session. While there’s currently no way to do that,
the workaround we can provide for your customer to see their invoices
on the customer portal, is for you to create the invoice for one time
charge rather than using the Stripe Checkout.
This is now available, but it's a little hidden in the Stripe documentation at the moment, and it's been renamed since the beta checkout invoice feature, which doesn't make it that easy to find. You just need to pass the following for non-reoccurring products...
invoice_creation => true
...when creating your Checkout Session.
Official Stripe documentation here.

Is setting tax rates to Client only Stripe Checkout (no Sessions) Subscription possible?

I'm trying to implement Stripe Checkout without server integration (client-only). It seems like I cannot set tax rates when I call redirectToCheckout.
I've searched similar questions like the following but they aren't client-only and are using Sessions:
Stripe Checkout - Create Session - Apply Tax Rates on subscriptions
Tax Rate in new Stripe Checkout
This documentation seems to mention tax rates in Stripe Checkout but is using Sessions as well.
I couldn't find any documentation saying it is not possible so I've decided to ask here.
Thanks in advance!
You cannot use Stripe Tax or tax rates with client-only Checkout. This is one of many limitations highlighted here. Stripe generally advises against using client-only Checkout for these reasons.
If you'd prefer to integrate without a server component, then I recommend using Payment Links, which support taxes, instead.

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.

Looking for some one who has implemented Moneris recurring payments for a website subcription

My client is using moneris as our payment gateway for a new subscription based website that I am working on.
I will be using the language PHP
I've looked through their documentation for PHP api and am comfortable with how it works, it seems very straight forward.
One thing was missing in the documentation for me though. There is mention of how to start a recurring payment, how to update a recurring payment, but no mention of how to query a recurring payment?
Some payment gateways allow you to have a POST back URL of sorts that get updates on recurring billing status. This does not seem to be possible with moneris.
How do I go about automatting the process of tracking recurring payments with Moneris? I'd like for my customers to log in and be able to view their transaction history on my site.
This information will also make it easier for me to know when to close accounts. Ie. when a payment fails to go through, or a credit card expires? I don't want for my cleint(owner of website) to have to keep track of the recurring payments and cancel accounts manually?
I got an answer from Moneris:
Hi David, We currently do not have a reporting API or any way of
posting the information from our recurring payments back to your
server. It is something that has been mentioned previously and is
being looked into. We do not have a current ETA on such a solution.

Resources