From 37360264aea34d3a2eaeb34df1cf17236196d0c3 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:58:40 +0200 Subject: [PATCH] Check action URL first. --- src/Core/Gateway.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Core/Gateway.php b/src/Core/Gateway.php index b8d6f021..529385cc 100644 --- a/src/Core/Gateway.php +++ b/src/Core/Gateway.php @@ -324,6 +324,12 @@ public function redirect_via_html( Payment $payment ) { * @throws \Exception When payment action URL is empty. */ public function get_form_html( Payment $payment ) { + $action_url = $payment->get_action_url(); + + if ( empty( $action_url ) ) { + throw new \Exception( 'Action URL is empty, can not get form HTML.' ); + } + $form_inner = $this->get_output_html( $payment ); $form_inner .= sprintf( @@ -331,12 +337,6 @@ public function get_form_html( Payment $payment ) { __( 'Pay', 'pronamic_ideal' ) ); - $action_url = $payment->get_action_url(); - - if ( empty( $action_url ) ) { - throw new \Exception( 'Action URL is empty, can not get form HTML.' ); - } - $html = sprintf( '
', esc_attr( $action_url ),