#Opino-webhook

1 messages ยท Page 1 of 1 (latest)

waxen monolith
#

that could be many reason

#

You have a .NET server listen to webhook?

#

Did you setup the webhook secret?

raven umbra
#

yes

#

when I tried locally using stripe CLI, it's working fine

waxen monolith
#

Choose .NET

raven umbra
#

I amm using AWS for publishing

waxen monolith
#

It's mostly your env variable endpointSecret might not be loaded correctly

raven umbra
#

I am using .net mvc and I use Request.Inputstrem

#

When Itried to use Request.Body it's giving error

waxen monolith
#

Can you share your code?

#

You sure you have your endpointSecret?

raven umbra
#

yes

#

when I check withstripe CLI, it provides secret key which is same as I used

waxen monolith
#

You sure that's endpoint secret, not secret key? They are different

raven umbra
#

yes it's provided by stripe when I use webhook

#

it has no issue with endpointsecret

waxen monolith
#

ok, so where did it error? Can you share your full code?

raven umbra
#

is there anything I have to do with AWS coz I publish this code in aws

#

any permission needed?

waxen monolith
#

If your code works in local then its logic shouldn't have any problem

#

I can think of, on AWS you don't have the endpoint secret loaded properly

#

since each platform has different way to store and retrieve environment variables

raven umbra
#

what should i do now?

waxen monolith
#

the next suspicious is

var json = await new StreamReader(HttpContext.Current.Request.InputStream).ReadToEndAsync();
#

You should add more debug on endpointsecret, and json, then confirm their value from your AWS log, then compare with what is output from your local

raven umbra
#

When I use Request.Body then it's giving error

waxen monolith
#

Your local server is using Request.Body?

raven umbra
#

no

#

I have used code which is availabe for Stripe previous versions

#

because InputStream and Body are same

waxen monolith
#

You sure? I am not familiar with .NET, but did you print both of them in local, and AWS, and seeing they are identical?

#

I am asking specifically since this is the part mostly caused verification error, and 400 from our experience

raven umbra
#

yes

waxen monolith
#

When I use Request.Body then it's giving error
But when you used Body it errored, and when you used InputStream it worked?

raven umbra
#

Stripe log says TLS error

waxen monolith
#

for what case?

#

TLS error is a different error and normally it happens before the request ever reach your AWS endpoint

waxen monolith
#

๐Ÿ‘‹ I know it's still undergoing on debug, but I need to step down for the day. If you have questions feel free to ask in the channel, or ask to reopen this thread