TestRefill.php 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. use const mtopcard\SinopecCard;
  4. define('APP_ID', 'test');
  5. define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
  6. require_once(BASE_ROOT_PATH . '/global.php');
  7. require_once(BASE_CORE_PATH . '/lrlz.php');
  8. require_once(BASE_ROOT_PATH . '/fooder.php');
  9. require_once(BASE_CORE_PATH . '/framework/function/http.php');
  10. require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
  11. require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
  12. const LocalTest = 1;
  13. const NetTest = 2;
  14. const CurrentTest = LocalTest;
  15. class TestRefill extends TestCase
  16. {
  17. private $mReqHost;
  18. private $mKey;
  19. private $mMchid;
  20. public function __construct(?string $name = null, array $data = [], $dataName = '')
  21. {
  22. parent::__construct($name, $data, $dataName);
  23. if (CurrentTest == LocalTest) {
  24. $this->mReqHost = BASE_SITE_URL;
  25. $this->mMchid = 1;
  26. $this->mKey = '1ff02223b771c0414468c8892151c602';
  27. } else {
  28. // $this->mReqHost = 'https://www.xyzshops.cn';
  29. $this->mReqHost = 'http://121.89.196.45';
  30. $this->mMchid = 1092;
  31. $this->mKey = '210fe406954220f56085997d6a4c5b80';
  32. }
  33. }
  34. public static function setUpBeforeClass(): void
  35. {
  36. Base::run_util();
  37. refill\RefillFactory::instance();
  38. }
  39. public function testFactory()
  40. {
  41. $providers = refill\RefillFactory::instance();
  42. }
  43. private function make_sn()
  44. {
  45. return mt_rand(1000, 9999)
  46. . sprintf('%010d', time())
  47. . sprintf('%06d', (float)microtime() * 1000000);
  48. }
  49. public function testRandomMobile()
  50. {
  51. $no = "1" . mt_rand(1, 9999999999);
  52. Log::record("phone no={$no}",Log::DEBUG);
  53. }
  54. public function testBJBAddPhone()
  55. {
  56. $providers = new refill\bjb\RefillPhone([]);
  57. for ($i = 3; $i > 0; --$i) {
  58. $resp = $providers->add(13911129867, 4, 10, ['order_sn' => $this->make_sn()]);
  59. $resp = $providers->add(18500608333, 4, 10, ['order_sn' => $this->make_sn()]);
  60. $resp = $providers->add(18510683168, 4, 10, ['order_sn' => $this->make_sn()]);
  61. $resp = $providers->add(18513846008, 4, 10, ['order_sn' => $this->make_sn()]);
  62. $resp = $providers->add(18518237398, 4, 10, ['order_sn' => $this->make_sn()]);
  63. }
  64. }
  65. public function testOilticket()
  66. {
  67. $providers = new refill\bjb\RefillPhone([]);
  68. }
  69. public function testBjbRet()
  70. {
  71. $resp = '0|提交成功|14936.8600';
  72. $resp = explode('|' , $resp);
  73. }
  74. public function testIpWhiteList()
  75. {
  76. $x = serialize(['47.99.57.105']);
  77. $ips = unserialize('a:1:{i:0;s:12:"47.99.57.105";}');
  78. if (!empty($ips)) {
  79. $addr = '47.99.57.105';
  80. Log::record("request ip:{$addr}", Log::DEBUG);
  81. if (!in_array($addr, $ips)) {
  82. throw new Exception("请求地址不在白名单中");
  83. }
  84. }
  85. }
  86. public function testBaizePhone()
  87. {
  88. $providers = new refill\baizeyd\RefillPhone([]);
  89. // $resp = $providers->add(17801048874, 5, 10, ['order_sn' => $this->make_sn()]);
  90. $resp = $providers->query(['order_sn' => '930668700375312006']);
  91. // $str = 'amount=10.00&orderId=720668384771999671&phone=13911129867&payTime=2021-03-06+22%3A26%3A12&sign=94dfe83221f7768650e70cce08879b60&appKey=uECmTOFAY6RPCTtI&payUrl=&statusDes=%E6%94%AF%E4%BB%98%E5%A4%B1%E8%B4%A5&status=7';
  92. // $input = $this->parse_request($str);
  93. // $input['amount'] = 10.00;
  94. // $input['orderId'] = '92391614943913061206';
  95. // $input['phone'] = 17801048874;
  96. // $input['payTime'] = '2021-03-05 19:31:55';
  97. // $input['sign'] = 'bef6ae50319fb1e8cb3f21302f0abef8';
  98. // $input['appKey'] = 'uECmTOFAY6RPCTtI';
  99. // $input['payUrl'] = '';
  100. // $input['statusDes'] = '支付失败';
  101. // $input['status'] = 7;
  102. // refill\RefillFactory::instance()->notify('baizeyd',$input);
  103. }
  104. private function parse_request($squery)
  105. {
  106. if(empty($squery)) return [];
  107. $result = [];
  108. $params = preg_split('/&/', $squery);
  109. foreach ($params as $pair)
  110. {
  111. if(empty($pair)) continue;
  112. $kv = explode('=', $pair);
  113. $count = count($kv);
  114. if($count === 1) {
  115. $key = $kv[0];
  116. $val = "";
  117. }
  118. elseif($count === 2) {
  119. $key = $kv[0];
  120. $val = urldecode($kv[1]);
  121. }
  122. else {
  123. continue;
  124. }
  125. if(!empty($key)) {
  126. $result[$key] = $val;
  127. }
  128. }
  129. return $result;
  130. }
  131. public function testAmPhone()
  132. {
  133. // $providers = new refill\aming\RefillPhone([]);
  134. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  135. $input['result'] = 'fail';
  136. $input['msg'] = 0;
  137. $input['order'] = 'null';
  138. $input['phone_no'] = 18500608333;
  139. $input['sign'] = 'c925ad19c63c3eb36ffc52d938e24604';
  140. $input['amount'] = '10.00';
  141. $input['op_no'] = '42601615096072517841';
  142. refill\RefillFactory::instance()->notify('aming',$input);
  143. }
  144. public function testBhcPhone()
  145. {
  146. $providers = new refill\binghc\RefillPhone([]);
  147. $resp = $providers->query(['order_sn' => 250668618955902006]);
  148. // $input['result'] = 'fail';
  149. // $input['msg'] = 0;
  150. // $input['order'] = 'null';
  151. // $input['phone_no'] = 18500608333;
  152. // $input['sign'] = 'c3aa38ee07cd1b69bfd5ead56f6da8d6';
  153. // $input['amount'] = '10.00';
  154. // $input['op_no'] = '24061615096361999002';
  155. // refill\RefillFactory::instance()->notify('binghc',$input);
  156. }
  157. public function testRuishunPhone()
  158. {
  159. // $providers = new refill\ruishun\RefillPhone([]);
  160. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  161. $input['result'] = 'fail';
  162. $input['msg'] = 0;
  163. $input['order'] = null;
  164. $input['phone_no'] = 18500608333;
  165. $input['sign'] = 'e234f7d1c0458ca236f53a0008436b46';
  166. $input['amount'] = "10.00";
  167. $input['op_no'] = '76361615095403188513';
  168. refill\RefillFactory::instance()->notify('ruishun',$input);
  169. }
  170. public function testWuchenPhone()
  171. {
  172. $providers = new refill\wuchen\RefillPhone([]);
  173. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  174. $resp = $providers->query(['order_sn' => '790668630498425006']);
  175. // $input['app_id'] = '70016';
  176. // $input['message'] = 'fail';
  177. // $input['order_sn'] = '43101615277293035501';
  178. // $input['platform_order_id'] = '';
  179. // $input['sign'] = '5ea59f8ac51a518f2c622824d7db2a04';
  180. // $input['state'] = "fail";
  181. // $input['sys_sn'] = '202103091608231836913889';
  182. // $input['timestamp'] = '1615277361';
  183. // refill\RefillFactory::instance()->notify('wuchen',$input);
  184. }
  185. public function testYibaoPhone()
  186. {
  187. $providers = new refill\yibao\RefillPhone([]);
  188. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  189. $resp = $providers->query(['ch_trade_no' => '31215002972142736']);
  190. // $str = '{"amount":"30","carrierOrderNo":null,"mobile":"13699279618","orderNo":"27961615532426088043","orderStatus":3,"sign":"012BA0B093A0473D7DD1634A8356DCB1","tradeNo":"31215002972142736"}';
  191. // $data = json_decode($str,true);
  192. // refill\RefillFactory::instance()->notify('yibao',$data);
  193. }
  194. public function testAmingydPhone()
  195. {
  196. $providers = new refill\amingyd\RefillPhone([]);
  197. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  198. $resp = $providers->query(['order_sn' => '15421615627436792938']);
  199. // $str = '{"orderId":"15421615627436792938","amount":3000,"appKey":"40695059","timestamp":1615627503,"status":3,"operatorId":"508353854027968617","sign":"2A0562319ED4845AB9E3812A58F0B425"}';
  200. // $data = json_decode($str,true);
  201. // refill\RefillFactory::instance()->notify('amingyd',$data);
  202. }
  203. public function testChukaPhone()
  204. {
  205. $providers = new refill\chuka\RefillPhone([]);
  206. // $resp = $providers->add('18500608333', 5, 20, ['order_sn' => $this->make_sn()]);
  207. // $resp = $providers->query(['order_sn' => '92161616314884175179']);
  208. $params['customerId'] = '101787';
  209. $params['orderno'] = 'C1616314888506705492';
  210. $params['tmporder'] = '92161616314884175179';
  211. $params['code'] = '1';
  212. $params['number'] = '18500608333';
  213. $params['money'] = '20';
  214. $params['amount'] = '0';
  215. refill\RefillFactory::instance()->notify('chuka',$params);
  216. }
  217. public function testTongyPhone()
  218. {
  219. $providers = new refill\tongy\RefillPhone([]);
  220. $resp = $providers->add('18500608333', 5, 30, ['order_sn' => $this->make_sn()]);
  221. }
  222. public function testWeiyiPhone()
  223. {
  224. $providers = new refill\weiyi\RefillPhone([]);
  225. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  226. // $resp = $providers->query(['order_sn' => '59031616396534854303']);
  227. // $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"}';
  228. // $params = json_decode($body , true);
  229. // refill\RefillFactory::instance()->notify('weiyi',$params);
  230. }
  231. public function testTongluPhone()
  232. {
  233. $providers = new refill\tonglu\RefillPhone([]);
  234. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  235. $resp = $providers->query(['order_sn' => '22961616468561936356']);
  236. // $body = '{"order_no":"22961616468561936356","order_status":"5","phone_no":"18500608333","amount":5000,"time_paid":1616468856287,"order_cert_no":"","paid":false,"order_id":"20210323966497008"}';
  237. // $sign = '9E41F52F612D60EBB654B3A5D1E2F1E5';
  238. // $params = json_decode($body , true);
  239. // $params['sign'] = $sign;
  240. // refill\RefillFactory::instance()->notify('tonglu',$params);
  241. }
  242. public function testAmingjd()
  243. {
  244. // $providers = new refill\amingjd\RefillPhone([]);
  245. // $resp = $providers->add(13699279618, 5, 30, ['order_sn' => $this->make_sn()]);
  246. // $resp = $providers->query(['order_sn' => '42301616475989518588']);
  247. $body = '{"order_id":"83321616478215494884","mchid":"10003","tel":"13699279618","price":"30.00","sign":"01c49620c155a80bc43cecc2b1651868","status":"0","out_order_id":"0"}';
  248. $params = json_decode($body , true);
  249. refill\RefillFactory::instance()->notify('amingjd',$params);
  250. }
  251. public function testPrice()
  252. {
  253. $amounts = [10,20,30,50,100,200,300,500];
  254. $rate = 0.94;
  255. foreach ($amounts as $amount){
  256. $price[] = $amount * $rate;
  257. }
  258. }
  259. public function testWeisPhone()
  260. {
  261. $providers = new refill\weisyd\RefillPhone([]);
  262. $resp = $providers->add(17801048874, 4, 10, ['order_sn' => $this->make_sn()]);
  263. }
  264. public function testXcPhone()
  265. {
  266. $providers = new refill\xc\RefillPhone([]);
  267. $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  268. }
  269. public function testAfandPhone()
  270. {
  271. $providers = new refill\afand\RefillPhone([]);
  272. // for ($i = 3; $i > 0; --$i) {
  273. $resp = $providers->query(['order_sn' => '540668612768904780']);
  274. // }
  275. }
  276. public function testAfandengPhone()
  277. {
  278. $providers = new refill\afandeng\RefillPhone([]);
  279. for ($i = 5; $i > 0; --$i) {
  280. $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  281. }
  282. // $resp = $providers->query(['order_sn' => '20941616115610023539']);
  283. // $params['usr'] = 'afandeng';
  284. // $params['ord'] = '20941616115610023539';
  285. // $params['state'] = '2';
  286. // $params['bz'] = '';
  287. // $params['sgn'] = 'BA2C9D379C3EB648A0B7AAB3A21A3F6A';
  288. // refill\RefillFactory::instance()->notify('afandeng',$params);
  289. }
  290. public function testLingzhPhone()
  291. {
  292. $providers = new refill\lingzh\RefillPhone([]);
  293. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  294. // $resp = $providers->query(['order_sn' => '59911615124025101286']);
  295. $resp = $providers->balance();
  296. // $input['usr'] = 1;
  297. // $input['ord'] = '52741615119546453690';
  298. // $input['bz'] = '';
  299. // $input['state'] = 2;
  300. // $input['sgn'] = 'FFCBB75C307154DD306F4EC75BB69A6D';
  301. // refill\RefillFactory::instance()->notify('lingzh',$input);
  302. }
  303. public function testAfandnewPhone()
  304. {
  305. $providers = new refill\afandnew\RefillPhone([]);
  306. $resp = $providers->query(['order_sn' => '54481615109732967195']);
  307. // $input['order_id'] = '54481615109732967195';
  308. // $input['mchid'] = 10002;
  309. // $input['tel'] = 13699279618;
  310. // $input['price'] = '30.00';
  311. // $input['status'] = 0;
  312. // $input['out_order_id'] = '0';
  313. // $input['sign'] = '26b0baef38daba7f423da23bfe56e3e0';
  314. // refill\RefillFactory::instance()->notify('afandnew',$input);
  315. }
  316. public function testYifaPhone()
  317. {
  318. $providers = new refill\yifa\RefillPhone([]);
  319. $resp = $providers->add(15120035568, 5, 50, ['order_sn' => $this->make_sn()]);
  320. }
  321. public function testTianjtOil()
  322. {
  323. $cardno = 1000111100021211884;
  324. $providers = new refill\tianjt\RefillOil([]);
  325. $resp = $providers->add($cardno, 2, 500, ['order_sn' => $this->make_sn()]);
  326. }
  327. public function testWeitPhone()
  328. {
  329. $providers = new refill\weit\RefillPhone([]);
  330. for ($i = 0;$i<=10;$i++){
  331. $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  332. }
  333. }
  334. public function testWeitCB()
  335. {
  336. $params['sign'] = 'af820c33472f4b571fa0c48483dfb975';
  337. $params['status'] = 0;
  338. $params['price'] = 30;
  339. $params['op_order_id'] = '';
  340. $params['mch_order_id'] = '900664281823957221';
  341. $params['pt_order_id'] = '2021011802434412825405218901';
  342. $params['pay_type'] = '';
  343. $params['tel'] = 18500608333;
  344. $params['mchid'] = 10014;
  345. $resp = http_request($this->mReqHost . "/mobile/refill_weit.php", $params , 'POST');
  346. }
  347. public function testYifaCB()
  348. {
  349. $body = '{"app_id":"e4a61b2acf1119c72c1ed9b61781494e","nonce_str":"OQMEBRQWJGPKOWYUXDVPTNMLEQJHXFWG","timestamp":1610275083,"order_sn":"161027325773032634","coder_order_sn":"60641610273255214687","isp_order_sn":null,"phone":"15120035568","amount":"94.000","discount":"0.9400","create_time":"2021-01-10 18:07:42","recharge_time":"","status":"fail","channel_id":3,"sign":"47278AD74EFA7F5FC8DE3A6D362C409B"}';
  350. $input = json_decode($body,true);
  351. refill\RefillFactory::instance()->notify('yifa',$input);
  352. }
  353. public function testBjbQuery()
  354. {
  355. $providers = new refill\bjb\RefillPhone([]);
  356. $refill_info = ['order_sn' => 110667993758599771, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  357. $resp = $providers->query($refill_info);
  358. }
  359. public function testXcQuery()
  360. {
  361. $providers = new refill\xc\RefillPhone([]);
  362. $refill_info = ['order_sn' => 950663423236726632, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  363. $resp = $providers->query($refill_info);
  364. }
  365. public function testTianjtQuery()
  366. {
  367. $providers = new refill\tianjt\RefillOil([]);
  368. $refill_info = ['order_sn' => 680665862267622221, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  369. $resp = $providers->query($refill_info);
  370. }
  371. public function testSaihuOil()
  372. {
  373. $providers = new refill\saihu\RefillOil([]);
  374. $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
  375. }
  376. public function testBdtOil()
  377. {
  378. $providers = new refill\bdt\RefillOil([]);
  379. $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => '200229600556618886']);
  380. }
  381. public function testGFTDOil()
  382. {
  383. $providers = new refill\gftd\RefillOil([]);
  384. $resp = $providers->add(1000111100020445281, mtopcard\SinopecCard, 100, ['order_sn' => $this->make_sn()]);
  385. }
  386. public function testGFTDCB()
  387. {
  388. $data = '{"channelOrderNumber":"79091610959059372019","orderNumber":"GYFL1610959060397001","message":"充值成功","signature":"881036222bd8f067ff47d248c75f4c8d","voucher":"","status":101}';
  389. $url = "http://192.168.1.220/mobile/refill_gftd.php?" . $data;
  390. $resp = http_post_data($url, $data, ['Content-Type: application/json;charset=UTF-8;','Accept:application/json;charset=UTF-8;']);
  391. }
  392. public function testJiecPhone()
  393. {
  394. $providers = new refill\jiec\RefillPhone([]);
  395. $resp = $providers->add('18500608333', 5, 30, ['order_sn' => $this->make_sn()]);
  396. }
  397. public function testBxtwtCB()
  398. {
  399. $data = '{"order_number":18219726,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"863b4d972f2a4d39a9af7396879116c4","voucher":"","vouchertype":"","voucherurl":"","tradeNo":"100662475851197741"}';
  400. }
  401. public function testTianjtJDVerify()
  402. {
  403. $data = 'onlystr=920661883198026632&sign=533151e3f0dff5f507786aabc37b18f7&amt=100&notifyurl=https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_tianjt.php&jdno&cardtype=Sinoepc&batchid=26106&cardno=1000111100020654226&orgid=1590993600&status=3';
  404. $url = "http://192.168.1.220/mobile/refill_tianjt.php?" . $data;
  405. $resp = http_request($url);
  406. }
  407. public function testSuhcPDD()
  408. {
  409. $data = 'onlystr=820663525320005221&pddno&sign=4b1e8645f7541ced34855779448d9d52&amt=100&notifyurl=https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_suhcpdd.php&cardtype=Sinoepc&batchid=3&cardno=1000111100020445281&orgid=1590993600&status=2';
  410. $url = "https://www.xyzshops.cn/mobile/refill_suhcpdd.php?" . $data;
  411. $resp = http_request($url);
  412. }
  413. public function testSuhcTMVerify()
  414. {
  415. $data = 'onlystr=180662473867058221&sign=5ff5f95d54a89e78dbb49923f6b20c08&amt=100&notifyurl=https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_suhctm.php&cardtype=Sinoepc&batchid=3&cardno=1000111100020445281&orgid=1590993600&status=3';
  416. $url = "https://www.xyzshops.cn/mobile/refill_suhctm.php?" . $data;
  417. $resp = http_request($url);
  418. }
  419. public function testBeixtVerify()
  420. {
  421. $data = '{"order_number":18219726,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"863b4d972f2a4d39a9af7396879116c4","voucher":"","vouchertype":"","voucherurl":"","tradeNo":"100662475851197741"}';
  422. $url = "https://www.xyzshops.cn/mobile/refill_bxtwt.php";
  423. $headers = ['Content-Type: application/json'];
  424. $resp = http_post_data($url, $data, $headers);
  425. }
  426. public function testInput()
  427. {
  428. $input = fopen("php://input", "rw");
  429. file_put_contents($input, 'xxxx');
  430. $content = file_get_contents('php://input');
  431. }
  432. public function testUrl()
  433. {
  434. $data = 'onlystr=190661874318128632&sign=9eb60765c356341fd41c9bec6526f46a&amt=1000&notifyurl=https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_suhc.php&jdno&cardtype=Sinoepc&batchid=25940&cardno=1000111100012304048&orgid=1590993600&status=2';
  435. $params = preg_split('/&/', $data);
  436. foreach ($params as $pair) {
  437. $kv = explode('=', $pair);
  438. $count = count($kv);
  439. if ($count === 1) {
  440. $key = $kv[0];
  441. $val = "";
  442. } elseif ($count === 2) {
  443. $key = $kv[0];
  444. $val = $kv[1];
  445. } else {
  446. continue;
  447. }
  448. Log::record("{$key}:{$val}", Log::DEBUG);
  449. }
  450. }
  451. public function testAddoil()
  452. {
  453. $url = $this->mReqHost . "/mobile/index.php";
  454. $notifyurl = 'http://121.89.196.45/mobile/signature.php';
  455. $params = ['mchid' => $this->mMchid,
  456. 'cardno' => '1000111100020445281',
  457. 'amount' => "100",
  458. "act" => "refill",
  459. "op" => "add",
  460. 'order_sn' => $this->make_sn(),
  461. 'notifyurl' => $notifyurl];
  462. $resp = $this->send_md5($url, $params);
  463. Log::record($resp, Log::DEBUG);
  464. }
  465. public function testBalance()
  466. {
  467. $url = $this->mReqHost . "/mobile/index.php";
  468. $params = ['mchid' => 1092,
  469. "act" => "refill",
  470. "op" => "balance"];
  471. $resp = $this->send_md5($url, $params);
  472. Log::record($resp, Log::DEBUG);
  473. }
  474. public function testAddPhoe()
  475. {
  476. $phones = [//13911129867,
  477. 18500608333,
  478. 18510683168,
  479. 18513846008,
  480. 18518237398];
  481. $amount = 10;
  482. for ($i = 0; $i < 3; $i++) {
  483. foreach ($phones as $phone) {
  484. $url = $this->mReqHost . "/mobile/index.php";
  485. $params = ['mchid' => 1092,
  486. 'cardno' => $phone,
  487. 'amount' => $amount,
  488. "act" => "refill",
  489. "op" => "add",
  490. 'order_sn' => $this->make_sn(),
  491. 'notifyurl' => $this->mReqHost . "/mobile/refill_xyz.php"];
  492. $resp = $this->send_md5($url, $params);
  493. Log::record($resp, Log::DEBUG);
  494. }
  495. }
  496. }
  497. public function testProxyHelper()
  498. {
  499. $phone = '13911129867';
  500. $amount = 100;
  501. $url = $this->mReqHost . "/mobile/index.php";
  502. $params = ['mchid' => 1090,
  503. 'cardno' => $phone,
  504. 'amount' => $amount,
  505. "act" => "refill",
  506. "op" => "add",
  507. 'order_sn' => $this->make_sn(),
  508. 'notifyurl' => "https://xxx"];
  509. $proxy = new refill_proxy("xxx");
  510. $resp = $proxy->send($url, $params);
  511. }
  512. public function testGoods()
  513. {
  514. $req_url = $this->mReqHost . '/mobile/index.php';
  515. $params = ['mchid' => $this->mMchid,
  516. "act" => "refill",
  517. "op" => "goods"];
  518. $resp = $this->send_md5($req_url, $params);
  519. }
  520. public function testQueryFactory()
  521. {
  522. refill\RefillFactory::instance()->query(295);
  523. }
  524. public function testQuery()
  525. {
  526. //$req_url = 'https://www.xyzshops.cn/mobile/index.php';
  527. // $notifyurl = 'https://www.xyzshops.cn/mobile/signature.php';
  528. $req_url = BASE_SITE_URL . '/mobile/index.php';
  529. $notifyurl = 'https://www.xyzshops.cn/mobile/signature.php';
  530. $params = ['mchid' => 1,
  531. "act" => "refill",
  532. "op" => "query",
  533. 'order_sn' => "13281476"];
  534. $resp = $this->send_md5($req_url, $params);
  535. }
  536. public function testRemoveSession()
  537. {
  538. $resp = http_request(BASE_SITE_URL . "/mobile/signature.php", [], 'POST');
  539. }
  540. public function testTianjtCB()
  541. {
  542. // $notifyurl = BASE_SITE_URL . "/mobile/refill_tianjt.php";
  543. $notifyurl = "https://www.xyzshops.cn/mobile/refill_tianjt.php";
  544. // $notifyurl = "https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_tianjt.php";
  545. $params = ['onlystr' => '690665858589475818',
  546. 'amt' => 1000,
  547. 'jdno' => '',
  548. 'notifyurl' => $notifyurl,
  549. 'cardtype' => 'Sinoepc',
  550. 'batchid' => 30589,
  551. 'cardno' => '1000113300007993287',
  552. 'orgid' => '1590993600',
  553. 'status' => 3];
  554. $sign = $this->md5_sign($params);
  555. $params['sign'] = $sign;
  556. $resp = http_request($notifyurl, $params, 'POST');
  557. Log::record($resp, Log::DEBUG);
  558. }
  559. public function testBJBCB()
  560. {
  561. $params = [
  562. 'usr' => '13699279618',
  563. 'ord' => '710662733975412771',
  564. 'state' => '2',
  565. 'bz' => '',
  566. 'sgn' => 'AC9AFD254DE682D8440A97CA68B992DA'
  567. ];
  568. $resp = http_request("https://www.xyzshops.cn/mobile/refill_bjb.php", $params, 'POST');
  569. }
  570. public function testJiecCB()
  571. {
  572. $params['result'] = 'fail';
  573. $params['msg'] = '0';
  574. $params['order'] = 'null';
  575. $params['phone_no'] = '18500608333';
  576. $params['amount'] = '30.00';
  577. $params['op_no'] = '800663597981819221';
  578. $params['sign'] = '2510046895e8e12322c8a32547905ee9';
  579. $resp = http_request($this->mReqHost . "/mobile/refill_jiec.php", $params, 'POST');
  580. }
  581. public function testZFKJ()
  582. {
  583. //带签名参数:mchid=1090&act=refill&op=add&cardno=100112121212212133
  584. //&amount=10&order_sn=PH2012261356569433&
  585. //notifyurl=https%3A%2F%2Fqzcz.edusahoo.com.cn%2Findex%2Findex%2Fcallback
  586. //&sign=4a3ac5f9706e64aa70c6cab0fc5839d3
  587. $params = ['mchid' => 1090,
  588. 'cardno' => '100112121212212133',
  589. 'amount' => '10',
  590. "act" => "refill",
  591. "op" => "add",
  592. 'order_sn' => 'PH2012261356569433',
  593. 'notifyurl' => 'https://qzcz.edusahoo.com.cn/index/index/callback'];
  594. $resp = $this->send_md5(BASE_SITE_URL . '/mobile/index.php', $params);
  595. }
  596. protected function check_empty($value)
  597. {
  598. if (!isset($value))
  599. return true;
  600. if ($value === null)
  601. return true;
  602. if (trim($value) === "")
  603. return true;
  604. return false;
  605. }
  606. private function md5_sign($params)
  607. {
  608. ksort($params);
  609. $body = "";
  610. $i = 0;
  611. foreach ($params as $k => $v) {
  612. if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
  613. if ($i == 0) {
  614. $body .= "{$k}" . "=" . urldecode($v);
  615. } else {
  616. $body .= "&" . "{$k}" . "=" . urldecode($v);
  617. }
  618. $i++;
  619. }
  620. }
  621. $body .= "&key=7yDCLS6S2KzSAJQOUc3vsa";
  622. return md5($body);
  623. }
  624. public function testCallMech()
  625. {
  626. $logic = Logic('queue');
  627. $logic->NotifyMerchantComplete(['order_id' => 18171,'manual' => true]);
  628. }
  629. //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefill::testCallMech)( .*)?$/" --test-suffix TestRefill.php /var/www/html/test
  630. private function send($url, $params)
  631. {
  632. $mchid = $params['mchid'];
  633. $pri_key = BASE_DATA_PATH . "/api/merchant/key/{$mchid}_pri.pem";
  634. $key = file_get_contents($pri_key);
  635. $pri = openssl_get_privatekey($key);
  636. $body = $this->body($params);
  637. openssl_sign($body, $signed, $pri);
  638. $sign = base64_encode($signed);
  639. $params['sign'] = $sign;
  640. $resp = http_request($url, $params, 'POST');
  641. Log::record("resp:{$resp}", Log::DEBUG);
  642. }
  643. private function send_md5($url, $params)
  644. {
  645. $body = $this->body($params);
  646. $body .= "&key={$this->mKey}";
  647. $params['sign'] = md5($body);
  648. $resp = http_request($url, $params, 'POST');
  649. Log::record("resp:{$resp}", Log::DEBUG);
  650. return $resp;
  651. }
  652. public function testCardType()
  653. {
  654. $cardno = '1000111100021211884';
  655. $ret = preg_match('/^1[0-9]{18}$/', $cardno, $matches);
  656. }
  657. public function testMtrand()
  658. {
  659. }
  660. public function testHttpRefill()
  661. {
  662. $mchid = '000001';
  663. $pri_key = BASE_DATA_PATH . "/api/merchant/key/{$mchid}_pri.pem";
  664. $key = file_get_contents($pri_key);
  665. $pri = openssl_get_privatekey($key);
  666. $params = ['MCHID' => $mchid, 'cardno' => '1000111100021211884', 'amt' => "100", "act" => "refill", "op" => "addoil"];
  667. $body = $this->body($params);
  668. openssl_sign($body, $signed, $pri);
  669. $sign = base64_encode($signed);
  670. $params['sign'] = $sign;
  671. $resp = http_request(BASE_SITE_URL . "/mobile/index.php", $params, 'POST');
  672. }
  673. private function body($params)
  674. {
  675. ksort($params);
  676. $body = "";
  677. $i = 0;
  678. foreach ($params as $k => $v) {
  679. if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) {
  680. if ($i == 0) {
  681. $body .= "{$k}" . "=" . urlencode($v);
  682. } else {
  683. $body .= "&" . "{$k}" . "=" . urlencode($v);
  684. }
  685. $i++;
  686. }
  687. }
  688. return $body;
  689. }
  690. private function checkEmpty($value)
  691. {
  692. if (!isset($value))
  693. return true;
  694. if ($value === null)
  695. return true;
  696. if (trim($value) === "")
  697. return true;
  698. return false;
  699. }
  700. public function testKsort()
  701. {
  702. $age = ["Peter" => "35", "Ben" => "37", "Joe" => "43"];
  703. ksort($age);
  704. foreach ($age as $x => $x_value) {
  705. echo "Key=" . $x . ", Value=" . $x_value;
  706. echo "<br>";
  707. }
  708. }
  709. public function testip()
  710. {
  711. $model_merchant = Model('merchant');
  712. $merchant_info = $model_merchant->getMerchantInfo(['mchid' => 1]);
  713. $ipwhitelist = unserialize($merchant_info['ip_white_list']);
  714. $res = json_encode($ipwhitelist);
  715. }
  716. //测试向内部店提交订单,可先屏蔽其它充值通道
  717. public function testAddoilToInnerStore()
  718. {
  719. $url = $this->mReqHost . "/mobile/index.php";
  720. $notifyurl = BASE_SITE_URL . '/mobile/signature.php';
  721. $params = ['mchid' => 1,
  722. 'cardno' => '1000111100020445281',
  723. 'amount' => "1000",
  724. "act" => "refill",
  725. "op" => "add",
  726. 'order_sn' => $this->make_sn(),
  727. 'notifyurl' => $notifyurl];
  728. $resp = $this->send_md5($url, $params);
  729. Log::record($resp, Log::DEBUG);
  730. }
  731. public function testRefillInnerCB()
  732. {
  733. $params = ['state_type' => 'order_cancel', 'order_id' => 311, 'channel_name' => 'lx'];
  734. $resp = http_request(BASE_SITE_URL . '/mobile/refill_inner.php', $params, 'POST');
  735. }
  736. public function testArgs()
  737. {
  738. Log::record($_SERVER['argv'], Log::DEBUG);
  739. }
  740. public function testCall()
  741. {
  742. $order_id = 14974;
  743. QueueClient::async_push("NotifyMerchantComplete", ['order_id' => $order_id,'manual' => true], 10);
  744. }
  745. public function testSyncconfig()
  746. {
  747. $name_val_cfg = function ($items) {
  748. $result = [];
  749. foreach ($items as $item) {
  750. $name = $item->name();
  751. $result[$name] = $item;
  752. }
  753. return $result;
  754. };
  755. $name_val_row = function ($items) {
  756. $result = [];
  757. foreach ($items as $item) {
  758. $name = $item['name'];
  759. $result[$name] = $item;
  760. }
  761. return $result;
  762. };
  763. $match = function ($all,$cur)
  764. {
  765. $insert = [];
  766. foreach ($all as $key => $value)
  767. {
  768. if(!array_key_exists($key,$cur)) {
  769. $insert[] = $key;
  770. }
  771. }
  772. return $insert;
  773. };
  774. $inserter = function ($mod,$type,$names)
  775. {
  776. foreach ($names as $name) {
  777. $data = ['name' => $name,'type' => $type];
  778. $mod->insert($data);
  779. }
  780. };
  781. $providers = refill\RefillFactory::instance()->providers();
  782. $oils = $name_val_cfg($providers['oil']);
  783. $phones = $name_val_cfg($providers['phone']);
  784. $mod_prov = Model('refill_provider');
  785. $oil_items = $mod_prov->getProviderList(['type' => 1]);
  786. $oil_items = $name_val_row($oil_items);
  787. $oil_inserts = $match($oils,$oil_items);
  788. $phone_items = $mod_prov->getProviderList(['type' => 2]);
  789. $phone_items = $name_val_row($phone_items);
  790. $phone_inserts = $match($phones,$phone_items);
  791. $inserter($mod_prov,1,$oil_inserts);
  792. $inserter($mod_prov,2,$phone_inserts);
  793. }
  794. public function testStat()
  795. {
  796. $model_refill_order = Model('refill_order');
  797. $stat = Model('')->table('refill_order,vr_order')->join('inner')
  798. ->on('refill_order.order_id=vr_order.order_id')
  799. ->field('sum(refill_amount) as refill_amounts , sum(channel_amount) as channel_amounts , sum(mch_amount) as mch_amounts')
  800. ->where([])->select();
  801. }
  802. public function testRefillGoods()
  803. {
  804. $goods = refill\RefillFactory::instance()->goods();
  805. }
  806. private function make_mobile()
  807. {
  808. $no = "1" . mt_rand(3000000000, 3999999999);
  809. return $no;
  810. }
  811. private function refill_info($card_no, $card_type)
  812. {
  813. $data = rcache($card_no, 'cardrefill-');
  814. if(empty($data))
  815. {
  816. $mod_topcard = Model('topcard');
  817. $ret = $mod_topcard->get_card($card_no);
  818. if(empty($ret)) {
  819. $bind_phone = $this->make_mobile();
  820. $mod_topcard->add($card_no,$card_type,time(),$bind_phone);
  821. $data['bind_phone'] = $bind_phone;
  822. $data['refill_time'] = time();
  823. $data['times'] = 0;
  824. wcache($card_no,$data,'cardrefill-');
  825. }
  826. else {
  827. $val = $ret[0];
  828. $data['bind_phone'] = $val['bind_phone'];
  829. $data['refill_time'] = time();
  830. $data['times'] = 0;
  831. }
  832. }
  833. return $data;
  834. }
  835. public function testGetMobile()
  836. {
  837. $card_no = '1000119000001679247';
  838. $card_type = 1;
  839. $info = $this->refill_info($card_no,$card_type);
  840. }
  841. private function check_mchorder($mchid,$mch_order)
  842. {
  843. if(empty($mch_order)) {
  844. return true;
  845. }
  846. else {
  847. $refill_order = Model('refill_order');
  848. $ret = $refill_order->getOrderInfo(['mchid' => $mchid,'mch_order' => $mch_order]);
  849. return empty($ret);
  850. }
  851. }
  852. public function testCheckMchorder()
  853. {
  854. $ret = $this->check_mchorder(1,'13281475');
  855. }
  856. public function testMakemobile()
  857. {
  858. $mobile = refill\util::make_mobile();
  859. $ret = refill\util::set_black('1000111100020445281');
  860. }
  861. public function testLoadBlack()
  862. {
  863. $path = BASE_DATA_PATH . "/log";
  864. $names = ['20210119-mobile.log',
  865. '20210120-mobile.log','20210121-mobile.log','20210122-mobile.log','20210123-mobile.log',
  866. '20210124-mobile.log','20210125-mobile.log'];
  867. foreach ($names as $name)
  868. {
  869. $file_name = $path . "/" . $name;
  870. refill\util::black_from_log($file_name);
  871. }
  872. }
  873. public function testStats()
  874. {
  875. $date = date('Y-m-d',time());
  876. $today = strtotime("{$date}");
  877. $times_begin = function ($start) {
  878. $times = [];
  879. $begin = $start;
  880. for($i = 0; $i < 7; $i++) {
  881. $times[] = $begin;
  882. $begin -= 86400;
  883. }
  884. return $times;
  885. };
  886. $reader = function ($mchid,$time) {
  887. $cond['mchid'] = $mchid;
  888. $cond['inner_status'] = 0;
  889. $cond['refill_order.order_time'] = ['between', [$time, $time + 86400 -1]];
  890. $items = Model('')->table('refill_order,vr_order')->join('inner')
  891. ->on('refill_order.order_id=vr_order.order_id')
  892. ->field('count(*) as order_count, vr_order.order_state, sum(mch_amount) as mch_amounts')
  893. ->group('vr_order.order_state')
  894. ->where($cond)->select();
  895. return $items;
  896. };
  897. $begins = $times_begin($today);
  898. $mchid = 10096;
  899. // $states = rcache($this->mchid() , 'refillstat-');
  900. $states = unserialize($states ?? "");
  901. if(empty($states)) $states = [];
  902. $result = [];
  903. $cache = [];
  904. foreach ($begins as $begin)
  905. {
  906. if(array_key_exists($begin,$states)) {
  907. $item = $states[$begin];
  908. }
  909. else {
  910. $item = $reader($mchid,$begin);
  911. }
  912. $result[$begin] = $item;
  913. //判断item 中充值中的状态是否为0,为0的情况下放进cache
  914. $cache = $item;
  915. }
  916. wcache($this->mchid() ,$cache, 'refillstat-');
  917. return $result;
  918. }
  919. public function testNotifyx()
  920. {
  921. $mch_cache = rcache("merchant-notify" , 'refill-');
  922. $caches = empty($mch_cache['data']) ? [] : unserialize($mch_cache['data']);
  923. $new_caches = [];
  924. $merchants = Model('merchant')->getMerchantList([],'','','merchant.*,member.available_predeposit' ,"0,1000");
  925. foreach ($merchants as $merchant)
  926. {
  927. $mchid = $merchant['mchid'];
  928. $phone = $merchant['contact_phone'] ?? "";
  929. $available_pd = intval($merchant['available_predeposit']);
  930. $alarm_pd = intval($merchant['alarm_amount']) < 10000 ? 10000 : intval($merchant['alarm_amount']);
  931. if(array_key_exists($mchid,$caches)) {
  932. $mch_cache = $caches[$mchid];
  933. }
  934. else {
  935. $mch_cache = ['last_time' => 0, 'send_count' => 0];
  936. }
  937. if(!empty($phone) && ($available_pd < $alarm_pd))
  938. {
  939. $counts = $mch_cache['send_count'];
  940. if(($mch_cache['last_time'] + 300 < time()) && $counts < 5) {
  941. $mch_cache = ['last_time' => time(), 'send_count' => $counts + 1];
  942. QueueClient::push('sendSMS', ['mobile'=>$merchant['contact_phone'],
  943. 'type'=>'balance_warning','datas' => [date("m月d日H时") , $merchant['available_predeposit']]]);
  944. }
  945. }
  946. else {
  947. $mch_cache = ['last_time' => 0, 'send_count' => 0];
  948. }
  949. $new_caches[$mchid] = $mch_cache;
  950. }
  951. wcache("merchant-notify", ['data' => serialize($new_caches)], 'refill-');
  952. }
  953. public function testReadChannel()
  954. {
  955. refill\RefillFactory::instance()->read_channel();
  956. }
  957. public function testAllow()
  958. {
  959. $allow = refill\RefillFactory::instance()->allow(10096,1,100);
  960. }
  961. public function testCheckData(){
  962. $str = '|2|110667993758599771-充值失败|';
  963. // $str = '0|提交成功|-36557.7400';
  964. // if(preg_match( '/^-*[0-9]{1,3}\|[\x{4e00}-\x{9fa5}]+\|-*[0-9]+\.*[0-9]+$/u',$str,$matches)) {
  965. // return true;
  966. // }
  967. // if(preg_match('/^[0-3]\|[0-9]+-*[\x{4e00}-\x{9fa5}]+\|[0-9]*$/u',$str,$matches)){
  968. // return true;
  969. // }
  970. // return false;
  971. $resp = ltrim($str , '|');
  972. $resp = explode('|' , $resp);
  973. if(count($resp) != 3) {
  974. return [false,'返回值错误'];
  975. }
  976. }
  977. public function testErrre()
  978. {
  979. $line = '[13 2021-01-24 16:07:03] DEBUG: type = application/json;charset=utf-8, content={"channelOrderNumber":"610664819621371793","orderNumber":"GYFL1611475621525437","message":"充值失败","signature":"6c28c15b9ce2b2243742ecebbd929ac5","status":109}';
  980. $ret = preg_match('/[\w\W]+"channelOrderNumber":"(?P<order_sn>[^"]+)"[\w\W]+"message":"(?P<message>[\x{4e00}-\x{9fa5}]+)"[\w\W]+"status":109/u',$line,$matches);
  981. }
  982. public function testLog()
  983. {
  984. // $line = './LOG/20210203-mobile.log:[15 2021-02-03 10:41:17] SQL: UPDATE `lrlz_member` SET available_predeposit=available_predeposit+975 WHERE ( member_id = \'65818\' ) [ RunTime:0.000297s ]';
  985. $fn = fopen(BASE_ROOT_PATH . "/10096.log","r");
  986. $mod = Model();
  987. $mod->table('tfloat')->where(['member_id' => 65818])->update( ['pdamount'=>0]);
  988. $total_amount = ncPriceFormat(0.00);
  989. $i = 0;
  990. while(! feof($fn)) {
  991. $i++;
  992. $line = trim(fgets($fn));
  993. $ret = preg_match('/[\w\W]+UPDATE[\w\W]+available_predeposit=available_predeposit(?P<oper>[-+]+)(?P<amount>[.\d]+)/i',$line,$matches);
  994. if($ret) {
  995. $oper = $matches['oper'];
  996. $amount = $matches['amount'];
  997. if($oper == '-') {
  998. $total_amount = ncPriceFormat($total_amount) - ncPriceFormat($amount);
  999. // $mod->table('tfloat')->where(['member_id' => 65818])->update( ['pdamount'=>['exp','pdamount-'.$amount]]);
  1000. }
  1001. else {
  1002. $total_amount = ncPriceFormat($total_amount) + ncPriceFormat($amount);
  1003. // $mod->table('tfloat')->where(['member_id' => 65818])->update( ['pdamount'=>['exp','pdamount+'.$amount]]);
  1004. }
  1005. Log::record("index = {$i} {$total_amount} = {$total_amount} {$oper} {$amount}",Log::DEBUG);
  1006. }
  1007. }
  1008. Log::record("total_amount:{$total_amount}",Log::DEBUG);
  1009. fclose($fn);
  1010. }
  1011. public function testMchctl()
  1012. {
  1013. $ctl = new refill\mchctl();
  1014. }
  1015. }
  1016. //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefill::testLoadBlack)( .*)?$/" --test-suffix TestRefill.php /var/www/html/test
  1017. //docker-compose -f ./docker-compose-dev.yml run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefill::testCall)( .*)?$/" --test-suffix TestRefill.php /var/www/html/test