#luis_subscription-webhooks

1 messages ยท Page 1 of 1 (latest)

dense shoreBOT
#

๐Ÿ‘‹ 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.

weary rock
#

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.

wind bronze
#

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

weary rock
#

i saw this

#

but i can test the webhooks?

wind bronze
#

yes you can test everything in Test mode

weary rock
#

here?

#

Sorry, I'm new to the platform and from another country

wind bronze
#

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

weary rock
#

ohh

#

fake cards

#

thank you

#

i will test

#

Please leave the channel open so I can answer any future questions, thank you koopajah!

wind bronze
#

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!

dense shoreBOT
weary rock
#

ok

#

look

#

declined using test card by country

#

im trying brazil card

tribal heron
#

๐Ÿ‘‹ 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?

weary rock
#

you card are refused

tribal heron
#

Okay can you provide the PaymentIntent ID?

weary rock
#

"your request are on live mode but you use famous test card"

weary rock
tribal heron
#

... 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

weary rock
#

okay

#

but i have to created all products

#

and do all the config on the test mode acount?

tribal heron
#

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

weary rock
#

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

tribal heron
#

Can you provide a Subscription ID that you tested with so I can see the flow you are using?

weary rock
#

sub_1PnmbeLgb2WE1BcwViTDuFT5

#

i want to receive the customer data on webhook

tribal heron
#

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

weary rock
#

Did you understand?

then I take the customer data and create it on our platform

tribal heron
#

RIght but which data specifically?

#

The Customer object?

#

Their PaymentMethod?

weary rock
#

yes

#

name

#

email

#

address

#

cpf

tribal heron
weary rock
#

i ve test the checkout.session.completed and it is the excaly thing i need

#

thanks bismarck!

tribal heron
#

Sure thing

weary rock
#

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

weary rock
#

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

tribal heron
#

Yep they use Customer Portal

#

Which is what I just linked you to

weary rock
#

this code, corretly?

tribal heron
#

Yep

weary rock
#

Is it mandatory to send the customer code?

tribal heron
weary rock
#

wow

#

cool

#

thanks!!!

tribal heron
#

Sure

weary rock
#

the webhook 'checkout.session.completed' just send when the customer payied?

#

correctly?

#

If the customer doesn't pay, it won't send?

tribal heron
#

Correct

weary rock
#

what about the key

#

where i can found on the request data

tribal heron
#

Not sure what you are referring to

#

You'll need to be more specific

weary rock
#

okay

#

every webhook have token to authetincate?

tribal heron
#

Oh you are talking about signature verification?

weary rock
#

perfect!

#

where i can found the stripe signature?

#

it is one keys?

tribal heron
#

Yes it is in the request headers

weary rock
#

here

tribal heron
#

You mean your Webhook secret?

weary rock
tribal heron
#

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

weary rock
#

no

#

i mean this

#

where i can found this 'const endpointSecret = 'whsec_...';'

#

is this?

#

oh

#

i found it

#

'segredo da assinatura'

tribal heron
#

Yeah