mReqHost = BASE_SITE_URL; $this->mMchid = 1; $this->mKey = '1ff02223b771c0414468c8892151c602'; } elseif (self::CurrentTest == self::HomeCuda) { $this->mReqHost = 'http://192.168.3.104'; $this->mMchid = 1092; $this->mKey = '210fe406954220f56085997d6a4c5b80'; } } public static function setUpBeforeClass() : void { Base::run_util(); } private function requrl() { return $this->mReqHost . "/mobile/index.php"; } public function testAdd() { $phone = '13911129867'; $amount = 100; $url = $this->requrl(); $order_sn = $this->make_sn(); $order_sn = ' smsasdadad23'; $params = ['mchid' => $this->mMchid, 'cardno' => $phone, 'amount' => $amount, "act" => "refill", "op" => "add", 'order_sn' => $order_sn, 'notifyurl' => "http://www.baidu.com"]; $proxy = new refill_proxy($this->mKey); for ($i = 0; $i < 10; $i++) { $resp = $proxy->send($url, $params); Log::record("resp={$resp}", Log::DEBUG); } } public function testCardQuery() { $phone = '13911129867'; // $url = "https://test.xyzshops.cn/vapi/index.php"; $url = "https://ylapi.xyzshops.cn/vapi/index.php"; $params = ['mchid' => $this->mMchid, 'cardno' => $phone, "act" => "card", "op" => "query"]; $proxy = new refill_proxy($this->mKey); $resp = $proxy->send($url, $params); } private function make_sn() { return mt_rand(1000, 9999) . sprintf('%010d', time()) . sprintf('%06d', (float)microtime() * 1000000); } public function testMicroTime() { [$micro,$time] = explode(' ',microtime()); } }