Browse Source

对接屏幕收入

15954078560 2 years ago
parent
commit
0582329d86
1 changed files with 12 additions and 1 deletions
  1. 12 1
      application/api/controller/Pay.php

+ 12 - 1
application/api/controller/Pay.php

@@ -27,6 +27,9 @@ class Pay extends Api
     //二合一支付
     public function pay() {
         $user_token = input('user_token', '', 'trim');
+        $diversionfst = input('diversionfst', '', 'trim'); //位置等导流标识
+        $diversioncsk = input('diversioncsk', '', 'trim'); //内容等导流标识
+
         if (!$user_token) {
             $this->error('参数缺失');
         }
@@ -253,8 +256,16 @@ class Pay extends Api
                     'productUnit' => '手柄',
                     'productCount' => 1
                 ]
-            ]
+            ],
+            'diversionCode' => config('product_code')
         ];
+        if ($diversionfst) {
+            $data['diversionFST'] = 'SC::' . $diversionfst;
+        }
+        if ($diversioncsk) {
+            $data['diversionCSK'] = '::' . $diversioncsk;
+        }
+
         $data = json_encode($data, 320);
         //获取鉴权token
         $sign_bytes = '/3.0/hop/svc/pay/toPay.ajax' . $this->base16_encode(md5($data));