mirror of
https://github.com/10h30/woo-viet.git
synced 2026-07-11 18:56:13 +09:00
Improve calling the cron job queryDR, avoid adding the note 2 times to the order
Issue: OnePay Gateway - For the type return, the $order->add_order_note() run 2 times #19
This commit is contained in:
+7
-5
@@ -145,11 +145,13 @@ class WooViet {
|
|||||||
|
|
||||||
// Add the action to check the cron job for handling queryDR
|
// Add the action to check the cron job for handling queryDR
|
||||||
// It's not possible to add in the class "WooViet_OnePay_Domestic_Hook" because it's NOT always loadded
|
// It's not possible to add in the class "WooViet_OnePay_Domestic_Hook" because it's NOT always loadded
|
||||||
$this->WooViet_OnePay_Domestic_Hook = new WooViet_OnePay_Domestic();
|
if ( defined( 'DOING_CRON' ) and DOING_CRON ) {
|
||||||
add_action( 'wooviet_handle_onepay_querydr', array(
|
$this->WooViet_OnePay_Domestic_Hook = new WooViet_OnePay_Domestic();
|
||||||
$this->WooViet_OnePay_Domestic_Hook,
|
add_action( 'wooviet_handle_onepay_querydr', array(
|
||||||
'handle_onepay_querydr'
|
$this->WooViet_OnePay_Domestic_Hook,
|
||||||
), 10, 1 );
|
'handle_onepay_querydr'
|
||||||
|
), 10, 1 );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user