I need to integrate the code of payment gateway in woocommerce. I have installed the Custom payment gateway plugin. But I didn’t finf the option for integration of the code.

I tried to add code on the thankyou.php. Here,
1. I am checking the payment method selected.
2. If my custom payment is selected it redirects to payment-gateway.php file, it contains my PG code.

But when I am redirected to thankyou.php the order entry is made in database and email is send to admin before payment made.

How can I avoid this? Or is there any other way to integrate my PG code.

Read more here: In Woocommerce I want to add my custom payment gateway code along with Cheque payment


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: