Is it possible to redirect to remote site using post method with data from the controller?
This is my question. I dont believe it is possible, but i will ask it anyway :) Btw, i dont want to send request (i know i can do this with Guzzle for example) i want to redirect to remove site using post method and send some data as well from the controller. thanks!
btw, im using Laravel 5.4
so i have the following problem, i want to store data from post request from my own server, but i need to send some data to remove server for paying purposes. Hmmmm... How can i do that? :D
The idea that i have in my mind (maybe im wrong and this is not how it suppose to happen) is that i have a batch of data from a form in my own server coming from blade page from laravel and then im successfully storing from the form to the db into the controller, but then in order for people to pay (we are talking about tickets here in case you wonder) i have to redirect them to a third party website. The official way of doing this is to redirect to the third party payment website using a form with post method and action to redirect to there website, but this way i will loose all my data (i have data like which seat the customer have chosen as well as which performance and etc.). Maybe there is a way of doing this, but i cant think of any right now...
I don't know whether you I can understand you properly or not. But I think, you can do that. There is a function called away() that you can use to redirect to external url.
For example, in this route, you can what ever you want to do operation, after that you can redirect to any external url.
Route::get('/', function(){
//save your data here
return redirect()->away('https://sclrship.com');
});
The way I've seen this handled is by receiving the form data in your application, and redirecting the user to a page which will have a hidden form with all the needed data and some javascript to automatically submit that form to the payment service.
thank you very much for all the suggestions. i will try all your suggestions. i just have to think of a simple and suffisant way of doing this.
btw, the payment method im using is Bulgarian payment website called epay.bg its not the best solution, but if u can give me some advice for a good payment method that is capable of integrating with laravel i might use it as well. im newbie to laravel. im only starting to using it. can i use spark for that us well in Bulgaria?