Laravel SystemPay after the payment URL Post - laravel

I use https://paiement.systempay.fr for the credit card payments in my application
In the SystemPay rules i have to define an URL to callback when the transaction is finish the method is POST , systempay send me back all the information on the transaction and i need to get all the parameters in a $_POST VARIABLE
My question is : I would like to create a route like : mydomaine.com/checkout/verification.php and check with a var dump if i got the POST INFO from systemPay serveur.
How could i do this in the routes with a .php and check the result ?
Hope someone could help me

Related

Laravel API routes - Same path, multiple methods

I want to make manually, some endpoints for a customer model.
I have these routes :
Route::get('customer/', 'CustomerRestController#all')->name('api_customer_all');
Route::get('customer/{id}', 'CustomerRestController#get')->name('api_customer_get');
Route::post('customer/', 'CustomerRestController#addOrUpdate')->name('api_customer_post');
Route::delete('customer/{id}', 'CustomerRestController#delete')->name('api_customer_delete');
If I call the post route with postman, the GET response is return !
Do you know why please ?
Thanks,

Laravel session variables get Null, once redirect to Payment Gateway and return back

I found some related questions, but they don't have enough explanations/solutions for my problem. I'm integrating Paycorp payment gateway with an existing project. In PaymentController.php I put all the hotel IPG settings in an array and put in session. Once I put it in session, I try to print it with vardump, it is working, it is in the session! Then I initiate the payment and redirect to generated url. It redirects to Paycorp payment, I provide the card details and submit. When it returns to PaymentCompleteController.php I need to complete the payment and I Need the Hotel IPG settings which I've put in session. When I tried to get it, there is nothing and it is NULL.
PaymentController.php
$params['something1'] = $something1;
$params['something2'] = $something2;
$params['something3'] = $something3;
$params['something4'] = $something4;
Session::put(SampleModel::PARAMS, $params);
//At this point Params are in the session
//var_dump(Session::get(SampleModel::PARAMS)); exit();
//Initiate Payment and Redirect to URL
Once the card details are given and submitted, it will redirect back to
PaymentCompleteController.php
vardump(Session::get(SampleModel::PARAMS)); exit();
In PaymentCompleteController.php session variable is null. But the variable put before the PaymentController.php are still there.
When a Laravel application lifecycle starts, any value put in Session are not yet stored until the application lifecycle ends. The redirect is preventing that.
Persist the session values right after you call put():
Session::put(SampleModel::PARAMS, $params);
Session::save();

Laravel sending id via route

I have posts, where users able to delete or edit them. And when I redirect them I was sending url with id number, like: test.dev/delete/15, where 15 is my id of post which should be deleted. Then I tested sending id in route like route('delete',['id' => $post->id]). In the end I realized that both methods include id number in url. I mean, for url it shows url test.dev/delete/15 and for route it shows test.dev/delete?id=15
So I was wondering if we can send id, without showing them in url, I am afraid that curious users may try to get use of these flaws
As you will always have to display the id somewhere on the page to send it through either a hidden field or id in the url all of which a user can change. That is why you should check in the Back-End if the user has privelege to delete that post or not

Angular $http.delete request with body

So I looked at this post:
is an entity body allowed for an http delete request
Which seems to indicate that while it is 'ok' to do on some conceptual level, in practice it may not be doable because browsers just ignore it.
I have some express.js authentication middleware I need to get through, and I don't want to attach my user details to url params. All my other requests that need to authenticate attach these details to the body of the request.
Is there some way to force this? I saw some other posts where some people seemed to have success in passing a body with their delete request.
I am running a node/sails back-end. It always logs the body as undefined for a delete request. Is there any way to modify
The sails API pulls the id of the object to delete from the params, so we have to append the id to the url.
But if I want to pass some authentication details in a body for server-side verification before processing the delete request, I can't just stick them in an object as the second parameter of the delete request, like you can with $http.post.
Angular's post method automatically assigns whatever we insert as a second parameter to the body of the request, but the delete method does not.
Angular's $http.delete method does allow us to supply a config object as the second parameter, through which we can get access to the 'data' property. This is the same way post does it through it's second parameter.
So if we need to attach a body to a delete request we can use the following:
$http.delete('/api/' + objectToDelete.id, {data: {id: currentUser().id, level: currentUser().level}});
This will pass the object to delete's id in the url parameter, and my user credentials in the body as an object.
Honestly, everytime a trouble sounds like a "restriction of as REST", a rethink of the strategy and the philosophy might be a good idea.
I have some authentication middleware I need to get through
I don't want to attach my user details to url params
I'm not directly answering the question, but you should know that among the commons
URL parameters (or query, but URL anyway)
Body
there is a third option for "passing values to the server" :
request Headers
I'd just suggest to consider that third option to provide your credentials: request header.
Edit : following appendix would just apply to any "external" middleware, like a proxy server or whatever, not a true express middleware inside sails.js
In addition, that would be a good idea that your middleware stripped those headers before redirecting to the real action.

send data to specific url with codeigniter

i'm a newbie in codeiginiter,
i want auto send data like a form submit to a specific url,example
http://192.165.10.X/hit/get?id=000000010101001&30001=1500:0&30002=85:2
where (000000010101001&30001=1500:0&30002=85:2) is a parameter i want to send.
how can i do that with codeigniter,
or can someone advice technic or share a link to be learn,
Thanks for helping me ,
In CodeIgnitor, The URL usually will be example.com/index.php/news/article/1.
you can use POST/GET method to send data to any public function in the controller. In the controller function, you can get the POST data using either $_POST or $this->input->post(); . If its GET method, you can use $this->uri->segment(SEGMENT NO);

Resources