I am trying to develop a custom gateway where I need to get order information such as value, credit card number, card owners name, address etc. After getting this, I will send a request using the API provided by Centinel 3D Secure. If successful they will return a url for the credit card bank along with some other information which I am to POST to the bank URL.
The bank will then post data using a form to my callback URL. I can't seem to get it to work however. This is a sample of my code:
function process_payment( $order_id ) {
global $woocommerce;
//code to get data using API
if( (strcasecmp('Y', $_SESSION['Centinel_Enrolled']) == 0){
echo '<form action="'.$_SESSION["ACSUrl"].'"" method="post">
<input type=hidden name="PaReq" value="'.$_SESSION["RandomValue"].'"/>
<input type=hidden name="TermUrl" value="'$myWPCallbackUrl.'?>"/>
<input type=hidden name="MD" value="Data"/>
<input type="submit" value="Submit" id="submit_centinel_payment_form"/>
<script type="text/javascript">
jQuery(function(){
jQuery("#submit_centinel_payment_form").click();});
</script>
</form>
}
This doesn't do a redirect to the server. Does anyone have any idea why this doesn't work?