jeudi 28 mars 2019

"The POST method is not supported for this route. Supported methods: GET, HEAD

I am trying to get the token from stripe by submitting the stripe form.It gives me the error
"The POST method is not supported for this route. Supported methods: GET, HEAD.

I already have tried with

@method('GET') gives back the same page
@method('HEAD') gives back an empty page

Here is my stripe form:

<form action="" method="POST">
    @csrf
      <script
        src="https://checkout.stripe.com/checkout.js" class="stripe-button"
        data-key="pk_test_tjs3R2OtR8kbuis8IPNlOJAh008bBqanO5"
        data-amount=
        data-name="Online Payment"
        data-description="E Commerce Website"
        data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
        data-locale="auto"
        data-zip-code="true">
      </script>
</form>


My Route:

Route::post('/bill/payment',[
'uses'=>'PaymentController@pay',
'as'=>'bill.payment'
]); 



And my Controller:

 public function pay()
    {
        dd(request()->all());
    }

I expect the form data to die dump in my Controller.Any Help will be much appreciated.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2UYrXcO
via IFTTT

Aucun commentaire:

Enregistrer un commentaire