I want to get the URL from where Customer can directly pay for their Invoice and also it should work with wc-cancelled
and wc-transaction-declined
(custom order status).
My Solution
What I'm doing now is created a custom page with my custom get parameters and processing the whole Payment Process as Documentation in Gateway provider Website.
My Problem
But the problem is whenever they update there doc file and plugin I also have to update my code; but if I get the Pay Now URL then WooCommerce and Gateway Plugin will take care of it.
Is there a better solution?
I got the solution in WooCommerce
templates/emails/customer-invoice.php
file. The function that I was looking for isget_checkout_payment_url()
.Usage
But this url only works with
pending
,failed
order status; So I used filterwoocommerce_valid_order_statuses_for_payment
^^ I added this in my active theme's
functions.php
file.Reference: