|
|
@@ -23,11 +23,28 @@ class WithdrawController extends BaseController
|
|
|
{
|
|
|
public function notify(Request $request)
|
|
|
{
|
|
|
-
|
|
|
$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);
|
|
|
+ if (!isset($data['sign'])) {
|
|
|
+ @file_put_contents('notify.txt', '未接受到签名' . PHP_EOL, FILE_APPEND);
|
|
|
+ echo 'FAIL';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $sign = $data['sign'];
|
|
|
+ unset($data['sign']);
|
|
|
+ if (WithdrawService::init()::checkSign($data, $sign)) {
|
|
|
+ switch ($data['type']) {
|
|
|
+ case 'create_batch_order':
|
|
|
+ if ($data['return_code'] == 'SUCCESS') {
|
|
|
+ $info = WithdrawService::init()::decode($data['resoult']);
|
|
|
+ @file_put_contents('notify.txt', json_encode($info) . PHP_EOL, FILE_APPEND);
|
|
|
+
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ @file_put_contents('notify.txt', '签名校验失败' . PHP_EOL, FILE_APPEND);
|
|
|
+ echo 'FAIL';
|
|
|
}
|
|
|
}
|
|
|
}
|