External POST request

0

I am sending PayU (Platform to make and receive online payments) variables by a POST form that, being correct, allow me to generate the payment on your platform. This works correctly.

One of the variables that I send in this form is "urlConfirmation(http://hexamedia.co/edictosocc/public/confirmacion)" that tells me: when giving the approved transaction (and if it does) we will send you some variables that you can save in the BD by POST method to that URLconfirmation that you indicated .

So what I did was:

1) Create the route

Route::post('confirmacion','CompraController@confirmation')->name('edictos.confirmacion');

2) In the controller I have the function to add the data I need in the DB

public function confirmation(Request $request)
         {
           $compra = new Compra;
           $data = $request->all();
           $compra->co_fullname = $data['nickname_buyer'];
           $compra->save();
         }

However, it does not work.

I think you need to grant permission to the Middleware to receive external requests.

Could you guide me on how to do that?

    
asked by Andres Luna 26.08.2017 в 05:10
source

1 answer

1

You have to add the path in protected $ except in the Middleware VerifyCsrfToken.php

protected $except = [
        'confirmacion',
    ];
    
answered by 28.08.2017 в 20:45