|
@@ -123,7 +123,6 @@ class RefillBase
|
|
|
$card_type = intval($refill_info['card_type']);
|
|
|
$spec = intval($refill_info['refill_amount']);
|
|
|
$mchid = intval($refill_info['mchid']);
|
|
|
- $org_quality = intval($refill_info['org_quality']);
|
|
|
$mch_order = $refill_info['mch_order'];
|
|
|
|
|
|
if ($success) {
|
|
@@ -131,18 +130,19 @@ class RefillBase
|
|
|
util::incr_user_success($mchid,$card_type, $spec,$quality);
|
|
|
$logic_vr_order->changeOrderStateSuccess($order_id,true);
|
|
|
util::onOrderSuccess($refill_info,$order_info);
|
|
|
+ $tran->commit();
|
|
|
}
|
|
|
elseif ($can_try)
|
|
|
{
|
|
|
util::incr_notify($chname, $card_type, $spec, $quality, false);
|
|
|
util::incr_amount_lock($mchid,$card_type,$spec);
|
|
|
$logic_vr_order->changeOrderStateCancel($order_info, '', "{$chname}接口回调通知失败,正在重试",true,true);
|
|
|
+ $mod_refill->edit($order_id, ['is_retrying' => 1,'notify_time' => time()]);
|
|
|
+ $tran->commit();
|
|
|
|
|
|
[$can_retry,$params] = $this->retry($refill_info, $order_info);
|
|
|
if ($can_retry)
|
|
|
{
|
|
|
- $mod_refill->edit($order_id, ['is_retrying' => 1,'notify_time' => time()]);
|
|
|
- $tran->commit();
|
|
|
if(util::push_add($params)) {
|
|
|
return true;
|
|
|
}
|
|
@@ -152,23 +152,23 @@ class RefillBase
|
|
|
util::incr_notify($chname, $card_type, $spec, $quality, false);
|
|
|
util::incr_amount_lock($mchid,$card_type,$spec);
|
|
|
$logic_vr_order->changeOrderStateCancel($order_info, '', "{$chname}接口回调通知失败,不可重试.",true,true);
|
|
|
+ $tran->commit();
|
|
|
+ }
|
|
|
+
|
|
|
+ $mod_refill->edit($order_id, ['notify_time' => time(), 'is_retrying' => 0,'notify_state' => 1]);
|
|
|
+ util::pop_queue_order($mchid,$mch_order);
|
|
|
+ QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
|
|
|
+
|
|
|
+ if(!$success) {
|
|
|
+ util::incr_user_fail($mchid,$card_type, $spec,$quality);
|
|
|
}
|
|
|
- $tran->commit();
|
|
|
+ return true;
|
|
|
}
|
|
|
catch (Exception $ex) {
|
|
|
$tran->rollback();
|
|
|
Log::record("Error:" . $ex->getMessage(), Log::ERR);
|
|
|
+ return false;
|
|
|
}
|
|
|
-
|
|
|
- if(!$success) {
|
|
|
- util::incr_user_fail($mchid,$card_type, $spec,$quality);
|
|
|
- }
|
|
|
-
|
|
|
- $mod_refill->edit($order_id, ['notify_time' => time(), 'is_retrying' => 0,'notify_state' => 1]);
|
|
|
- util::pop_queue_order($mchid,$mch_order);
|
|
|
- QueueClient::push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => false]);
|
|
|
-
|
|
|
- return true;
|
|
|
}
|
|
|
|
|
|
private function retry(array $refill_info, array $order_info)
|