stanley-king 4 năm trước cách đây
mục cha
commit
8bae783270
4 tập tin đã thay đổi với 84 bổ sung34 xóa
  1. 2 1
      data/config/dev/base.ini.php
  2. 1 1
      test/TestRefill.php
  3. 0 32
      test/TestRefillFactor.php
  4. 81 0
      test/TestRefillThird.php

+ 2 - 1
data/config/dev/base.ini.php

@@ -10,7 +10,8 @@ define('BONUS_EXPIRY_DATE',true);
 define('USE_BONUS_RATE',false);
 define('SERVER_TYPE','panda');
 define('CROSS_DOAMIN',true);
-define('COMPANY_NAME', 'XYZ_COMPANY');
+//define('COMPANY_NAME', 'XYZ_COMPANY');
+define('COMPANY_NAME', 'LZKJ_COMPANY');
 define('ZERO_GOODS_ID', 6245);
 
 $config = [];

+ 1 - 1
test/TestRefill.php

@@ -300,7 +300,7 @@ class TestRefill extends TestCase
     public function testWeiyiPhone()
     {
         $providers = new refill\weiyi\RefillPhone([]);
-//        $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
+        $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
 //        $resp = $providers->query(['order_sn' => '59031616396534854303']);
 //        $body = '{"userid":"8177b4b1d0254c0699bc","ordernum":"59031616396534854303","mobile":"18500608333","timestamp":"20210322150437","state":"3","desc":"%E5%A4%B1%E8%B4%A5%3A%E5%A4%B1%E8%B4%A5","sign":"1d412f956c041bf4454357b209c93df6"}';
 //        $params = json_decode($body , true);

+ 0 - 32
test/TestRefillFactor.php

@@ -1,32 +0,0 @@
-<?php
-
-
-use PHPUnit\Framework\TestCase;
-
-define('APP_ID', 'test');
-define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
-
-require_once(BASE_ROOT_PATH . '/global.php');
-require_once(BASE_CORE_PATH . '/lrlz.php');
-require_once(BASE_ROOT_PATH . '/fooder.php');
-
-require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
-
-class TestRefillFactor extends TestCase
-{
-    public static function setUpBeforeClass(): void
-    {
-        Base::run_util();
-    }
-
-    public function testProvider()
-    {
-        $provider = new refill\ProviderManager();
-        $provider->load();
-    }
-
-    public function testInstance()
-    {
-        refill\RefillFactory::instance()->notify_merchant(1,false);
-    }
-}

+ 81 - 0
test/TestRefillThird.php

@@ -0,0 +1,81 @@
+<?php
+
+
+use PHPUnit\Framework\TestCase;
+use refill\lingzhdl\config;
+
+define('APP_ID', 'test');
+define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
+
+require_once(BASE_ROOT_PATH . '/global.php');
+require_once(BASE_CORE_PATH . '/lrlz.php');
+require_once(BASE_ROOT_PATH . '/fooder.php');
+require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
+
+class TestRefillThird extends TestCase
+{
+    public static function setUpBeforeClass(): void
+    {
+        Base::run_util();
+    }
+
+    public function testProvider()
+    {
+        $provider = new refill\ProviderManager();
+        $provider->load();
+    }
+
+    public function testAddthird()
+    {
+
+    }
+
+    public function testPushThird()
+    {
+        $params = [ 'mchid' => 9618,
+            'buyer_id' => 6,
+            'amount' => refill\util::ThirdRefillAmount,
+            'mch_order' => $this->make_sn(),
+            'notify_url' => '',
+            'org_quality' => 1,
+            'card_type' => mtopcard\ThirdRefillCard,
+            'card_no' => '403149064',
+            'product_code' => 'LZ100744',
+            'quantity' => 5,
+            'third_card_type' => 1
+        ];
+
+        $ret = refill\util::push_addthird($params);
+    }
+
+    private function make_sn()
+    {
+        return mt_rand(1000, 9999)
+            . sprintf('%010d', time())
+            . sprintf('%06d', (float)microtime() * 1000000);
+    }
+
+    private function params($card_no,$card_type,$quantity,$pcode,$order_sn)
+    {
+        $params['act'] = 'lzrefill';
+        $params['op'] = 'add_third';
+        $params['notifyurl'] = config::NOTIFY_URL;
+        $params['usr'] = config::USR;
+
+        $params['card_no'] = $card_no;
+        $params['quantity'] = $quantity;
+        $params['product_code'] = $pcode;
+        $params['card_type'] = $card_type;
+
+        $params['ord'] = $order_sn;
+        $params['tim'] = date("YmdHis");
+        $params['yysid'] = 0;
+        $params['hmlx'] = 0;
+        return $params;
+    }
+
+    public function testInstance()
+    {
+        refill\RefillFactory::instance()->notify_merchant(1,false);
+    }
+}