zb727 1 tahun lalu
induk
melakukan
b68d1660fb
2 mengubah file dengan 14 tambahan dan 41 penghapusan
  1. 4 18
      helper/refill/api/mh/weisanhuo_normal/config.php
  2. 10 23
      test/mh/TestRefill.php

+ 4 - 18
helper/refill/api/mh/weisanhuo_normal/config.php

@@ -17,26 +17,12 @@ class config
         mtopcard\ChinaMobileCard =>
             [
                 1 => 'cshf1',  //测试
-                50 => 'k-yd-50',
+                //50 => 'k-yd-50',
                 100 => 'k-yd-100',
-                200 => 'k-yd-200'
-                //300 => 'k-yd-300',
-               // 500 => 'k-yd-500'
+                200 => 'k-yd-200',
+                300 => 'k-yd-300',
+                500 => 'k-yd-500'
             ],
-//        mtopcard\ChinaUnicomCard =>
-//            [
-//                30 => 'k-lt-30',
-//                50 => 'k-lt-50',
-//                100 => 'k-lt-100',
-//                200 => 'k-lt-200'
-//            ],
-//        mtopcard\ChinaTelecomCard =>
-//            [
-//                30 => 'k-dx-30',
-//                50 => 'k-dx-50',
-//                100 => 'k-dx-100',
-//                200 => 'k-dx-200'
-//            ]
     ];
 
     public static function sign(array $params, array $ignore = []): string

+ 10 - 23
test/mh/TestRefill.php

@@ -109,22 +109,23 @@ class TestRefill extends TestCase
         $provider->notify($content);
     }
 
-    public function testWensanhuo()
+    public function testWeisanhuo()
     {
         $provider = $this->getProvider('weisanhuo_normal');
         $order_sn = $this->make_sn();
-        //$resp = $provider->add(18855414101, 4, 30, ['order_sn' => $order_sn, 'regin_no' => 1]);//30为测试产品
-        //$resp = $provider->query(['order_sn' => $order_sn]);
+        $resp = $provider->add(13911220681, 4, 1, ['order_sn' => $order_sn, 'regin_no' => 1]);//30为测试产品
+        $resp = $provider->query(['order_sn' => $order_sn]);
         $resp = $provider->balance();
     }
 
-    public function testWensanhuoCB()
+    public function testWeisanhuoCB()
     {
-        $_POST='{"orderId":"S23112800025098","outOrderId":"60201701159853851187","requestDate":"20231128164156","sign":"E172D40D040D26C8226E237ACED8C861","accessToken":"beaf87f8-7c6b-cb8a-98b8-53c207ca9aef","status":"1"}';
-        $content = json_decode($_POST,true);
-        $provider = $this->getProvider('lifang_normal','RefillCallBack');
-        $provider->verify($content);
-        $provider->notify($content);
+        $post = '{"operatorTradeNo":"202312198256229371","statusDesc":"交易成功","phone":"13911220681","outTradeNo":"91791702973663689415","sign":"c81575ceb8d2b28cd37e33c65141361c","inTradeNo":"20231219161425561173378018037","status":"success","reportTime":"1702974060008"}';
+        $data = json_decode($post, true);
+        $provider = $this->getProvider('weisanhuo_normal', 'RefillCallBack');
+
+        $ret = $provider->verify($data);
+        $resp = $provider->notify($data);
     }
 
     public function testJson()
@@ -166,18 +167,4 @@ class TestRefill extends TestCase
         $microtime = intval(microtime(true) * 1000);
     }
 
-    public function testweisanhuo()
-    {
-        $provider = $this->getProvider('weisanhuo');
-//        $resp = $provider->balance();
-//        $resp = $provider->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
-        $resp = $provider->query(['order_sn' => '24271700815859899563-9']);
-
-        $post = '{"operatorTradeNo":"","statusDesc":"交易成功","phone":"18780103116","outTradeNo":"202309250000000006","sign":"d793406757c1bb920fe518e9673a28ea","inTradeNo":"202309251766523539","status":"success","reportTime":"1695607732705"}';
-        $data = json_decode($post, true);
-        $provider = $this->getProvider('weisanhuo', 'RefillCallBack');
-
-        $ret = $provider->verify($data);
-//        $resp = $provider->notify($data);
-    }
 }