#luis_subscription-webhooks
1 messages ยท Page 1 of 1 (latest)
๐ 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/1273350771190005861
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I need the event where the customer pays for the subscription and their data is sent so I can create the data on the platform.
Hey @weary rock We do have canonical docs for this. I recommend carefully reading https://docs.stripe.com/billing/subscriptions/webhooks
Also you can test all of this end to end in Test mode easily as a developer. This will make it much easier for you to understand how our products and APIs work
luis_subscription-webhooks
yes you can test everything in Test mode
That's just the switcher to change the view in the Dashboard for Live and Test mode. So really that's only a really small part of testing things.
As a developer, you can write end to end code to test all our products and APIs, use test card numbers for simulating payments, see https://stripe.com/docs/testing#cards, etc.
Yes you can use the Dashboard if you want in Test mode, but that will only give you a surface understanding of the product
ohh
fake cards
thank you
i will test
Please leave the channel open so I can answer any future questions, thank you koopajah!
We only keep threads open for a short time. So if it's closed by the time you have more questions you are welcome to just start a new question again!
๐ stepping in here
What does the error say exactly?
I can't read that
And do you have a PaymentIntent ID you can share from your test?
you card are refused
Okay can you provide the PaymentIntent ID?
"your request are on live mode but you use famous test card"
where i can find this
... yeah you can't use a test card in live mode
You need to use your test keys (test mode) with a test card
So change your integration to using your test keys and try again
okay
but i have to created all products
and do all the config on the test mode acount?
Yep you should be doing everything in test mode first
You can then copy Products from test --> live mode
But not the other way around
okay
i do this
i ve tested the webhook
buy on "customer.subscription.created" i dont received the coustmer data
where i find the customer who bought
Can you provide a Subscription ID that you tested with so I can see the flow you are using?
What do you mean exactly by "customer data"
Okay you are using Stripe Checkout
So really you want to be listening for checkout.session.completed
Did you understand?
then I take the customer data and create it on our platform
Okay then yeah you want to listen for checkout.session.completed and then retreive the Checkout Session and expand the customer property: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-customer
See: https://docs.stripe.com/expand for how to expand responses
i ve test the checkout.session.completed and it is the excaly thing i need
thanks bismarck!
Sure thing
another question
the customer can change or cancel their plan on our platform
How can I generate that unique link, where the person manages their subscription
The same happens on openai (chatgpt), I click on 'manage subscription' and I am redirected to a stripe page where I can change the plan or cancel
Yep
Is it mandatory to send the customer code?
Yes you have to specify the Customer, or you can provide a general link (https://docs.stripe.com/customer-management/activate-no-code-customer-portal) where then your user can log in to the portal themselves with their email address + OTP
Sure
the webhook 'checkout.session.completed' just send when the customer payied?
correctly?
If the customer doesn't pay, it won't send?
Correct
bismarck
what about the key
where i can found on the request data
Yes it is in the request headers
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
here
You mean your Webhook secret?
yes
If so, then yes it is at the top of your Webhook endpoint in your Dashboard
Click on the endpoint
Then there is a button to reveal it at the top
no
i mean this
where i can found this 'const endpointSecret = 'whsec_...';'
is this?
oh
i found it
'segredo da assinatura'
Yeah