#ZenRu
1 messages · Page 1 of 1 (latest)
Hi there, what do you mean by two payments for the same order. ?
Can you share with me an specific example so that I can take a look?
You need a specific screen from the browser or the part of code ?
Actually the process is :
- i create a payment intent from php
- i pay
- the payment is confirmed from js
- i create an invoice
- i send invoice
But i can't pay for this one because if i mark my invoice as paid with the method pay
It's actually like a payment so it adds a second payment on my order :/
And i wan't to have my invoice as paid because this is the end of the process
Thanks for the explanation. Why do you want to use both PaymentIntent and Invoice?
Because I pay for my order and I need an invoice after confirming my payment to my company.
You can just create an invoice and ask your customer to pay through the stripe-hosted invoice page. You don't even need to integrate Stripe Elements.
However I need the payment interface. I want a user to go through the checkout process and receive an invoice.
So right now I need the payment intent right?
OK. If that's the case you just need to create an invoice, and pass the invoice's paymentIntent client_secret to your Element integration and let your customer to pay from there
So if I understand correctly I create an invoice before the payment intent and then I link it to the customer who will then pay via the invoice and therefore the payment intent will also be confirmed ? So i don't really need to confirm the payment via the payment intent but via the invoice ?
Not exactly, let me explain.
Previously you created a payment_intent and an invoice. Now you should just create and invoice (Stripe will automatically created a payment_intent for this invoice), and you should just expand invoice's payment_intent (https://stripe.com/docs/api/invoices/object#invoice_object-payment_intent) and pass its client_secret to your front_end to render the PaymentElement
Hum ok i think i see
i'll try
thank you 🙂