Skip to content

Commit

Permalink
IAP-5078 (#26)
Browse files Browse the repository at this point in the history
* change from order get_id to get_order_number
  • Loading branch information
Lars-icepay authored Jan 27, 2025
1 parent 64458dd commit 4f2fd0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function process_payment( $order_id ): array {
);

$order = wc_get_order( $order_id );
$reference = str_replace( '{ORDER_ID}', (string) $order->get_id(), Icepay::getDescription() );
$reference = str_replace( '{ORDER_ID}', $order->get_order_number(), Icepay::getDescription() );

[ $isSuccessful, $payment ] = $client->create(
[
Expand Down
4 changes: 2 additions & 2 deletions src/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ public function handle(): void {
$orderStatus = $order->get_status();

if ($orderStatus === 'pending' || $orderStatus === 'on-hold' || $orderStatus === 'cancelled' || $orderStatus === 'checkout-draft' ) {
$log->info( 'Updating ' . (str_replace( '{ORDER_ID}', (string) $order->get_id(), Icepay::getDescription() )) . ' status to ' . $status . ' for ' . ($data['key'] ?? 'key-not-found') );
$log->info( 'Updating ' . (str_replace( '{ORDER_ID}', $order->get_order_number(), Icepay::getDescription() )) . ' status to ' . $status . ' for ' . ($data['key'] ?? 'key-not-found') );
$order->update_status( $status );
} else {
$log->info(
'Did not update '
. (str_replace( '{ORDER_ID}', (string) $order->get_id(), Icepay::getDescription() ))
. (str_replace( '{ORDER_ID}', $order->get_order_number(), Icepay::getDescription() ))
. ' status to ' . $status . ' for ' . ($data['key'] ?? 'key-not-found')
. 'because the current status was ' . $order->get_status()
);
Expand Down

0 comments on commit 4f2fd0d

Please sign in to comment.