• Resolved sunalive

    (@sunalive)


    Hi,

    I’m trying to use the custom gateway that you have supplied. When I submit the order, it gets submitted as GET response as opposed to POST. I see that the form is having POST as the method. At this point I would assume that some JS script is pre-processing the form becore actual submission.

    Could you please help me as to what I should change to make it generate a POST response?

    Thanks & Regards,
    Ravi.

    https://www.ads-software.com/plugins/wppizza/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ollybach

    (@ollybach)

    where it currently says:

    header('location: '.$GATEWAY_URL.'?'.http_build_query($gwValues['toGateway'],'','&'))

    replace it with (adjust as appropriate):

    echo'<html><head><meta charset="'.get_bloginfo('charset').'" /><title></title></head><body>';
    echo'<form id="gwform" method="POST" role="form" enctype="application/x-www-form-urlencoded" accept-charset="'.get_bloginfo('charset').'" action="/* required url */">';
    foreach($gwValues['toGateway'] as $key=>$val){
    	echo'<input type="hidden" name="'.$key.'" value="'.$val.'"/>'.PHP_EOL;
    }
    echo'</form>';
    /*autosubmit by js*/
    echo'<script type="text/javascript">document.getElementById("gwform").submit();</script>';
    echo'</body></html>';

    Thread Starter sunalive

    (@sunalive)

    Thanks. That worked!

    Ravi.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order submitting as GET and not POST for payment’ is closed to new replies.