소스 검색

跨境商品支付接入

kevin 1 년 전
부모
커밋
298250ee9a
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      common/models/forms/ApproachOrderForm.php

+ 8 - 2
common/models/forms/ApproachOrderForm.php

@@ -142,6 +142,7 @@ class ApproachOrderForm extends Model
      * @param $attribute
      */
     public function isAddress($attribute){
+        LoggerTool::error(['UPOP - webhook: (isAddress 1).']);
         if (!$receiveAddress = ReceiveAddress::find()->where('ID=:ID', [':ID' => $this->addressId])->asArray()->one()) {
             $this->addError($attribute, '收货地址不存在');
         } else {
@@ -151,6 +152,7 @@ class ApproachOrderForm extends Model
                 $this->_address = $receiveAddress;
             }
         }
+        LoggerTool::error(['UPOP - webhook: (isAddress 2).']);
     }
 
     /**
@@ -160,7 +162,8 @@ class ApproachOrderForm extends Model
      */
     public function isPayType($attribute)
     {
-        if (!in_array($this->payType, array_values(ShopGoods::BANK_CODE))) {
+        LoggerTool::error(['UPOP - webhook: (isPayType 1).']);
+        if ($this->payType && !in_array($this->payType, array_values(ShopGoods::BANK_CODE))) {
             $this->addError('支付方式错误');
         }
 
@@ -173,6 +176,7 @@ class ApproachOrderForm extends Model
         if (count($goodsCategoryType) > 1) {
             $this->addError($attribute, '订单不能包含多种商品分类');
         }
+        LoggerTool::error(['UPOP - webhook: (isPayType 2).']);
     }
 
     /**
@@ -180,7 +184,9 @@ class ApproachOrderForm extends Model
      * @param $attribute
      */
     public function isStatus($attribute){
-        if($this->status && !in_array($this->status, \Yii::$app->params['orderStatus'])){
+        LoggerTool::error(['UPOP - webhook: (isStatus 1).']);
+        if ($this->status && !in_array($this->status, \Yii::$app->params['orderStatus'])) {
+            LoggerTool::error(['UPOP - webhook: (isStatus 2).']);
             $this->addError($attribute, '订单状态类型错误');
         }
     }