Przeglądaj źródła

跨境商品复查api修改

kevin_zhangl 2 lat temu
rodzic
commit
40330f02e0

+ 7 - 6
frontendApi/modules/v1/controllers/ShopController.php

@@ -427,7 +427,7 @@ class ShopController extends BaseController {
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                 $result = curl_exec($ch);
 
-                switch ($result) {
+                switch (strtolower($result)) {
                     case '00':  // Successful payment.
                         ApproachOrder::updateAll(['REMARK' => '00: Successful payment'], 'SN=:SN', [':SN' => $order['SN']]);
 
@@ -468,35 +468,36 @@ class ShopController extends BaseController {
                         }
                         $message = '(ReQueryIPay88Payment). orderSN{%s} 00: Successful payment';
                         break;
-                    case 'Invalid parameters':
+                    case 'invalid parameters':
                         ApproachOrder::updateAll(
                             ['STATUS' => \Yii::$app->params['orderStatus']['failPaid']['value'], 'REMARK' => 'Invalid parameters: Parameters pass in incorrect'],
                             'SN=:SN', [':SN' => $order['SN']]
                         );
+
                         $message = '(ReQueryIPay88Payment). orderSN{%s} Invalid parameters: Parameters pass in incorrect';
                         break;
-                    case 'Record not found':
+                    case 'record not found':
                         ApproachOrder::updateAll(
                             ['STATUS' => \Yii::$app->params['orderStatus']['failPaid']['value'], 'REMARK' => 'Record not found: Cannot found the record'],
                             'SN=:SN', [':SN' => $order['SN']]
                         );
                         $message = '(ReQueryIPay88Payment). orderSN{%s} Record not found: Cannot found the record';
                         break;
-                    case 'Incorrect amount':
+                    case 'incorrect amount':
                         $message = '(ReQueryIPay88Payment). orderSN{%s} Incorrect amount: Amount different';
                         ApproachOrder::updateAll(
                             ['STATUS' => \Yii::$app->params['orderStatus']['failPaid']['value'], 'REMARK' => 'Incorrect amount: Amount different'],
                             'SN=:SN', [':SN' => $order['SN']]
                         );
                         break;
-                    case 'Payment fail':
+                    case 'payment fail':
                         ApproachOrder::updateAll(
                             ['STATUS' => \Yii::$app->params['orderStatus']['failPaid']['value'], 'REMARK' => 'Payment fail: Payment fail'],
                             'SN=:SN', [':SN' => $order['SN']]
                         );
                         $message = '(ReQueryIPay88Payment). orderSN{%s} Payment fail: Payment fail';
                         break;
-                    case 'M88Admin':
+                    case 'm88admin':
                         ApproachOrder::updateAll(
                             ['STATUS' => \Yii::$app->params['orderStatus']['failPaid']['value'], 'REMARK' => 'M88Admin: Payment status updated by iPay88 Admin(Fail)'],
                             'SN=:SN', [':SN' => $order['SN']]