I was reading this to learn to create my own WooC payment gateway. It says,
But if you want the customer to process the payment on the gateway website then use the add_query_arg() function instead.
Could I use add_query_arg() to process the payment outside of my site such as add_query_arg( 'key', 'value', '' );
by redirecting my user to that site outside of mine?
I was reading this to learn to create my own WooC payment gateway. It says,
But if you want the customer to process the payment on the gateway website then use the add_query_arg() function instead.
Could I use add_query_arg() to process the payment outside of my site such as add_query_arg( 'key', 'value', 'http://externalpaymentsite.com' );
by redirecting my user to that site outside of mine?
1 Answer
Reset to default 0The function add_query_arg()
will generate a link with query parameters.
You should also handle the redirect additionally. Something like this will work:
$url = add_query_arg('key', 'value', 'http://externalpaymentsite.com');
wp_redirect($url)
exit;