title: I am getting a Stripe signature error: #<Stripe::SignatureVerificationError: No signatures found matching the expected signature for payload>
body: <p>I am currently working on my webhooks and I have an error in my Webhooks controller.</p>
  <p>This is the error:</p>
  <pre><code>#&lt;Stripe::SignatureVerificationError: No signatures found matching the expected signature for payload&gt;
  No template found for WebhooksController#create, rendering head :no_content
  Completed 204 No Content in 1ms (Allocations: 594)
  </code></pre>
  <p>After a log time trying to debug this problem I found out it comes from these lines as the last code I can see in my console is the error and &quot;Signature error&quot;...</p>
  <pre><code>rescue Stripe::SignatureVerificationError =&gt; e
        # Invalid signature
        puts &quot;Signature error&quot;
        p e
        return
      end
  </code></pre>
  <p>Here is the controller:</p>
  <pre><code>class WebhooksController &lt; ApplicationController
    skip_before_action :authenticate_user!
    skip_before_action :verify_authenticity_token
  
    def create
      payload = request.body.read
      sig_header = request.env['HTTP_STRIPE_SIGNATURE']
      event = nil
  
      begin
        event = Stripe::Webhook.construct_event(
          payload, sig_header, Rails.application.credentials[:stripe][:webhook]
        )
      rescue JSON::ParserError =&gt; e
        status 400
        # Invalid payload
        puts &quot;Payload error&quot;
        return
      rescue Stripe::SignatureVerificationError =&gt; e
        # Invalid signature
        puts &quot;Signature error&quot;
        p e
        return
      end
  
  
      # Handle the event
      case event.type
      when 'checkout.session.completed'
        booking = Booking.find_by(checkout_session_id: event.data.object.id)
        booking.update(paid: true)
        booking.save
  
        # @booking = Booking.where(checkout_session_id: event.data.object.id)
        # @booking.update(paid: true)
        # @booking.save
      end
  
      render json: { message: 'success' }
    end
  end
  </code></pre>
  <p>Any help would be awesome as I've been struggling with this for a while now.</p>