Open Closed

Testing stripe webhook : UnsupportedHttpVerb #10354


0
rvanwoezik created

When testing stripe webhooks I get the following error in Stripe: 405 (Method Not Allowed) UnsupportedHttpVerb

In stripe i have created an Endpoint to my angular client: https://fitpeopleusa.azureedge.net/Stripe/WebHooks

In my Appsettings.json i have created the required keys


6 Answer(s)
  • 0
    ismcagdas created
    Support Team

    Hi @rvanwoezik

    This endpoint is placed on Host app side, so you need to provide your API's URL with /Stripe/WebHooks postifx.

  • 0
    rvanwoezik created

    Hi @Ismcagdag,

    I have changed the endpoint to my Api's URL:

    https://fitpeopleusa-server.azurewebsites.net/Stripe/WebHooks

    Now i'm getting a HTTP status code 302

    I'm using stripe in test mode.

    My Angular Application is published to Azure Storage

    This is my log on Azure:

    ERROR 2021-06-01 09:05:07,956 [69 ] tPeople.Web.Controllers.StripeController - The signature for the webhook is not present in the Stripe-Signature header. Stripe.StripeException: The signature for the webhook is not present in the Stripe-Signature header. at Stripe.EventUtility.ValidateSignature(String json, String stripeSignatureHeader, String secret, Int64 tolerance, Int64 utcNow) at Stripe.EventUtility.ConstructEvent(String json, String stripeSignatureHeader, String secret, Int64 tolerance, Int64 utcNow, Boolean throwOnApiVersionMismatch) at Stripe.EventUtility.ConstructEvent(String json, String stripeSignatureHeader, String secret, Int64 tolerance, Boolean throwOnApiVersionMismatch) at FP.FitPeople.Web.Controllers.StripeControllerBase.WebHooks() in D:\Source\Repos\FP-FitPeopleUSA\src\FP.FitPeople.Web.Core\Controllers\StripeControllerBase.cs:line 38

  • 0
    musa.demir created
    Support Team

    Hi @rvanwoezik

    It sees like you are not using the correct webhooksecret the stripe gives you. Can you please check if your stripe information is correct in appsettings.json

  • 0
    rvanwoezik created

    Hi i have double checked the keys, have added them both to appsettings.json as appsettings.Production.json but still get same result.

  • 0
    ismcagdas created
    Support Team

    Hi @rvanwoezik

    Could you add additiona logs to StripeController's WebHook action to log all headers of the request ? Then, you can see which headers are sent by Stripe. Maybe the header name is changed.

  • 0
    rvanwoezik created

    Found it!

    According to the log: Stripe.StripeException: Received event with API version 2019-11-05, but Stripe.net 39.23.0 expects API version 2020-08-27.

    Updated Stripe API now it works!