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 ),