wesmiler 3 miesięcy temu
rodzic
commit
ad80d459fb
2 zmienionych plików z 18 dodań i 4 usunięć
  1. 16 2
      app/Services/DyrPayService.php
  2. 2 2
      app/Services/PaymentService.php

+ 16 - 2
app/Services/DyrPayService.php

@@ -58,7 +58,7 @@ class DyrPayService extends BaseService
      * @param string $amount 充值面值
      * @return bool
      */
-    public function recharge($no, $account, $productId, $amount)
+    public function recharge($no, $account, $productId, $amount, $params=[])
     {
         if (empty($this->apiUrl) || empty($this->apiKey) || empty($this->apiClientId)) {
             $this->error = '接口参数未配置';
@@ -78,8 +78,22 @@ class DyrPayService extends BaseService
             'amount' => $amount,                // 金额
             'mobile' => $account,                // 手机号
             'notify_url' => url('/api/notify/dyr/' . $productId),            // 回调地址
-
         ];
+        if(isset($params['ytype']) && $params['ytype']){
+            $param['ytype'] = intval($params['ytype']);
+        }
+
+        if(isset($params['id_card_no']) && $params['id_card_no']){
+            $param['id_card_no'] = intval($params['id_card_no']);
+        }
+
+        if(isset($params['area']) && $params['area']){
+            $param['area'] = intval($params['area']);
+        }
+
+        if(isset($params['city']) && $params['city']){
+            $param['city'] = intval($params['city']);
+        }
 
         //请求参数
         $param['sign'] = $this->makeSign($param);

+ 2 - 2
app/Services/PaymentService.php

@@ -492,7 +492,7 @@ class PaymentService extends BaseService
             // 生活充值
             else if ($scene == 'pay') {
                 $orderInfo = PayOrdersModel::where(['order_no' => $orderNo, 'mark' => 1])
-                    ->select(['id as order_id', 'user_id','meal_id','product_id', 'order_no','transaction_id','account', 'total as pay_money','pay_total', 'pay_at as pay_time', 'remark', 'status'])
+                    ->select(['id as order_id', 'user_id','meal_id','product_id', 'order_no','transaction_id','account', 'total as pay_money','area','ytype','city','id_card_no','pay_total', 'pay_at as pay_time', 'remark', 'status'])
                     ->first();
                 $orderStatus = isset($orderInfo['status']) ? $orderInfo['status'] : 0;
                 // 验证订单
@@ -567,7 +567,7 @@ class PaymentService extends BaseService
                     $total = isset($orderInfo['pay_money'])? $orderInfo['pay_money'] : 0;
                     $amount = $total;
 
-                    $result = DyrPayService::make()->recharge($orderNo, $account, $productId, $amount);
+                    $result = DyrPayService::make()->recharge($orderNo, $account, $productId, $amount, $orderInfo);
                     $errno = isset($result['errno'])?$result['errno'] : -1;
                     $errmsg = isset($result['errmsg'])?$result['errmsg'] : '';
                     $res = isset($result['data'])?$result['data']:[];