|
|
@@ -128,10 +128,14 @@ class DouYinController extends BaseApiController
|
|
|
*/
|
|
|
public function goodsNotify()
|
|
|
{
|
|
|
- $params = $this->request->post();
|
|
|
- // {"operate_type":"CREATE","product_id":"7527118921439119395","reason":"","status":"PASS"}
|
|
|
- Log::info('goodsNotify:'.formatLogData($params));
|
|
|
- return $this->success();
|
|
|
+ try {
|
|
|
+ $params = $this->request->post();
|
|
|
+ Log::info('goodsNotify:'.formatLogData($params));
|
|
|
+ DouYinService::goodsNotify($params);
|
|
|
+ return json(["err_no"=>0,"err_tips"=>""], 200);
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -232,12 +236,14 @@ class DouYinController extends BaseApiController
|
|
|
$params = $this->request->post();
|
|
|
Log::info('submitOrderNotify:'.formatLogData($params));
|
|
|
$msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
|
|
|
- if($params['type'] == 'pre_create_order') $res = DouYinService::submitOrderNotify($msg);
|
|
|
- if($params['type'] == 'pre_create_refund') $res = DouYinService::refundOrderNotify($msg);
|
|
|
- Log::info("submitOrderNotify:".formatLogData($res));
|
|
|
- if($res){
|
|
|
- return json(["err_no"=>0,"err_tips"=>"","data"=>$res], 200);
|
|
|
+ if($params['type'] == 'pre_create_order'){
|
|
|
+ $res = DouYinService::submitOrderNotify($msg);
|
|
|
+ Log::info("submitOrderNotify:".formatLogData($res));
|
|
|
+ if($res){
|
|
|
+ return json(["err_no"=>0,"err_tips"=>"","data"=>$res], 200);
|
|
|
+ }
|
|
|
}
|
|
|
+ return json(["err_no"=>1001,"err_tips"=>''], 200);
|
|
|
} catch (\Exception $e) {
|
|
|
return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
|
|
|
}
|
|
|
@@ -258,9 +264,7 @@ class DouYinController extends BaseApiController
|
|
|
if($params['type'] == 'payment' && DouYinService::payNotify($msg)){
|
|
|
return json(["err_no"=>0,"err_tips"=>""], 200);
|
|
|
}
|
|
|
- if($params['type'] == 'refund'){
|
|
|
- return json(["err_no"=>0,"err_tips"=>""], 200);
|
|
|
- }
|
|
|
+ return json(["err_no"=>1001,"err_tips"=>''], 200);
|
|
|
} catch (\Exception $e) {
|
|
|
return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
|
|
|
}
|
|
|
@@ -274,9 +278,7 @@ class DouYinController extends BaseApiController
|
|
|
if($params['type'] == 'payment' && DouYinService::payTailNotify($msg)){
|
|
|
return json(["err_no"=>0,"err_tips"=>""], 200);
|
|
|
}
|
|
|
- if($params['type'] == 'refund'){
|
|
|
- return json(["err_no"=>0,"err_tips"=>""], 200);
|
|
|
- }
|
|
|
+ return json(["err_no"=>1001,"err_tips"=>''], 200);
|
|
|
} catch (\Exception $e) {
|
|
|
return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
|
|
|
}
|
|
|
@@ -369,12 +371,13 @@ class DouYinController extends BaseApiController
|
|
|
$params = $this->request->post();
|
|
|
Log::info('refundNotify:'.formatLogData($params));
|
|
|
$msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
|
|
|
- $res = DouYinService::refundNotify($msg);
|
|
|
- if($res){
|
|
|
- return json(["err_no"=>0,"err_tips"=>"success","data"=>$res], 200);
|
|
|
- }else{
|
|
|
- throw new \Exception('申请失败');
|
|
|
+ if($params['type'] == 'pre_create_refund'){
|
|
|
+ $res = DouYinService::refundNotify($msg);
|
|
|
+ if($res){
|
|
|
+ return json(["err_no"=>0,"err_tips"=>"success","data"=>$res], 200);
|
|
|
+ }
|
|
|
}
|
|
|
+ return json(["err_no"=>1001,"err_tips"=>'申请失败'], 200);
|
|
|
} catch (\Exception $e) {
|
|
|
return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
|
|
|
}
|
|
|
@@ -387,9 +390,10 @@ class DouYinController extends BaseApiController
|
|
|
$params = $this->request->post();
|
|
|
Log::info('refundPassNotify:'.formatLogData($params));
|
|
|
$msg = is_array($params['msg'])?$params['msg']:json_decode($params['msg'],true);
|
|
|
- if(DouYinService::refundPassNotify($msg)){
|
|
|
+ if($params['type'] == 'refund' && DouYinService::refundPassNotify($msg)){
|
|
|
return json(["err_no"=>0,"err_tips"=>"success"], 200);
|
|
|
}
|
|
|
+ return json(["err_no"=>1001,"err_tips"=>''], 200);
|
|
|
} catch (\Exception $e) {
|
|
|
return json(["err_no"=>1001,"err_tips"=>$e->getMessage()], 200);
|
|
|
}
|