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 2e9e139 commit 71147a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/DirectLink/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ public function start( Payment $payment ) {
// General.
$ogone_data_general = new DataGeneralHelper( $ogone_data );

$order_id = $payment->format_string( $this->config->order_id );

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

$ogone_data_general
->set_psp_id( $this->client->psp_id )
->set_order_id( $payment->format_string( $this->config->order_id ) )
->set_order_id( $order_id )
->set_order_description( $payment->get_description() )
->set_param_plus( 'payment_id=' . $payment->get_id() )
->set_currency( $payment->get_total_amount()->get_currency()->get_alphabetic_code() )
Expand Down
8 changes: 7 additions & 1 deletion src/OrderStandard/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,14 @@ public function get_output_fields( Payment $payment ) {
// General.
$ogone_data_general = new DataGeneralHelper( $ogone_data );

$order_id = $payment->format_string( $this->config->order_id );

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

$ogone_data_general
->set_order_id( $payment->format_string( $this->config->order_id ) )
->set_order_id( $order_id )
->set_order_description( $payment->get_description() )
->set_param_plus( 'payment_id=' . $payment->get_id() )
->set_currency( $payment->get_total_amount()->get_currency()->get_alphabetic_code() )
Expand Down

0 comments on commit 71147a6

Please sign in to comment.