3
votes

I wish to do a redirect from the process_payment in my custom payment gateway for Wordpress/Woocommerce.

To do a GET redirect you would do:

function process_payment( $order_id ) {
    //some code here
    //CPN is a value entered by user from custom payment field
    $cpn = $_POST['cpn'];

    return array(
        'result'   => 'success',
        'redirect' => 'https://www.sandbox.bankserver.com/cgi-bin/webscr?test_ipn=1&CPN='. $cpn
    );
}

The values received from the user in custom payment fields are security sensitive so the bank does not want to receive them via GET. How can I do a POST?

I will POST to the bank URI...which will allow the user to enter CVV on the bank page and then redirect back to my Wordpress site.

1

1 Answers

0
votes

In short, I found a better way to do this. I did the request to the 3d secure server and stored the details in the SESSION. I could then access these from the woocommerce_receipt_ page which I then created a form on and POSTED to the bank URI.