#Min.K
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
- What kind of payment? When you pay an Invoice we do, but not when you just use a PaymentIntent directly.
- What do you mean by "single payment" exactly? How are you making it?
single payment is just payment.
It is a representation of payment, not subscription.
Could you please give me an example?
I'm trying to utilize the Checkout API to perform both subscriptions and payments.
In the case of subscription, invoice.paid comes as a webhook, so we want to pay the item to the customer with that.
But for payment, invoice.paid doesn't seem to come as a webhook. So, I was wondering if I should use the payment_intent.succeeded webhook event.
Okay, so you are not creating an Invoice for the one-time payments. Then you won't get an invoice.paid event. You can listen to payment_intent.succeeded or checkout.session.completed
@scenic jacinth
Question 3. For subscriptions, when I first initiate a subscription using the Checkout Session API
The checkout.session.completed event and the invoice.paid event are sent together. In this case, how do you recommend using it? Is it ok to just use invoice.paid?
Question 4. Can I use only payment_intent.succeeded like payment in case of subscription?
-
It depends on your backend logic. Whatever is more relevant to you.
-
I would recommend using
invoice.paidorcustomer.subscription.updatedfor Subscriptions.
Is there anything wrong with using payment_intent.succeeded instead of invoice.paid for subscriptions?
PaymentIntent is one level deeper than Invoice and doesn't link directly to a Subscription. So you will have hard time checking what Subscription it belongs to.