Skip to content
Advertisement

Embedding Checkout on Laravel Blade

I’m trying to display an embedded checkout form from Stripe (https://stripe.com/docs/checkout). I notice that if I place the embedded code between @section('content') and @endsection, it will not display the form when I click the Pay with card button. However, if I remove @section('content') or place the embedded code outside of it, then it will display the form perfectly, however, this will break the structure of my layout.

index.blade.php

JavaScript

Thanks!

EDITED: layout.app

JavaScript

Advertisement

Answer

So I figured out what’s the problem, it’s because the <script> tag conflict with Vue components.

So there are two solutions:

1) Create a duplicate layout without the Vue element identifier <div id="app"></div>

or

2) Create a script tag using the mount() hook in Vue component.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement