Skip to content

Commit

Permalink
Check action URL first.
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Oct 4, 2023
1 parent 402e630 commit 3736026
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Core/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,19 +324,19 @@ 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(
'<input class="pronamic-pay-btn" type="submit" name="pay" value="%s" />',
__( '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(
'<form id="pronamic_ideal_form" name="pronamic_ideal_form" method="post" action="%s">%s</form>',
esc_attr( $action_url ),
Expand Down

0 comments on commit 3736026

Please sign in to comment.