Skip to content

Commit

Permalink
Update for removed payment ID fallback in formatted payment string (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed Jul 3, 2023
1 parent 1d20ec4 commit b74cb45
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ public function start( Payment $payment ) {
}

// Payment object.
$order_id = $payment->format_string( (string) $this->config->order_id );

if ( '' === $order_id ) {
$order_id = $payment->get_id();
}

$payment_object = new Icepay_PaymentObject();
$payment_object
->setAmount( $payment->get_total_amount()->get_minor_units()->to_int() )
Expand All @@ -250,7 +256,7 @@ public function start( Payment $payment ) {
->setDescription( $payment->get_description() )
->setCurrency( $payment->get_total_amount()->get_currency()->get_alphabetic_code() )
->setIssuer( $payment->get_meta( 'issuer' ) )
->setOrderID( $payment->format_string( $this->config->order_id ) );
->setOrderID( $order_id );

/*
* Payment method
Expand Down

0 comments on commit b74cb45

Please sign in to comment.