#zhansf_webhooks

1 messages · Page 1 of 1 (latest)

brisk lichenBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1266274596403806232

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

#

🗣️ Sorry, English only

We can only provide help in English on Discord, but you can contact Stripe support for help in other languages. 🌐 Translate this message

silent seal
#

hi?

stray iron
#

hello! As mentioned, we can only help in English on this channel. Can you describe what you need help with in English?

silent seal
#

How to get the checkout/session metadata from the invoice.paid webhook

stray iron
#

https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata - If you pass the metadata into subscription_data.metadata (this is for mode="subscription") when creating the Checkout Session, the Subscription will contain that metadata, and so will the Invoice Line Items : https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-metadata

silent seal
#

Let me try

#

Wait a minute, I have another question. If mode=subscribe, there is an invoice.paid event. If it is Recharge, there is no invoice.paid event. How do I know that the payment is successful?

stray iron
#

what does Recharge mean? Do you mean mode=payment in a Checkout Session?

silent seal
#

Recharge means Top-up

stray iron
#

sure, but how are you creating a Top-up? What's the API endpoint you are using? I won't know / understand your internal terms. You need to explain to me with reference to Stripe products and APIs

silent seal
#

You can check this product-id:prod_QJc980FvliPCFh

stray iron
#

those are one-time Prices under that Product from what I'm seeing. So again, can you confirm that you're using mode=payment with Checkout Sessions with those Prices?

silent seal
#

yes

stray iron
#

https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata - If you pass in the metadata into payment_intent_data.metadata (this is for mode="payment") - the PaymentIntent will contain that metadata : https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata

silent seal
#

Which event should I use to know that the customer has made a purchase? And I want to know the lookup_key of the product price in the webhook event.

#

Yīnwèi wǒ fāxiàn mode=payment hǎoxiàng méiyǒu invoice.Paid shìjiàn
38 / 5,000
Because I found that mode=payment does not seem to have an invoice.paid event

stray iron
#

mode=payment does not have a invoice.paid event by default. You can set it such that the Checkout Session creates an Invoice for mode=payment with https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-invoice_creation-enabled so that you can also listen for the invoice.paid event for it. You can also pass in the relevant metadata in https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-invoice_creation-invoice_data-metadata

silent seal
#

ok thanks

#

Thank you for your help

#

My problem was solved perfectly