0
votes

I have an application which reads data from an external application.

Data is send to my application in following form

http://localhost/public/checkout?amount=110&name=test

There is no authentication done or required, as we verify the source & data via a checksum validation. This is how the parent API works and need to follow the same way.

In the route i am redirecting checkout URL to a controller function, in the controller, how do i read this data from URL? This doesn't work.

Input::get('amount'); 

Route looks like this

  Route::post('/checkout',array('as'=>'postcheckout','uses'=>'CheckoutController@postData'));

I am currently getting following error

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException

1
Just looking at this, you are registering the route as a POST request, but calling it as a GET request. Does that impact the input array Laravel builds? - stakolee
Your route is setup to accept POST requests. Make sure your request is POST. Also I can see you have url parameters present in you route which gives me hint that you are trying to access it by GET method. Just change in your router: 'Route::get(...' - bulicmatko

1 Answers

0
votes

Use Route::get(...) instead :) that shoud do the trick