#amf_invoice-terminal-payments
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1262438681675825184
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- amfpaulo_terminal-subscription, 4 days ago, 41 messages
Hi ๐
Just so I'm clear, are you looking to include data on the product in the charge you are creating?
As you have found, Payment Intents only deal with the funds you are attempting to collect. To make an association with actual products there are two ways you can do it.
-
You can generate one-off Invoices https://docs.stripe.com/invoicing/overview. Since you are already using Subscriptions, you are likely familiar with invoices generated by those subsciptions. You can also create Invoices for one-off purchases and link payment to products that way.
-
You can use Stripe Checkout: https://docs.stripe.com/payments/checkout/how-checkout-works. Checkout lets you specify
line_itemsand that is how you can connect products to your payments.
I have some products on my dashboard, some are single time purchase other are recurring payments... for the recurring payments, I am creating subscriptions , but I did not find ways to create a single time payment for a product that is not recurring
its in person payments so Stripe check out its not a option for me
You can create Invoice Items and Invoices for these via the API
https://docs.stripe.com/api/invoiceitems/create
https://docs.stripe.com/api/invoices/create
I create the invoice and how the client pay for it using the terminal
You would need to retrieve the Payment Intent that the Invoice creates and then process that payment intent with your terminal reader. https://docs.stripe.com/api/invoices/object#invoice_object-payment_intent
there is anywhere I can look this flow, the documentation is not clear
I am using C# on my back end and react native on my front end
No, we do not have documentation specific to this. But this is combining two documented flows.
Here is the basic Invoice flow: https://docs.stripe.com/invoicing/integration?method=elements this is where you would start.
You would do everything here except Step 6
Instead of using the web and the Payment Element, you would use the Terminal following this flow: https://docs.stripe.com/terminal/payments/collect-card-payment
The only difference is that you already created the payment intent when you created the Invoice so you just use that intent invoice.payment_intent
Ok, let me see if I get it right: this is the flow I am imagining:
Front End:
- I'll search and select the client or create new one
- I'll search and Select the product (I'll access the back end to retrieve the list of products)
- After selecting a product that is not recurring, I'll use the price to start a payment intent
BackEnd
- Having my payment intent Process Done (Back and forward between Front and Back end)
- I'll call back end again passing to it the payment intent , customer and product
- I'll create the invoice and attach the payment intent to it
After selecting a product that is not recurring, I'll use the price to start a payment intent
Start an Invoice
- Create an Invoice Item for the Customer and Product/Price
- Create an Invoice for that Customer
- Return the
invoice.payment_intentto the front-end
You cannot "attach" a payment intent to an Invoice
you have to create the Invoice first and use the Payment Intent that is created as part of the Invoice
so in this flow I will not initiate a payment intent from the front end, I'll just get the one the was create with the invoice and return it to the front ? in what moment the client will sweep the card
This is very confusing... could you help me a bit more with this
You collect Customer and Product info from the front-end, send to the back-end.
On the back end you create the Invoice. If you want to collect funds right away you can take the payment intent and process the payment on your back-end. https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=server-driven#process-payment. This will trigger the reader to ask the customer to swipe their card
I am using terminal M2 I cant use server driven
In that case you process the payment intent the same way you normally do.
You just use the payment intent from the Invoice, not one you generate by itself
Ok, I'll try put all this together, can I post a follow up question here in case I need , after trying ?
one last question, in case I need/want to use the customer default payment method to pay the invoice... what do I need to do ?
You would use the Pay API request for that ivnoice instead of attempting to collect the card details from the Terminal reader: https://docs.stripe.com/api/invoices/pay
Ok, I think I have enough information to try solve this. I appreciate your help, thank you... I'll work on this if I have more question I'll post it here again
I'm happy to shed what ๐ก I can ๐
Someone will be here for any questions you have.
thank you again