#brew-webhook-dotnet2

1 messages ยท Page 1 of 1 (latest)

uneven bayBOT
fresh skiff
#

brew-webhook-dotnet2

#

@merry needle I know nothing about your environment unfortunately but all we want is the value of the HTTP header really, there's nothing more to it

uneven bayBOT
merry needle
#

I tried passing the value (equest.Headers.GetValues("Stripe-Signature").FirstOrDefault()) but I get the ""The signature header format is unexpected." format. I wants the string in some specific format so it can parse it out.

fresh skiff
#

What exact raw string do you get when you call that?

merry needle
#

"t=1692724489,v1=791b76d411a0ea7669f59532b1cc14ec2070ae714da965546e52e037d270befa,v0=ab1b8c0ba4c9bd3d38b40e3384234775005d83c230a84232ca90d2a358d95dcc"

fresh skiff
#

that string seems correct to me

merry needle
#

Huh ... just tried it again and got a different message :

Received event with API version 2020-08-27, but Stripe.net 42.1.0 expects API version 2023-08-16. We recommend that you create a WebhookEndpoint with this API version. Otherwise, you can disable this exception by passing throwOnApiVersionMismatch: false to Stripe.EventUtility.ParseEvent or Stripe.EventUtility.ConstructEvent, but be wary that objects may be incorrectly deserialized.

#

I usually get
The expected signature was not found in the Stripe-Signature header. Make sure you're using the correct webhook secret (whsec_) and confirm the incoming request came from Stripe.

fresh skiff
#

yeah I'm worried you're mixing a lot of things up at this point

#

earlier you thought v1= was 1=

merry needle
#

Ya - I completely missed v1 was in there.... That wasn't the issue after all

fresh skiff
#

If you use a specfic version of stripe-dotnet, it's pinned to a specific API version and all Events need to be formatted for that exact API version

#

I know but then you thought it was the secret, then something else, and now it's just that you have the wrong API version for the version of stripe-dotnet you use.

#

you definitely should not pass throwOnApiVersionMismatch: false in your case

#

Are you just testing or do you have real transactions in production already?

merry needle
#

42.1.0 is the latest on nuget....

fresh skiff
#

I mean sure and that version is perfect

#

But that doesn't mean you can just download it and use it without understanding the concepts

merry needle
#

Gotcha. I am just in testing ... using the CLI redirect to local host

fresh skiff
#

Okay so if you are just testing: you need to make sure your Stripe account is on the same API version as the stripe-dotnet library expects

#

and your account is likely older and has the previous API version

#

(at the bottom)

merry needle
#

I admit - stripe webhooks is new to me.,,, but I'll go check the API version in the dashboard now!

fresh skiff
#

so if you upgrade that API version then you won't get the mismatch error anymore

merry needle
#

WINNER WINNER CHICKEN DINNER!

#

That was it!

#

It authenticated fine. I still don't know why this was the first time I got that API mixmatch message ... but I don't care. It's all a go now. THANKS! I've lost a few hours on this. You're a god send.

fresh skiff
#

I assume earlier you were having issues with the signatures so never reached that step ๐Ÿ™‚

merry needle
#

Ya - its one of those things - I tried passing all sorts of things into that - but .. well.. I have no excuse... I would have sworn that I passed just the plain old value without any editing but guess not... all evidence to the contrary (or I did and just didn't not that specific message one of those times)

#

Jesus - Stripe Support really is outstanding. Gold star man.

fresh skiff
#

to be clear: most devs go through what you did, this is so freaking hard to build ๐Ÿ˜ฆ

#

I hope one day we revamp signature to be built differently. It's just hard to design a simple flow