Authored by 郝肖肖

更新订单状态接口二合一

... ... @@ -218,5 +218,26 @@ class PayData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 更新订单状态-未付款更新已付款状态
* @param type int $orderCode 订单号
* @param type int $paymentCode 支付方式
* @param type int $totalFee 金额
* @return type []
*/
public static function pcpayNotify($orderCode, $paymentCode, $totalFee)
{
$param = Yohobuy::param();
$param['client_type'] = 'web';
$param['private_key'] = Yohobuy::$privateKeyList['web'];
$param['method'] = 'web.SpaceOrders.pcpayNotify';
$param['orderCode'] = $orderCode;
$param['paymentCode'] = $paymentCode;
$param['totalFee'] = $totalFee;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -68,7 +68,7 @@ class PayController extends AbstractAction
// 此处是咨询过JAVA开发任明明,按照老代码的实现方式判断,更新支付方式
$paymentRecod = OrderData::updateOrderPayment($orderCode, 2, $uid);
if (empty($paymentRecod) || $paymentRecod['code'] != 200) {
$this->helpJsRedirect('系统繁忙,请稍后再试');
$this->helpJsRedirect(isset($paymentRecod['message']) ? $paymentRecod['message'] : '系统繁忙,请稍后再试');
break;
}
... ...
... ... @@ -337,7 +337,7 @@ class PayModel
$paymentRecod = OrderData::updateOrderPayment($orderCode, $payId, $uid);
if (empty($paymentRecod) || $paymentRecod['code'] != 200) {
$result['error'] = true;
$result['message'] = '系统繁忙,请稍后再试';
$result['message'] = isset($paymentRecod['message']) ? $paymentRecod['message'] : '系统繁忙,请稍后再试';
break;
}
$bankRecord = PayData::getBankByOrder($orderCode);
... ...
... ... @@ -130,13 +130,8 @@ class PaymentModel
// 无需付款
if (isset($order["payment_amount"]) && $order["payment_amount"] == 0) {
// ERP提交订单状态
PayData::submitOrderStatus($orderCode, 0, '', '', 0, '', '', '');
// 更新订单的状态
PayData::updateOrderStatus($order['order_id'], $uid, 0, 'Y', '');
//更新订单状态
PayData::pcpayNotify($orderCode, 0, 0);
$result['notNeedPay'] = true;
break;
}
... ... @@ -332,7 +327,6 @@ class PaymentModel
$firstGoods = current($orderData['order_goods']);
self::$code = array(
'code' => 200,
'message' => '支付成功,请等待发货',
'orderNum' => $orderData['order_code'],
'amount' => $orderData['payment_amount'],
'address' => $orderData['address'],
... ...