Kirin 1 gadu atpakaļ
vecāks
revīzija
380aa468f3

+ 7 - 1
app/controller/api/v1/WithdrawController.php

@@ -12,6 +12,7 @@ namespace app\controller\api\v1;
 
 use app\Request;
 use crmeb\basic\BaseController;
+use crmeb\services\WithdrawService;
 
 /**
  * 公共类
@@ -22,6 +23,11 @@ class WithdrawController extends BaseController
 {
     public function notify(Request $request)
     {
-        @file_put_contents('notify.txt', json_encode($request->post()) . PHP_EOL, FILE_APPEND);
+
+        $data = $request->post();
+        if ($data['return_code'] == 'SUCCESS') {
+            $info = WithdrawService::init()::decode($data['resoult']);
+            @file_put_contents('notify.txt', json_encode($info) . PHP_EOL, FILE_APPEND);
+        }
     }
 }

+ 1 - 1
crmeb/services/WithdrawService.php

@@ -176,7 +176,7 @@ class WithdrawService
         }
     }
 
-    private static function decode($businessBodyString)
+    public static function decode($businessBodyString)
     {
         //进行Aes解密
         include_once 'phpseclib/Crypt/AES.php';