Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kendrick's avatar

Stripe Checkout.js (popup) MethodNotAllowedHttpException

As I am currently trying to accept payments, following the great episodes, I am facing an issue right at the beginning. As I try to implement the simple Checkout.js popup, I throws an error of

MethodNotAllowedHttpException
No message

after pushing the button.

If I comment out /app.js in my layout file, the popup works.

<div id="app"> 
            <div class="container-fluid"> 
                @yield('content') 
            </div>   
</div> 
// <script src="{{ asset('js/app.js') }}"></script> 

As I am dependent on that file, for my vue-components, what could be the solution here?

<form action="your-server-side-code" method="POST">
          {{csrf_field()}}
          <script
            src="https://checkout.stripe.com/checkout.js" class="stripe-button"
            data-key="***"
            data-amount="999"
            data-name="Demo Site"
            data-description="Widget"
            data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
            data-locale="auto"
            data-zip-code="true"
            data-currency="eur">
          </script>
</form>
0 likes
2 replies
realrandyallen's avatar

Your form action needs to be changed - it should point to a route in your app. That route will need to take the payload returned from Stripe, which will include a token, and you use that token to actually charge the given card.

kendrick's avatar

Hey @realrandyallen

Thanks, makes sense, but in the first episode, it works directly, which kind of created this thought of facing a problem. I try on now.

1 like

Please or to participate in this conversation.