Ver código fonte

余额支付的接口可以了

shish 6 anos atrás
pai
commit
ddeabce803
1 arquivos alterados com 7 adições e 4 exclusões
  1. 7 4
      app/client/controllers/OrderController.php

+ 7 - 4
app/client/controllers/OrderController.php

@@ -216,7 +216,7 @@ class OrderController extends BaseController
 		OrderService::updateById($orderId, $updateData);
 		OrderService::updateById($orderId, $updateData);
 		util::success($newParams);
 		util::success($newParams);
 	}
 	}
-
+	
 	//快捷付款订单
 	//快捷付款订单
 	public function actionFastPay()
 	public function actionFastPay()
 	{
 	{
@@ -232,6 +232,7 @@ class OrderController extends BaseController
 		$post['userId'] = $this->userId;
 		$post['userId'] = $this->userId;
 		$prePrice = round($post['prePrice'], 2);
 		$prePrice = round($post['prePrice'], 2);
 		$actPrice = $prePrice;
 		$actPrice = $prePrice;
+		$post['actPrice'] = $actPrice;
 		$post['payStyle'] = 0;
 		$post['payStyle'] = 0;
 		$post['merchantId'] = $this->merchantId;
 		$post['merchantId'] = $this->merchantId;
 		$now = time();
 		$now = time();
@@ -248,9 +249,9 @@ class OrderController extends BaseController
 		$orderId = $order['id'];
 		$orderId = $order['id'];
 		$merchantId = $this->merchantId;
 		$merchantId = $this->merchantId;
 		$couponId = isset($post['couponId']) ? $post['couponId'] : 0;
 		$couponId = isset($post['couponId']) ? $post['couponId'] : 0;
-
+		
 		if ($payWay == 0) {
 		if ($payWay == 0) {
-
+			
 			$orderId = $order['id'];
 			$orderId = $order['id'];
 			$name = '购买商品';
 			$name = '购买商品';
 			$totalFee = $actPrice;
 			$totalFee = $actPrice;
@@ -363,7 +364,7 @@ class OrderController extends BaseController
 			util::success($result);
 			util::success($result);
 			
 			
 			
 			
-		} else {
+		} elseif ($payWay == 2) {
 			//验证支付密码是否正确
 			//验证支付密码是否正确
 			$payPassword = isset($post['payPassword']) ? $post['payPassword'] : 0;
 			$payPassword = isset($post['payPassword']) ? $post['payPassword'] : 0;
 			UserService::validPayPassword($payPassword, $this->user);
 			UserService::validPayPassword($payPassword, $this->user);
@@ -372,6 +373,8 @@ class OrderController extends BaseController
 			$totalFee = $order['actPrice'];
 			$totalFee = $order['actPrice'];
 			xhPayToolService::balancePay($orderId, $totalFee, $capitalType, $couponId);
 			xhPayToolService::balancePay($orderId, $totalFee, $capitalType, $couponId);
 			util::success('支付成功');
 			util::success('支付成功');
+		} else {
+			util::fail('无效的支付方式');
 		}
 		}
 	}
 	}