Skip to content

Commit ec51fd5

Browse files
committed
fixed correct status display on order retries
1 parent 7f29755 commit ec51fd5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

wc-payneteasy.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function return_handler(): void {
202202
throw new \Exception(__('Order ID is empty.', 'wc-payneteasy'));
203203

204204
$this->set_order($order_id);
205-
$this->change_payment_status($payment_status = $this->get_payment_status($three_d_html));
205+
$this->change_payment_status( $payment_status = $this->get_payment_status($three_d_html) );
206206

207207
WC()->cart->empty_cart(); # иначе продолжает слать всё тот же ордер_ид, и гейт отдаёт один и тот же запрос
208208

@@ -394,7 +394,8 @@ private function get_payment_status(&$three_d_html = null, $paynet_id = null): s
394394

395395
private function paynet_order_id(): string {
396396
global $wpdb;
397-
return $wpdb->get_var("SELECT paynet_order_id FROM {$wpdb->prefix}payneteasy_payments WHERE (merchant_order_id='".$this->order->get_id()."')");
397+
return $wpdb->get_var("SELECT paynet_order_id FROM {$wpdb->prefix}payneteasy_payments WHERE merchant_order_id=".$this->order->get_id()
398+
.' ORDER BY id DESC LIMIT 1');
398399
}
399400
}
400401
}

0 commit comments

Comments
 (0)