#Mr.Yang

1 messages · Page 1 of 1 (latest)

pliant mossBOT
ionic finch
#

Hi there, we can help if you have a technical question, and we can only provide support in English.

hexed perch
#

那我说中文可以吗

ionic finch
#

Please use English

hexed perch
#

Subscription payment metadata callback does not return. Is this normal?

ionic finch
#

Is this about webhook?

hexed perch
#

yes

ionic finch
#

Ok, can you share with me the webhook event ID?

hexed perch
#

evt_3MPeE5EuVK8MzP3v1RjmJp6k

ionic finch
#

Please note that this metadata will be set on the subscription object, not the invoice's payment_intent object.

hexed perch
#

How am I supposed to know which subscription it is when I call back?

#

Or the callback needs to have my custom parameters, what should I do when I request?

ionic finch
#

I'd suggest you to listen to customer.subscription.updated instead, they event contains a subscription object and you can retrieve the metadata from there.

#

Alternatively, you can get the invoice from the payment_intent, and then retrieve the subscription from the invoice and get subscription's metadata there.

hexed perch
#

customer.subscription.updated
payment_intent.succeeded

I want to listen the two then from the customer.subscription.updated for subscription object?

ionic finch
#

You can also get the subscription from payment_intent.succeeded, like I explained earlier
you can get the invoice from the payment_intent, and then retrieve the subscription from the invoice and get subscription's metadata there.

hexed perch
#

Ok, I'll try. Thank you

#

Are there no event customer.subscription.updated callbacks when I create a subscription?

white oxide
#

👋 Taking over this thread, catching up now

#

Are there no event customer.subscription.updated callbacks when I create a subscription?
Could you share the subscription ID (sub_xxx) that you created?

hexed perch
#

sub_1MPfL6EuVK8MzP3vVIjZl3kk

white oxide
#

In the creation request of sub_1MPfL6EuVK8MzP3vVIjZl3kk, all the information required including default payment method have been filled, so the subscription is created and becomes active immediately: https://dashboard.stripe.com/test/logs/req_FlnVbFVASSmkJi

customer.subscription.updated will only be sent when there's any change to the subscription. In this case, there's no change to the subscription after it was created, so customer.subscription.updated wasn't sent.

customer.subscription.created was sent and informed that the subscription status is set to active: https://dashboard.stripe.com/test/events/evt_1MPfL8EuVK8MzP3vQzJRiYrD

hexed perch
#

Can I use the return field status = active to determine if the subscription is active?

#

What is the callback time for automatic payments after the subscription period?

white oxide
#

What is the callback time for automatic payments after the subscription period?
Do you mean you want to understand whether the payment is successful for each billing cycle of the subscription?

hexed perch
#

yes

white oxide