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

No redirect to status page if there is no action URL #167

Open rvdsteege opened 8 months ago

rvdsteege commented 8 months ago

It is possible that there is no action URL when starting a payment, e.g. Direct Debit via Mollie (for which we create the token). In this case the user will not be redirected:

https://github.com/pronamic/wp-pay-core/blob/c743a1506d01274286f51d23debf765004b17d6f/src/Plugin.php#L539-L590

@remcotolsma should we add a fallback to redirect to the payment return redirect URL?

        // Redirect to payment return redirect URL.
        $return_redirect_url = $payment->get_return_redirect_url();

        if ( ! empty( $return_redirect_url ) ) {
            wp_redirect( $return_redirect_url );

            exit;
        }