I am working on custom API based payment gateway. For 3D secure verification payment gateway return encoded form that need to submit to redirect user on third party site for card verification.
I am working on this code in capture function of payment model.
Here My question is How can I use encoded form to redirect user from payment model capture method to third party site.
I have used getOrderPlaceRedirectUrl to redirect user in Hosted form Method.
Please suggest.
Best Answer
I created a new controller action and redirected users to it from getOrderPlaceRedirectUrl(). This new controller action will show a hidden form that displays the MD, PaReq etc as hidden fields. This form can then auto submit to the ACS URL.
Some untested pseudo-code is below. You'll need to modify it according to your needs but hopefully it gets the idea across.
Inside your payment method instance:
app/code/local/Namespace/Module/controllers/Payment.php:
app/design/frontent/base/default/layout/module.xml:
app/code/local/Namespace/Module/Block/Payment/Redirect.php:
app/design/frontend/base/default/templates/module/payment/redirect.tpl:
Note: I first saw and answered this question on SO. Unsure of the protocol for handling duplicate questions across SE sites. Perhaps someone will advise?