I want to send user to payment gate. Normally it could be made by this form:
<form method="post" action="https://demo.moneta.ru/assistant.htm">
<input type="hidden" name="MNT_ID" value="12345678">
<input type="hidden" name="MNT_TRANSACTION_ID" value="000001">
<input type="hidden" name="MNT_CURRENCY_CODE" value="USD">
<input type="hidden" name="MNT_AMOUNT" value="123.45">
<input type="submit" value="Pay">
</form>
User press "Pay" and redirect to payment gate.
But I want implement this workflow:
- User enter delivery info, payment method, etc.
- After that he press "Pay" and
- First I want to store data (I do it in my controller)...
- ... and after that I want redirect user to payment gate. (this is unclear for me)
The question is: how to redirect user to external resource from controller (method should be POST, and I need do send some data such as MNT_ID, etc. (see form example above)?
It could help you use the Laravel controller as usual and redirect after to the external resource.
In your view redirect the action to your controller:
In your controller:
I didn't test it, but I'm pretty sure that it works (or is near to the solution).
You can get other suggestion from the official guide: http://laravel.com/docs/5.1/responses#redirects
I think this is what you are looking for:
call your function controller:
then in your view: