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 1


The 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');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.