#RichHamilton - webhook-signatures

1 messages ยท Page 1 of 1 (latest)

dawn tusk
#

๐Ÿ‘‹ do you have a stripe request ID associated with this error?

mild nexus
#

we_1Kme2XBJoTIUOmnPMlfFnSs8

#

evt_3KnliHBJoTIUOmnP10ByvB9C

dawn tusk
#

thanks! could you share the bit of your code where you're verifying signatures?

mild nexus
#

`[HttpPost]
public async Task<IHttpActionResult> Index(HttpRequestMessage httpRequest)
{

        var contentService = _services.ContentService;
        StripePaymentHelper stripePaymentHelper = new StripePaymentHelper(_services.ContentService);

        var contentString = await httpRequest.Content.ReadAsStringAsync();

        try
        {
            var stripeSignature = httpRequest.Headers.GetValues("Stripe-Signature").First();

            var stripeEvent = EventUtility.ConstructEvent(contentString,
                stripeSignature, endpointSecret);`
#

How do I know what the Stripe signature should be?

#

I changed my code to read in the raw string rather than read in json and then parse it.

spice coral
#

๐Ÿ‘‹

#

Just to eliminate some other possiblities - you're sure that the webhook endpoint secret you're using matches what's in the dashboard (or if you're testing with the CLI it should match what is outputted when you run stripe listen)

mild nexus
#

webhook endpoint secret ?

#

starts with whsec_ ?

spice coral
#

Yup, it would start with whsec (no need to paste it here)

mild nexus
#

ok, yes, I have that in the Webhook code

spice coral
#

And are you testing with the Stripe CLI? Or no?

mild nexus
#

Not currently

#

I couldn't work out how that routed through to my local

#

Ok, hang on
I think I have a different error...

mild nexus
#

DONE - SUCCESFUL

#

๐Ÿ™‚

spice coral
#

Awesome! What ended up being the issue?