#cory-tax-chargelink
1 messages · Page 1 of 1 (latest)
Yes, in fact that could even be required on nromal invoices without any extra
We offer a way to handle that automatically for your invoice payments:
I am tryihng to handle this all on the backend for PHP. I used to create a payment intent and then send intent back to backend to handle a normal charge. But I need to handle taxes now so I am switching to invoice but want to keep the same flow
So my question is I guess, with a Payment intent and 3DS confirmed, can I create an invoice and charge it?
For payments that require 3D Secure, you can configure your billing settings to send a hosted link to customers so they can complete the flow.
https://stripe.com/docs/billing/subscriptions/overview#recurring-charges
If 3ds were required, there'd already be an invoice (with a payment intent)
That would require chaning my flow though
So you could retrieve that and use the payment intent client_secret in your front end to have the customer authenticate using Stripe.js, say
But I need to handle taxes now so I am switching to invoice
We have a standalone tax API you can use with payment intents (without invoices) now, if you prefer
But up to you
with a Payment intent and 3DS confirmed, can I create an invoice and charge it?
Can you share an example of what you mean?
I don't think I understand the flow/scenario?
In app
User clicks "buy item" -> goes to backend, creates payment intent, and if it requires action, it sends client secret to front end for 3DS -> after 3DS succeeds, sends intent back to backend, and confirms() the paymentIntent -> then enable flag in DB since we already in backend
My goal is basically to add tax collection to this scenerio
Ok, that sounds like the manual confirmation flwo for handling 3ds with server side request, sure
To do this you'd need to collect a valid tax location from the customer, but with that you can calculate your own tax:
Ok that is fine. How can I then add the tax to the charge?
I saw a page about tax calculation but it seemed pretty complex
Take a look at this guide, it show how you can achieve this and include the tax amount in your payment intent
I see that they throw it in the metadata
But how does it end up in the actual charge?
From the guide it seems like tax is collected after they charge is made?
Unless I am reading it wrong
@wicked lotus there's no link between tax calculation and a Charge in our API today. You mostly track this yourself
cory-tax-chargelink
Ah I see
so let me get this straight - you calc tax, add that to total charge amount for Intent, record it in meta data, and then confirm Intent?
We (Stripe) don't care about the link in metadata in any way sothat's really up to you how/when/whether you do that. But otherwise yes
ok I see
Would there be any way to keep this type of flow but introduce an invoice so it's automatically collected and recorded?
If that makes sense
basically swap "charge" for "invoice"
and everything else the same
Not really? Sorry this isn't clear what you want to achieve. If you use Invoicing you can let us do all the tax calculation for you https://stripe.com/docs/tax/invoicing
I basically want to keep my logic on the backend and not have to send an invoice. My ideal scenario would be …
User clicks charge -> backend creates invoice, if need 3DS sends secret to front end -> then goes back to backend to confirm and autopay invoice
Does that make sense? Sorry if it’s confusing
I just don’t want to have to email them anything or use webhooks
Yeah sorry it's tough because you use words like "invoice" that have extremely specific meanings for accounting for example and it's also a core API for us for our Invoicing product and I don't really get what you are after as it's too vague.
If you want a compliant Invoice, with a real email receipt and such, use Invoicing.
If you don't, use our Tax API to make the calculations yourself and then separately create/confirm a PaymentIntent