add($mchid, $buyer_id, $amount, $card_no, $mch_order, $idcard, $card_name, $notify_url,$quality, $order_time, $commit_times,$last_order_id); $params['commit_times'] += 1; $commit_times += 1; if($errcode !== true) { $fNotify = true; if(($errcode === refill\errcode::MERCHANT_REFILL_ERROR && $neterr) || $errcode == refill\errcode::PROVIDER_OVERLOAD) { if(refill\RefillFactory::instance()->can_nettry($quality,$order_time,$commit_times)) { $fNotify = false; $params['order_id'] = $order_id; refill\util::push_add($params); } } if($fNotify) { if($order_id === 0) { $order_info = $this->latest_order($refill_order,$mchid,$mch_order); if(empty($order_info)) { $order_id = refill\RefillFactory::instance()->zero_order($mchid, $buyer_id, $amount, $card_no, $mch_order, $idcard, $card_name, $notify_url,$quality, $order_time, $commit_times,$errmsg); } else { $order_id = $order_info['order_id']; } } QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]); } } } private function latest_order($refill_order,$mchid,$mch_order) { $orders = $refill_order->getOrderInfo(['mchid' => $mchid,'mch_order' => $mch_order]); if(empty($orders)) { return []; } else { $orders[0]; } } public function notify($channel,$input) { refill\RefillFactory::instance()->notify($channel,$input); } }