#RichHamilton - webhook-signatures
1 messages ยท Page 1 of 1 (latest)
thanks! could you share the bit of your code where you're verifying signatures?
`[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.
๐
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)
Yup, it would start with whsec (no need to paste it here)
ok, yes, I have that in the Webhook code
And are you testing with the Stripe CLI? Or no?
Not currently
I couldn't work out how that routed through to my local
Ok, hang on
I think I have a different error...
Awesome! What ended up being the issue?