#Dynelight

1 messages ยท Page 1 of 1 (latest)

buoyant stagBOT
timber silo
midnight nimbus
#

What should I use when the payment is confirmed? Because we will use ACH payments

#

customer.subscription.updated?

timber silo
#

You'll get payment_intent.processing when it's confirmed and processing. You'll later get payment_intent.succeeded once it's been charged

#

It's not for subscriptions, but the webhook events would be the same

midnight nimbus
#

payment_intent.succeeded will work for both ACH and card?

timber silo
#

Both card payments and ach payments use payment intents

#

payment intents represent an intent to make a payment and are the way all types of payments with all types of payment methods are represented

midnight nimbus
#

Thanks Duchess ๐Ÿ™‚ Another question: Do I need to persist the payment_intent on the database so I can look for it later? or can the payment_intent somehow save the metadata I passed when I was creating the subscription?

timber silo
midnight nimbus
#

I can't seem to have access to the metadata I passed when I created the subscription, on the payment_intent.succeeded webhook

timber silo
#

Yeah metadata isn't automatically copied across objects. So if you set metadata on the subscription, it will just be on the subscription

midnight nimbus
#

Am I better off using customer.subscription.updated and check if the status went to whatever the approved payment status is?

timber silo
#

Hm. Are you using Stripe Checkout by chance?

#

Or payment element?

midnight nimbus
#

I am using stripe checkout

timber silo
#

Where on the checkout session are you setting metadata?

#

Can you share your request body?

#

(There's a couple places you can set it actually)

midnight nimbus
#

Let me double check

#

Oh wow

#

I don't think I'm actually passing it here

#

Oh wait, I am

timber silo
#

Where are you passing it then?

midnight nimbus
#

I am passing that object to the checkout

#

I guess I need to pass it to the actual payment too right?

spice obsidian
#

Hi, stepping in as codename_duchess is away. Let me catch up

midnight nimbus
#

Thanks @spice obsidian

spice obsidian
midnight nimbus
#

what I need is the webhook to pick it up though.

I justed tested (I have a joint model in which I can pay for both subscriptions and one time items).

If I only pay for one time items, the payment_intent.suceeded webhook does fire with the metadata I passed when I created the checkout session with the payment intend.

However, for the subscription, since I am creating subscription_data instead of payment_intent_data, then I don't see that metadata on the payment_intent.suceeded webhook

#

Do I need to use customer.subscription.updated for this case?

Sent when the subscription is successfully started, after the payment is confirmed.

spice obsidian
midnight nimbus
#

But the checkout.session.completed won't guarantee the payment to be approved by stripe if I am using, say, ACH

spice obsidian
midnight nimbus
#

Oooohhh

#

Don't I have an event called checkout.session.payment_succeeded also?

#

Will checkout.session.async_payment_succeeded have the metadata I need?

spice obsidian
#

Where are you looking?

#

Yes, it should is it's set on the Checkout id.