|
|
@@ -539,26 +539,29 @@ class DeliveryController extends BaseController
|
|
|
}
|
|
|
Yii::info('fengniao 回调 -- post: ' . json_encode($callbackData));
|
|
|
|
|
|
- $get = Yii::$app->request->get();
|
|
|
- Yii::info('fengniao 回调 -- get: ' . json_encode($get));
|
|
|
-
|
|
|
- $fa = new \common\components\delivery\services\adapter\FengniaoAdapter();
|
|
|
- $all_sign = $fa->second_geneSignature($callbackData);
|
|
|
- $arr = json_decode($callbackData['business_data'], true);
|
|
|
- $sec_sign = $fa->second_geneSignature($arr);
|
|
|
- Yii::info('fengniao sign: ' . $all_sign . ', $sec_sign: ' . $sec_sign);
|
|
|
-
|
|
|
// 逆向回调接口结果的加签
|
|
|
$param = [
|
|
|
'app_id' => $callbackData['app_id'],
|
|
|
'timestamp' => $callbackData['timestamp'],
|
|
|
'business_data' => $callbackData['business_data']
|
|
|
];
|
|
|
- $paramSign_1 = $fa->second_geneSignature($param);
|
|
|
- $paramSign_2 = $fa->generateSignature($param);
|
|
|
- Yii::info('$paramSign_1 sign: ' . $paramSign_1 . ', $paramSign_2: ' . $paramSign_2);
|
|
|
|
|
|
- util::complete('蜂鸟回调接口');
|
|
|
+ $fa = new \common\components\delivery\services\adapter\FengniaoAdapter();
|
|
|
+ $paramSign = $fa->generateSignature($param);
|
|
|
+ if($paramSign == $callbackData['signature']){
|
|
|
+ $businessData = isset($callbackData['business_data']) ? $callbackData['business_data'] : '';
|
|
|
+ if(empty($businessData)){
|
|
|
+ $this->asJson(['return_code' => -1, 'return_msg' => 'business data is empty']);
|
|
|
+ }
|
|
|
+ $businessData = json_decode($businessData, true);
|
|
|
+ $cbnObj = new \common\components\delivery\platform\fengniao\CallBackNotify();
|
|
|
+ $ret = $cbnObj->handle($businessData['callback_business_type'], $businessData['param']);
|
|
|
+
|
|
|
+ return $this->asJson(['return_code' => 0, 'return_msg' => 'OK']);
|
|
|
+ }else{
|
|
|
+ Yii::error('蜂鸟回调接口签名出错');
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|