jeudi 10 mai 2018

How can we get posted data to my url from a third party website in laravel5.6?

I have a website. It is created using laravel 5.6. I integrated a payment gateway (payone) that is working fine. I can do test transactions. But I don't know how can I capture the post data posted by payment gateway to my url (https://demo.project.de/payment/response). I had tried some functionality but not working. Here is my code. Any help will be appreciated.

routes->web.php

Route for getting post from payment gateway (payone)

Route::post('/payment/response', 'PaymentController@response')->name('payment.response');

PaymentController.php

public function response()
    {
        // you'll need to include the $defaults array somehow, or at least get the key from a secret configuration file
        if ($_POST["key"] == hash("md5", env('KEY'))) {
            // key is valid, this notification is for us
            echo "TSOK";
            if ($_POST["txaction"] == "appointed") {
                dd($_POST);
                // a freshly created transaction has been marked successfully initiated
                // update that transaction accordingly, e.g. by $_POST["reference"]
            }
            if ($_POST["txaction"] == "paid") {
                dd($_POST);
                // update your transaction accordingly, e.g. by $_POST["reference"]
            }
        }
    }



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

Aucun commentaire:

Enregistrer un commentaire