#Min.K

1 messages · Page 1 of 1 (latest)

arctic sparrowBOT
scenic jacinth
#

Hi! Let me help you with this.

#
  1. What kind of payment? When you pay an Invoice we do, but not when you just use a PaymentIntent directly.
  2. What do you mean by "single payment" exactly? How are you making it?
languid ginkgo
#

single payment is just payment.

It is a representation of payment, not subscription.

scenic jacinth
#

Could you please give me an example?

languid ginkgo
#

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.

scenic jacinth
#

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

languid ginkgo
#

@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?

scenic jacinth
#
  1. It depends on your backend logic. Whatever is more relevant to you.

  2. I would recommend using invoice.paid or customer.subscription.updated for Subscriptions.

languid ginkgo
#

Is there anything wrong with using payment_intent.succeeded instead of invoice.paid for subscriptions?

scenic jacinth
#

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.