pronamic / wp-pay-core

Core components for the WordPress payment processing library. This library is used in the WordPress plugin Pronamic Pay: https://www.pronamicpay.com/, but also allows other plugin developers to set up a payment plugin.
https://www.wp-pay.org/
GNU General Public License v3.0
27 stars 3 forks source link

Suggestion: Addition of get_pay_redirect_url on Payment Info Page #57

Closed knit-pay closed 2 years ago

knit-pay commented 2 years ago

Hello Team

I got this feedback from various customers of mine. What do you think about it?

If the payment gateway supports METHOD_HTTP_REDIRECT method, the action URL is the same URL where customers get redirected for payment. So, on the payment info page, if the admin clicks on the action URL, the admin also gets redirected to payment URL. Admin can also copy this URL and share it with customers separately.

But Action URL on the Payment Info page is of no use if the Payment gateway supports METHOD_HTML_FORM method. Even if the admin will share this URL with the customer or click this URL, the customer/admin will never reach the payment page without post parameters from get_output_fields function.

So, my suggestion is to show the Payment Redirect URL from the $payment->get_pay_redirect_url function on the Payment info page instead of the Action URL. This will work for both METHOD_HTTP_REDIRECT and METHOD_HTML_FORM method. Even if you don't remove the action URL, get_pay_redirect_url should be introduced. Correct me if I am understanding it wrongly.

https://github.com/pronamic/wp-pay-core/blob/master/views/meta-box-payment-info.php#L880:L899

knit-pay commented 2 years ago

Hello Team

have you got time to look into this?

remcotolsma commented 2 years ago

For now we display also the "Pay Redirect URL" from $payment->get_pay_redirect_url() in https://github.com/pronamic/wp-pay-core/commit/c3e836b0e40adf9ff1c4f11855c9c07f8bddc4ac, maybe we will combine the "Action URL" and "Pay Redirect URL" in the future.

knit-pay commented 2 years ago

Thanks