Parcourir la source

跨境商品支付接入

kevin il y a 1 an
Parent
commit
d235865f6c
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  1. 6 2
      common/models/forms/ApproachOrderForm.php

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

@@ -125,10 +125,13 @@ class ApproachOrderForm extends Model
      */
     public function beforeValidate()
     {
+        LoggerTool::info(['UPOP - webhook: (validate). beforeValidate1']);
         $parentValidate = parent::beforeValidate();
         if ($this->sn) {
             $this->_model = ApproachOrder::findOne(['SN' => $this->sn]);
+            LoggerTool::info(['UPOP - webhook: (validate). beforeValidate2']);
             if (!ApproachOrder::findOneAsArray('SN = :SN', [':SN' => $this->sn])){
+                LoggerTool::info(['UPOP - webhook: (validate). isStatus']);
                 $this->addError('sn', '订单不存在');
                 return false;
             }
@@ -142,6 +145,7 @@ class ApproachOrderForm extends Model
      * @param $attribute
      */
     public function isAddress($attribute){
+        LoggerTool::info(['UPOP - webhook: (validate). isAddress']);
         if (!$receiveAddress = ReceiveAddress::find()->where('ID=:ID', [':ID' => $this->addressId])->asArray()->one()) {
             $this->addError($attribute, '收货地址不存在');
         } else {
@@ -160,6 +164,7 @@ class ApproachOrderForm extends Model
      */
     public function isPayType($attribute)
     {
+        LoggerTool::info(['UPOP - webhook: (validate). isStatus']);
         if (!in_array($this->payType, array_values(ShopGoods::BANK_CODE))) {
             $this->addError('支付方式错误');
         }
@@ -180,6 +185,7 @@ class ApproachOrderForm extends Model
      * @param $attribute
      */
     public function isStatus($attribute){
+        LoggerTool::info(['UPOP - webhook: (validate). isStatus']);
         if($this->type && !in_array($this->type, \Yii::$app->params['orderStatus'])){
             $this->addError($attribute, '订单状态类型错误');
         }
@@ -233,8 +239,6 @@ class ApproachOrderForm extends Model
 
     public function verifyPayUPOP(): ?bool
     {
-        LoggerTool::info([$this->sn, $this->status, $this->note]);
-
         if (!$this->validate()) {
             LoggerTool::error(['UPOP - webhook: (validate).']);
             return null;