Skip to content

Commit

Permalink
check if payment exists
Browse files Browse the repository at this point in the history
  • Loading branch information
liedekef committed Aug 28, 2024
1 parent e8f7dda commit 91f943e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions eme-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,13 @@ function eme_fs_event_payment_form( $payment_id, $resultcode = 0, $standalone =
}

$payment = eme_get_payment( $payment_id );
if (empty($payment)) {
return "<div class='eme-message-error eme-rsvp-message-error'>" . __( 'Nothing linked to this payment id', 'events-made-easy' ) . '</div>';
}
$event = eme_get_event( $payment['related_id'] );
if (empty($event)) {
// evnt has been deleted, but the payment id is still present
$ret_string = "<div class='eme-message-error eme-rsvp-message-error'>" . __( "No event found linked to this payment. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' ) . '</div>';
return $ret_string;
// event has been deleted, but the payment id is still present
return "<div class='eme-message-error eme-rsvp-message-error'>" . __( "No event found linked to this payment. If you believe you've received this message in error please contact the site owner.", 'events-made-easy' ) . '</div>';
}

$check_allowed_to_pay = eme_payment_allowed_to_pay( $payment_id );
Expand Down

0 comments on commit 91f943e

Please sign in to comment.