TestRefill.php 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. use const mtopcard\ProvinceList;
  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 = NetTest;
  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 testMerchantPrice()
  40. {
  41. $price = new refill\merchant_price();
  42. }
  43. public function testCallBack()
  44. {
  45. }
  46. public function testFactory()
  47. {
  48. $providers = refill\RefillFactory::instance();
  49. }
  50. private function make_sn()
  51. {
  52. return mt_rand(1000, 9999)
  53. . sprintf('%010d', time())
  54. . sprintf('%06d', (float)microtime() * 1000000);
  55. }
  56. public function testRandomMobile()
  57. {
  58. $no = "1" . mt_rand(1, 9999999999);
  59. Log::record("phone no={$no}", Log::DEBUG);
  60. }
  61. public function testBJBAddPhone()
  62. {
  63. $providers = new refill\bjb\RefillPhone([]);
  64. for ($i = 3; $i > 0; --$i) {
  65. $resp = $providers->add(13911129867, 4, 10, ['order_sn' => $this->make_sn()]);
  66. $resp = $providers->add(18500608333, 4, 10, ['order_sn' => $this->make_sn()]);
  67. $resp = $providers->add(18510683168, 4, 10, ['order_sn' => $this->make_sn()]);
  68. $resp = $providers->add(18513846008, 4, 10, ['order_sn' => $this->make_sn()]);
  69. $resp = $providers->add(18518237398, 4, 10, ['order_sn' => $this->make_sn()]);
  70. }
  71. }
  72. public function testOilticket()
  73. {
  74. $providers = new refill\bjb\RefillPhone([]);
  75. }
  76. public function testBjbRet()
  77. {
  78. $resp = '0|提交成功|14936.8600';
  79. $resp = explode('|', $resp);
  80. }
  81. public function testIpWhiteList()
  82. {
  83. $x = serialize(['47.99.57.105']);
  84. $ips = unserialize('a:1:{i:0;s:12:"47.99.57.105";}');
  85. if (!empty($ips)) {
  86. $addr = '47.99.57.105';
  87. Log::record("request ip:{$addr}", Log::DEBUG);
  88. if (!in_array($addr, $ips)) {
  89. throw new Exception("请求地址不在白名单中");
  90. }
  91. }
  92. }
  93. public function testBaizePhone()
  94. {
  95. $providers = new refill\baizeyd\RefillPhone([]);
  96. // $resp = $providers->add(17801048874, 5, 10, ['order_sn' => $this->make_sn()]);
  97. $resp = $providers->query(['order_sn' => '930668700375312006']);
  98. // $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';
  99. // $input = $this->parse_request($str);
  100. // $input['amount'] = 10.00;
  101. // $input['orderId'] = '92391614943913061206';
  102. // $input['phone'] = 17801048874;
  103. // $input['payTime'] = '2021-03-05 19:31:55';
  104. // $input['sign'] = 'bef6ae50319fb1e8cb3f21302f0abef8';
  105. // $input['appKey'] = 'uECmTOFAY6RPCTtI';
  106. // $input['payUrl'] = '';
  107. // $input['statusDes'] = '支付失败';
  108. // $input['status'] = 7;
  109. // refill\RefillFactory::instance()->notify('baizeyd',$input);
  110. }
  111. private function parse_request($squery)
  112. {
  113. if (empty($squery)) return [];
  114. $result = [];
  115. $params = preg_split('/&/', $squery);
  116. foreach ($params as $pair) {
  117. if (empty($pair)) continue;
  118. $kv = explode('=', $pair);
  119. $count = count($kv);
  120. if ($count === 1) {
  121. $key = $kv[0];
  122. $val = "";
  123. } elseif ($count === 2) {
  124. $key = $kv[0];
  125. $val = urldecode($kv[1]);
  126. } else {
  127. continue;
  128. }
  129. if (!empty($key)) {
  130. $result[$key] = $val;
  131. }
  132. }
  133. return $result;
  134. }
  135. public function testAmPhone()
  136. {
  137. // $providers = new refill\aming\RefillPhone([]);
  138. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  139. $input['result'] = 'fail';
  140. $input['msg'] = 0;
  141. $input['order'] = 'null';
  142. $input['phone_no'] = 18500608333;
  143. $input['sign'] = 'c925ad19c63c3eb36ffc52d938e24604';
  144. $input['amount'] = '10.00';
  145. $input['op_no'] = '42601615096072517841';
  146. refill\RefillFactory::instance()->notify('aming', $input);
  147. }
  148. public function testBhcPhone()
  149. {
  150. $providers = new refill\binghc\RefillPhone([]);
  151. $resp = $providers->query(['order_sn' => 250668618955902006]);
  152. // $input['result'] = 'fail';
  153. // $input['msg'] = 0;
  154. // $input['order'] = 'null';
  155. // $input['phone_no'] = 18500608333;
  156. // $input['sign'] = 'c3aa38ee07cd1b69bfd5ead56f6da8d6';
  157. // $input['amount'] = '10.00';
  158. // $input['op_no'] = '24061615096361999002';
  159. // refill\RefillFactory::instance()->notify('binghc',$input);
  160. }
  161. public function testRuishunPhone()
  162. {
  163. // $providers = new refill\ruishun\RefillPhone([]);
  164. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  165. $input['result'] = 'fail';
  166. $input['msg'] = 0;
  167. $input['order'] = null;
  168. $input['phone_no'] = 18500608333;
  169. $input['sign'] = 'e234f7d1c0458ca236f53a0008436b46';
  170. $input['amount'] = "10.00";
  171. $input['op_no'] = '76361615095403188513';
  172. refill\RefillFactory::instance()->notify('ruishun', $input);
  173. }
  174. public function testWuchenPhone()
  175. {
  176. $providers = new refill\wuchen\RefillPhone([]);
  177. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  178. $resp = $providers->query(['order_sn' => '790668630498425006']);
  179. // $input['app_id'] = '70016';
  180. // $input['message'] = 'fail';
  181. // $input['order_sn'] = '43101615277293035501';
  182. // $input['platform_order_id'] = '';
  183. // $input['sign'] = '5ea59f8ac51a518f2c622824d7db2a04';
  184. // $input['state'] = "fail";
  185. // $input['sys_sn'] = '202103091608231836913889';
  186. // $input['timestamp'] = '1615277361';
  187. // refill\RefillFactory::instance()->notify('wuchen',$input);
  188. }
  189. public function testYibaoPhone()
  190. {
  191. $providers = new refill\yibao\RefillPhone([]);
  192. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  193. $resp = $providers->query(['ch_trade_no' => '31215002972142736']);
  194. // $str = '{"amount":"30","carrierOrderNo":null,"mobile":"13699279618","orderNo":"27961615532426088043","orderStatus":3,"sign":"012BA0B093A0473D7DD1634A8356DCB1","tradeNo":"31215002972142736"}';
  195. // $data = json_decode($str,true);
  196. // refill\RefillFactory::instance()->notify('yibao',$data);
  197. }
  198. public function testAmingydPhone()
  199. {
  200. $providers = new refill\amingyd\RefillPhone([]);
  201. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  202. $resp = $providers->query(['order_sn' => '15421615627436792938']);
  203. // $str = '{"orderId":"15421615627436792938","amount":3000,"appKey":"40695059","timestamp":1615627503,"status":3,"operatorId":"508353854027968617","sign":"2A0562319ED4845AB9E3812A58F0B425"}';
  204. // $data = json_decode($str,true);
  205. // refill\RefillFactory::instance()->notify('amingyd',$data);
  206. }
  207. public function testChukaPhone()
  208. {
  209. $providers = new refill\chuka\RefillPhone([]);
  210. // $resp = $providers->add('18500608333', 5, 20, ['order_sn' => $this->make_sn()]);
  211. // $resp = $providers->query(['order_sn' => '92161616314884175179']);
  212. $params['customerId'] = '101787';
  213. $params['orderno'] = 'C1616314888506705492';
  214. $params['tmporder'] = '92161616314884175179';
  215. $params['code'] = '1';
  216. $params['number'] = '18500608333';
  217. $params['money'] = '20';
  218. $params['amount'] = '0';
  219. refill\RefillFactory::instance()->notify('chuka', $params);
  220. }
  221. public function testLegouPhone()
  222. {
  223. $providers = new refill\legou\RefillPhone([]);
  224. // $resp = $providers->add('18500608333', 5, 30, ['order_sn' => '200649600557718881' , 'order_id' => 247 , 'buyer_id' => 52667]);
  225. $resp = $providers->query(['order_sn' => '200649600557718881', 'order_id' => 247]);
  226. $params['username'] = 'lzdc';
  227. $params['orderNumber'] = '690653407667699667';
  228. $params['cardNumber'] = '18500608333';
  229. $params['orderMoney'] = '30.0';
  230. $params['orderPay'] = '1.0';
  231. $params['resultCode'] = '2';
  232. $params['rechargeDesc'] = '{"rechargeStatus":600200,"rechargeDesc":"充值成功"}';
  233. $params['rechargeVoucher'] = '100407307092103291444050244599';
  234. $params['sign'] = 'c054884422a8c3749cbfda0e82b9af70';
  235. // refill\RefillFactory::instance()->notify('legou',$params);
  236. }
  237. public function testFeinimoshu()
  238. {
  239. $providers = new refill\feinimoshu\RefillOil([]);
  240. // $resp = $providers->query(['order_sn' => '3708210680873565742704']);
  241. $resp = $providers->balance();
  242. }
  243. public function testFeinimoshu_hf()
  244. {
  245. $providers = new refill\feinimoshu_hf\RefillPhone([]);
  246. // $resp = $providers->query(['order_sn' => '3708210680873565742704']);
  247. $resp = $providers->balance();
  248. }
  249. public function testFeiniaoPhone()
  250. {
  251. $providers = new refill\feiniao\RefillPhone([]);
  252. // $order_sn = $this->make_sn();
  253. // Log::record($order_sn, Log::DEBUG);
  254. // $resp = $providers->add('13699279618', 4, 50, ['order_sn' => $order_sn]);
  255. $resp = $providers->query(['order_sn' => '28641617178590981824']);
  256. $params['result'] = 'fail';
  257. $params['msg'] = '0';
  258. $params['order'] = 'null';
  259. $params['phone_no'] = '18500608333';
  260. $params['amount'] = '100.00';
  261. $params['op_no'] = '64591617090761169983';
  262. $params['settle'] = '0';
  263. $params['sign'] = '907d2640f96e8d78d59202d090ddb470';
  264. // refill\RefillFactory::instance()->notify('feiniao',$params);
  265. }
  266. public function testTongyPhone()
  267. {
  268. $providers = new refill\tongy\RefillPhone([]);
  269. // $resp = $providers->add('18500608333', 5, 30, ['order_sn' => '690653407667699667', 'order_id' => 248, 'buyer_id' => 52667]);
  270. // $params['UserId'] = '100857';
  271. // $params['ShopId'] = '300000';
  272. // $params['SysOrderId'] = '21070215141210085700010';
  273. // $params['OrderId'] = '9241650678554051429291';
  274. // $params['State'] = '5';
  275. // $params['Timestamp'] = '1625210740472';
  276. // $params['sign'] = 'C5C4E888A3B678470071CDA6DC31719D';
  277. // $params['ParValue'] = '100.0000';
  278. // $params['VoucherType'] = '';
  279. // $params['VoucherContent'] = '';
  280. // $params['CreateTime'] = '2021-07-02 15:14:12';
  281. // $params['CompleteTime'] = '2021-07-02 15:25:40';
  282. // refill\RefillFactory::instance()->notify('tongy',$params);
  283. $resp = $providers->balance();
  284. }
  285. public function testWeiyiPhone()
  286. {
  287. $providers = new refill\weiyi\RefillPhone([]);
  288. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  289. // $resp = $providers->query(['order_sn' => '90401621489214002876']);
  290. $body = '{"userid":"1f68bb3452134a6cbaa4","ordernum":"90401621489214002876","mobile":"13699279618","timestamp":"20210520134039","state":"2","desc":"%E5%85%85%E5%80%BC%E6%88%90%E5%8A%9F","sign":"865e8d886b92e019df1d039fccf8df46"}';
  291. $params = json_decode($body , true);
  292. refill\RefillFactory::instance()->notify('weiyi',$params);
  293. }
  294. public function testWeiyimanPhone()
  295. {
  296. $providers = new refill\weiyiman\RefillPhone([]);
  297. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  298. // $resp = $providers->query(['order_sn' => '47591620898269370373']);
  299. $data = '{"userid":"46dbb0c992644da881d0","ordernum":"47591620898269370373","mobile":"18500608333","timestamp":"20210513211050","state":"2","desc":"%E5%85%85%E5%80%BC%E6%88%90%E5%8A%9F","serialno":"173313182872","sign":"e9d2ea85b43808d1587793ae329cdb0b"}';
  300. $params = json_decode($data , true);
  301. refill\RefillFactory::instance()->notify('weiyiman',$params);
  302. }
  303. public function testWeiyiWtPhone()
  304. {
  305. $providers = new refill\weiyiwt\RefillPhone([]);
  306. // $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
  307. // $resp = $providers->query(['order_sn' => '38451621924366009924']);
  308. $body = '{"szOrderId":"38451621924366009924","fSalePrice":"47.25","szAgentId":"200016","nFlag":"2","szVerifyString":"a0b5bfc0bbf6c121a4cd74d9ecb2427d","szPhoneNum":"18074608795","szRtnMsg":"1000000083421052514441119833","nDemo":"50"}';
  309. $params = json_decode($body , true);
  310. refill\RefillFactory::instance()->notify('weiyiwt',$params);
  311. }
  312. public function testXiaochuangPhone()
  313. {
  314. $providers = new refill\xiaochuang\RefillPhone([]);
  315. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  316. // $resp = $providers->query(['order_sn' => '84891623028826872085']);
  317. // $body = '{"fail_msg":"","order_sn":"84891623028826872085","order_status":"4","p_order_sn":"2021060709203558011797441162","sign":"E842203C3CA48E924D60B1B56AB93C3B"}';
  318. // $params = json_decode($body , true);
  319. // refill\RefillFactory::instance()->notify('xiaochuang',$params);
  320. $resp = $providers->balance();
  321. }
  322. public function testYintengPhone()
  323. {
  324. $providers = new refill\yinteng\RefillPhone([]);
  325. // $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
  326. // $resp = $providers->query(['order_sn' => '49631623737966351874']);
  327. // $data = '{"szOrderId":"49631623737966351874","fSalePrice":"47.35","szAgentId":"200009","nFlag":"2","szVerifyString":"01c5fafb1d67175f0533b69a762286e8","szPhoneNum":"18074608795","szRtnMsg":"1000000083421061514495400262","nDemo":"50"}';
  328. // $params = json_decode($data , true);
  329. // refill\RefillFactory::instance()->notify('yinteng',$params);
  330. $resp = $providers->balance();
  331. }
  332. public function testMoxjPhone()
  333. {
  334. $providers = new refill\moxj\RefillPhone([]);
  335. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  336. $resp = $providers->query(['order_sn' => '91131623906171663147']);
  337. $data = '{"result":"fail","msg":"0","order":"null","phone_no":"18500608333","amount":"50.0","op_no":"84901623900668776864","sign":"896b54914a07b814573d7f6cc403848a"}';
  338. $params = json_decode($data , true);
  339. // refill\RefillFactory::instance()->notify('moxj',$params);
  340. }
  341. public function testMoxj_fsPhone()
  342. {
  343. $providers = new refill\moxj_fs\RefillPhone([]);
  344. // $resp = $providers->add(15139608757, 4, 100, ['order_sn' => $this->make_sn()]);
  345. // $resp = $providers->query(['order_sn' => '42741624242693157165']);
  346. // $data = '{"amount":"100","charge_type":"2","code":"1","partner_id":"58","phone":"15139608757","sign":"30d193dba4101e50851ed0efabb75fb1","partner_order_no":"42741624242693157165","official_order_id":"20210621103211948830"}';
  347. // $params = json_decode($data , true);
  348. // refill\RefillFactory::instance()->notify('moxj_fs',$params);
  349. $resp = $providers->balance();
  350. }
  351. public function testZanzanquickPhone()
  352. {
  353. $providers = new refill\zanzanquick\RefillPhone([]);
  354. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  355. // $resp = $providers->query(['order_sn' => '90831623925322675223']);
  356. // $data = '{"userid":"d845a4635f7e47668f5e","ordernum":"90831623925322675223","mobile":"18500608333","timestamp":"20210617182545","state":"2","desc":"%E5%85%85%E5%80%BC%E6%88%90%E5%8A%9F","serialno":"110103307232106171824530567108","sign":"0152c723f25be19f21d723e24b2c8987"}';
  357. // $params = json_decode($data , true);
  358. // refill\RefillFactory::instance()->notify('zanzanquick',$params);
  359. $resp = $providers->balance();
  360. }
  361. public function testFengyemanPhone()
  362. {
  363. $providers = new refill\fengyeman\RefillPhone([]);
  364. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  365. // $resp = $providers->query(['order_sn' => '46221624265179185139']);
  366. // $data = '{"order_id":"46221624265179185139","mchid":"HF67a65_10008","tel":"18500608333","price":"50.00","sign":"2bb4ed5edc97ba7f60cf3848aab82cf4","out_order_id":"206877995456","status":"1"}';
  367. // $params = json_decode($data , true);
  368. // refill\RefillFactory::instance()->notify('fengyeman',$params);
  369. $resp = $providers->balance();
  370. }
  371. public function testMoxj_ydPhone()
  372. {
  373. $providers = new refill\moxj_yd\RefillPhone([]);
  374. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  375. // $resp = $providers->query(['order_sn' => '52101624413125875436']);
  376. // $data = '{"customer_order_no":"47651624412877257722","status":1,"merchant_id":"76505818","sign":"c185a0f2152b3ac3ee3f29009dec5a6b"}';
  377. // $params = json_decode($data , true);
  378. // refill\RefillFactory::instance()->notify('moxj_yd',$params);
  379. $resp = $providers->balance();
  380. }
  381. public function testXingzyPhone()
  382. {
  383. $providers = new refill\xingzy\RefillPhone([]);
  384. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  385. // $resp = $providers->query(['order_sn' => '76791624441423287373', 'ch_trade_no' => '210623174333941000']);
  386. // $data = '{"access_key":"211394702","code":3,"data":{"sellprice":26.7,"phone":"18500608333","pass":null,"official_id":null,"official_ch":null},"orderid":210623173427222000,"out_trade_no":"40441624440876653628","sign":"E1g7uHAaJI056jb1fK1DQztkpN4=","timestamp":1624441437918}';
  387. // $params = json_decode($data , true);
  388. // refill\RefillFactory::instance()->notify('xingzy',$params);
  389. $resp = $providers->balance();
  390. }
  391. public function testYuanmaiPhone()
  392. {
  393. $providers = new refill\yuanmai\RefillPhone([]);
  394. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  395. // $resp = $providers->query(['order_sn' => '24231624865882625203', 'ch_trade_no' => '210623174333941000']);
  396. // $data = '{"orderid":"24231624865882625203","status":"2","ordermoney":"50","sign":"94be5b1754ffcc7f0fe1551072146941","spsno":""}';
  397. // $params = json_decode($data, true);
  398. // refill\RefillFactory::instance()->notify('yuanmai',$params);
  399. $resp = $providers->balance();
  400. }
  401. public function testLangkePhone()
  402. {
  403. $providers = new refill\langke\RefillPhone([]);
  404. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  405. $resp = $providers->query(['order_sn' => '29461624952660047520', 'ch_trade_no' => '210623174333941000']);
  406. $data = '{"channelsort":"PHONE_BILL","channelno":"2021062922001123211428063487","onlystr":"29461624952660047520","channel":"TM","sign":"8aedceac4ce4d897f1f06977a9094371","amt":"50","notifyurl":"https:\/\/www.xyzshops.cn\/mobile\/signature.php","cardtype":"","cardno":"","orgid":"7532391600","account":"13699279618","status":"2"}';
  407. $params = json_decode($data, true);
  408. // refill\RefillFactory::instance()->notify('langke',$params);
  409. }
  410. public function testYunlingdsPhone()
  411. {
  412. $providers = new refill\yunlingds\RefillPhone([]);
  413. // $resp = $providers->add(18074608795, 6, 30, ['order_sn' => $this->make_sn()]);
  414. // $resp = $providers->query(['order_sn' => '85351624961920020593']);
  415. // $data = '{"orderid":"OWS21062918188862392","sporderid":"85351624961920020593","userid":"10002623","merchantsubmittime":"20210629181929","resultno":"1","parvalue":"30","remark1":"AW20210629181906yRAvM","payno":"AW20210629181906yRAvM","fundbalance":"-28.59","sign":"11369509ADCF2A2612B3531A15049BDD"}';
  416. // $params = json_decode($data, true);
  417. // refill\RefillFactory::instance()->notify('yunlingds',$params);
  418. $resp = $providers->balance();
  419. }
  420. public function testLingzhmanPhone()
  421. {
  422. $providers = new refill\lingzhman\RefillPhone([]);
  423. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  424. // $resp = $providers->query(['order_sn' => '29771625215707976538']);
  425. // $data = '{"orderNo":"F2107021536431562574","status":"019","consumerNo":"60191625211393862930","voucherNo":null,"mobile":"18500608333"}';
  426. // $params = json_decode($data, true);
  427. // refill\RefillFactory::instance()->notify('lingzhman',$params);
  428. $resp = $providers->balance();
  429. }
  430. public function testQijutangPhone()
  431. {
  432. $providers = new refill\qijutang\RefillPhone([]);
  433. // for ($i=1;$i<2;$i++) {
  434. // $resp = $providers->add(13699279618, 4, 100, ['order_sn' => $this->make_sn()]);
  435. // }
  436. // $resp = $providers->query(['order_sn' => '51501625218912512231']);
  437. // $data = '{"szOrderId":"51501625218912512231","fSalePrice":"28.44","szAgentId":"200010","nFlag":"3","szVerifyString":"20cf16c6bb239e2a703d0bf3e5ef2d5a","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"30"}';
  438. // $params = json_decode($data, true);
  439. // refill\RefillFactory::instance()->notify('qijutang',$params);
  440. $resp = $providers->balance();
  441. }
  442. public function testLingzhman48Phone()
  443. {
  444. $providers = new refill\lingzhman48\RefillPhone([]);
  445. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  446. // $resp = $providers->query(['order_sn' => '49951625814151937287']);
  447. $data = '{"orderNo":"F2107091503134670764","status":"020","consumerNo":"49951625814151937287","voucherNo":null,"mobile":"18500608333"}';
  448. $params = json_decode($data, true);
  449. refill\RefillFactory::instance()->notify('lingzhman48',$params);
  450. }
  451. public function testcangbuPhone()
  452. {
  453. $providers = new refill\cangbu\RefillPhone([]);
  454. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  455. // $resp = $providers->query(['order_sn' => '35041626071052333060']);
  456. // $data = '{"customerId":"112","tmporder":"35041626071052333060","orderno":"s16260710607417944801112","number":"18500608333","money":"100","amount":"94.9000","code":"1","cardno":"","voucher":"110103307042107121424210550266","sign":"de463c3d389a4afe4a2c58257972121a"}';
  457. // $params = json_decode($data, true);
  458. // refill\RefillFactory::instance()->notify('cangbu',$params);
  459. $resp = $providers->balance();
  460. }
  461. public function testCangbukami()
  462. {
  463. $providers = new refill\cangbukami\RefillPhone([]);
  464. // $resp = $providers->add(18500608333, 5, 20, ['order_sn' => $this->make_sn()]);
  465. $resp = $providers->query(['order_sn' => '23231627380108954478']);
  466. }
  467. public function testTongykamiPhone()
  468. {
  469. $providers = new refill\tongykami\RefillPhone([]);
  470. // $resp = $providers->add(18500608333, 5, 20, ['order_sn' => $this->make_sn()]);
  471. $resp = $providers->query(['order_sn' => '26961626077050756648']);
  472. $data = '{"UserId":"100903","ShopId":"300000","SysOrderId":"21071216040810090300001","OrderId":"26961626077050756648","State":"4","Timestamp":"1626077052399","sign":"536A0D93B0869FC4FFDF055AFB8083FE","ParValue":"20.0000","VoucherType":"5","VoucherContent":"982100214176457","CreateTime":"2021-07-12 16:04:08","CompleteTime":"2021-07-12 16:04:12"}';
  473. $params = json_decode($data, true);
  474. // refill\RefillFactory::instance()->notify('tongykami',$params);
  475. }
  476. public function testTongluPhone()
  477. {
  478. $providers = new refill\tonglu\RefillPhone([]);
  479. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  480. $resp = $providers->query(['order_sn' => '22961616468561936356']);
  481. // $body = '{"order_no":"22961616468561936356","order_status":"5","phone_no":"18500608333","amount":5000,"time_paid":1616468856287,"order_cert_no":"","paid":false,"order_id":"20210323966497008"}';
  482. // $sign = '9E41F52F612D60EBB654B3A5D1E2F1E5';
  483. // $params = json_decode($body , true);
  484. // $params['sign'] = $sign;
  485. // refill\RefillFactory::instance()->notify('tonglu',$params);
  486. }
  487. public function testSialan()
  488. {
  489. $providers = new refill\sialan\RefillPhone([]);
  490. // $resp = $providers->add(13699279618, 4, 10, ['order_sn' => $this->make_sn()]);
  491. // $resp = $providers->query(['order_sn' => '79651627436983840352', 'card_no' => 13699279618]);
  492. // $body = '{"cpid":"39780","order_no":"21072809494539780728903528","mobile":"13699279618","amount":"10","status":"success","sz_order_no":"2021072822001158391454773955","ret_para":"79651627436983840352","sign":"aa7e8a2e589660e98319c5546cb432fa"}';
  493. // $params = json_decode($body, true);
  494. // refill\RefillFactory::instance()->notify('sialan', $params);
  495. $resp = $providers->balance();
  496. }
  497. public function testMoxj_new()
  498. {
  499. $providers = new refill\moxj_new\RefillPhone([]);
  500. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  501. // $resp = $providers->query(['order_sn' => '33301627887529587739', 'card_no' => 13699279618]);
  502. // $body = '{"code":"2101","official_order_no":"0","partner_no":"300459017","partner_order_no":"33301627887529587739","phone":"18500608333","amount":"30","isp":"cucc","charge_time":"0","sign":"A512D612C823DFBCA9B4BC42134CC164"}';
  503. // $params = json_decode($body, true);
  504. // refill\RefillFactory::instance()->notify('moxj_new', $params);
  505. $resp = $providers->balance();
  506. }
  507. public function testKangkai()
  508. {
  509. $providers = new refill\kangkai\RefillPhone([]);
  510. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  511. // $resp = $providers->query(['order_sn' => '25431627898461762024']);
  512. // $body = '{"TaskID":"267459","Mobile":"18500608333","Status":"5","ReportTime":"2021-08-02T18:02:01.777","ReportCode":"7:","OutTradeNo":"25431627898461762024","Price":"44.2500","ReceiptNum":"","Sign":"f0934a621fd0b076373f77a9bf8d7051"}';
  513. // $params = json_decode($body, true);
  514. // refill\RefillFactory::instance()->notify('kangkai', $params);
  515. $resp = $providers->balance();
  516. }
  517. public function testLechong()
  518. {
  519. $providers = new refill\lechong\RefillPhone([]);
  520. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  521. // $resp = $providers->query(['order_sn' => '55641627902450221838']);
  522. // $body = '{"sellerid":"55641627902450221838","agentcode":"202108021753","account":"MTg1MDA2MDgzMzM=","value":"50","payvalue":"47.8500","voucher":"","createtime":"20210802190739","endtime":"20210802191008","state":"4","remark":"","time":"20210802191008","sign":"0e2d69318d03871d887debd498cc50f2"}';
  523. // $params = json_decode($body, true);
  524. // refill\RefillFactory::instance()->notify('lechong', $params);
  525. $resp = $providers->balance();
  526. }
  527. public function testXinhengyang()
  528. {
  529. $providers = new refill\xinhengyang\RefillPhone([]);
  530. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  531. // $resp = $providers->query(['order_sn' => '50441628062235230398']);
  532. // $resp = $providers->balance();
  533. $body = '{"szOrderId":"50441628062235230398","fSalePrice":"28.68","szAgentId":"200026","nFlag":"3","szVerifyString":"0166cec8496c59b377744ef5dd9e02dc","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"30"}';
  534. $params = json_decode($body, true);
  535. refill\RefillFactory::instance()->notify('xinhengyang', $params);
  536. }
  537. public function testMiaoxt()
  538. {
  539. $providers = new refill\miaoxt\RefillPhone([]);
  540. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  541. // $resp = $providers->query(['order_sn' => '85101628064401524483']);
  542. // $resp = $providers->balance();
  543. $body = '{"szOrderId":"85101628064401524483","fSalePrice":"10.2","szAgentId":"200050","nFlag":"2","szVerifyString":"7a08b9a71a297a28843d749a7bf79dbc","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"10"}';
  544. $params = json_decode($body, true);
  545. refill\RefillFactory::instance()->notify('miaoxt', $params);
  546. }
  547. public function testTianyan()
  548. {
  549. $providers = new refill\tianyan\RefillPhone([]);
  550. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  551. // $resp = $providers->query(['order_sn' => '71241628067981955316', 'card_no' => 18500608333, 'card_type' => 5]);
  552. // $resp = $providers->balance();
  553. $params['amount'] = '100.00';
  554. $params['orderNo'] = '2618380681466713437097';
  555. $params['supplierId'] = '48';
  556. $params['orderId'] = 'S20210805081833371976224648';
  557. $params['notifyTime'] = '1628122793669';
  558. $params['sign'] = '4d8f70bf451608359e256ee1e5f30de1';
  559. $params['discountAmount'] = '5.50';
  560. $params['phoneNo'] = '17696554433';
  561. $params['queryUrl'] = 'https%3A%2F%2Fupay.10010.com%2Fnpfwap%2FNpfMobCB%2FmobPayFeeCB%2FPayFeeCBFinish%3Fs%3Ds%26province%3D034%26hsnduns%3D9900%26PayRspObj%3Dg5Wzcx2XA2IKuVRxJM8XL1ku7SOw9jQ9rQ53Brvq7an002PM9u3lEFAsIL88fmZQ5E2gZuGRBFkRD3%2FOhvJ9QiYKPITME8OErhoTmu%2FOr9WdyO12eK53aaUvE557JZLZVIWyAOE47QZDnKnVs2bdpH1ApK0QIUmkdeRe%2BO%2F6qzkq%2FQv8oH6shae7uhV0vzeRAuY1q8MuTsNZ3YfvSuSFc6u1twRHAjUKJdKV6gKxQofahNr9MjCdYneuIcPWI7xNyDWcr12FEhNEJDSBGoIr78jw6XMNMrzcBFLl0eXW1iMPd%2BCAQVG%2BF7s8naJNFSALkapTORdCN%2BRbxsLugFZqVAaGs%2B1ldaATPMtd2ZWTp8JibGOfsf9uCQiyu3R3t6b5R%2BQPHCScw8Cu1eSixloFI2ZMVwA18WVbN1vb81X4IGI%2B5nxRA%2FJ1tm7snm5Oj799%2BoaS27QyGRSB618lySbprw0muawiQzdKdOmVBMcZH0ADyDM8dFvT9dKz5yRlABpHeBt7fTY1MIdNKjQ4QK5xQHG8GoTwchc36eE2CzF4kcaT9uKlmv1Wbb38szv4s%2F6HoncxQJxHOgXjWTQGBUSrolDn0qc0DdVIQ%2B25HApeloCjHhy0xTbDJhRsdezWjIONXbqiB2ZTPrheuM3qIROEBwvBRVgm0GotZYyrP3IIMLfeMtCThrirsnLRW1anCoWpDJJr6qwjRMwu%2BNAtfLyIEVkDKZeZKuA2Kk5Q9GLQHub2Nx5%2BAN3eGdRWzN6BPNiMRVlu1LpY%2BYCBg9fr9NZN3%2B7XcHGWyXM6K%2FugRPAdZUgJJQFFDAIiA4Kvc1uN2zjraiLZt7xjHMXgAP69mvEp%2FVMm2whluq6sk%2B67cdOTwMpXwzp6Aoh1d1OX4IYqw20vxfwzESPSg2RVDJUBT0%2F2NI0J2VJObHih%26ServicePlatID%3D11';
  562. $params['payType'] = 'wechat';
  563. $params['ticketNo'] = '110103353022108050819140250945';
  564. $params['company'] = 'lt';
  565. $params['status'] = '2';
  566. refill\RefillFactory::instance()->notify('tianyan', $params);
  567. }
  568. public function testYunsuoyaoman()
  569. {
  570. // $providers = $this->getProvider('yunsuoyaoman');
  571. // $resp = $providers->balance();
  572. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  573. // $resp = $providers->query(['order_sn' => '58771629702960801700']);
  574. $body = '{"orderid":"RLD21082315152651196","sporderid":"58771629702960801700","userid":"10002745","merchantsubmittime":"20210823152623","resultno":"9","parvalue":"30","remark1":"","payno":"","fundbalance":"-27.45","sign":"76A29E0101644831526138D63917C130"}';
  575. $params = json_decode($body, true);
  576. $providers = $this->getProvider('yunsuoyaoman','RefillCallBack');
  577. $ret = $providers->verify($params);
  578. $resp = $providers->notify($params);
  579. }
  580. public function testYouhe()
  581. {
  582. $providers = new refill\youhe\RefillPhone([]);
  583. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  584. // $resp = $providers->query(['order_sn' => '70421628146378080613']);
  585. // $resp = $providers->balance();
  586. $body = '{"szOrderId":"70421628146378080613","fSalePrice":"28.59","szAgentId":"200022","nFlag":"2","szVerifyString":"29b5b132c4373447d67d92709afd1c2f","szPhoneNum":"18500608333","szRtnMsg":"110103353032108051453020270482","nDemo":"30"}';
  587. $params = json_decode($body, true);
  588. refill\RefillFactory::instance()->notify('youhe', $params);
  589. }
  590. public function testWenye()
  591. {
  592. $providers = new refill\wenye\RefillPhone([]);
  593. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  594. // $resp = $providers->query(['order_sn' => '88871628157083445809']);
  595. // $resp = $providers->balance();
  596. $body = '{"orderNo":"F2108051529062719948","status":"019","consumerNo":"95291628148539909985","voucherNo":null,"mobile":"18500608333"}';
  597. $params = json_decode($body, true);
  598. // refill\RefillFactory::instance()->notify('wenye', $params);
  599. }
  600. public function testXinyang()
  601. {
  602. $providers = new refill\xinyang\RefillPhone([]);
  603. // $resp = $providers->add(13699279618, 4, 10, ['order_sn' => $this->make_sn()]);
  604. // $resp = $providers->query(['order_sn' => '68151628157534687971']);
  605. // $resp = $providers->balance();
  606. $body = '{"UserId":"100029","ShopId":"300000","SysOrderId":"21080517590310002956698","OrderId":"68151628157534687971","State":"4","Timestamp":"1628157558204","sign":"4514B2BA75DBA02EA3A60525329B3D86","ParValue":"10.0000","VoucherType":"0","VoucherContent":"2021080522001161731405208592","CreateTime":"2021-08-05 17:59:03","CompleteTime":"2021-08-05 17:59:18"}';
  607. $params = json_decode($body, true);
  608. refill\RefillFactory::instance()->notify('xinyang', $params);
  609. }
  610. public function testGuochuang()
  611. {
  612. $providers = new refill\guochuang\RefillPhone([]);
  613. // $resp = $providers->add(18074608795, 6, 10, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
  614. // $resp = $providers->query(['order_sn' => '82951628231038096078']);
  615. // $resp = $providers->balance();
  616. // $body = '{"account":"18074608795","evidence":"1000000083421080614310024563","evidenceType":"","id":"D2021080614235942044","inTime":"2021/08/06 14:26:22","money":"10","outerId":"82951628231038096078","status":"SUCCESS"}';
  617. // $params['ts'] = 1628231182;
  618. // $params['sign'] = '545F7024870B145915934CA36C6D341E';
  619. // $params['body'] = $body;
  620. // refill\RefillFactory::instance()->notify('guochuang', $params);
  621. [$goods_id,$price] = $providers->goods(2,10,4,1,[]);
  622. }
  623. public function testXianghongrui()
  624. {
  625. $providers = new refill\xianghongrui\RefillPhone([]);
  626. // $resp = $providers->balance();
  627. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  628. // $resp = $providers->query(['order_sn' => '87691628758730981608']);
  629. $body = '{"orderid":"BAT21081216581941649","sporderid":"87691628758730981608","userid":"10002503","merchantsubmittime":"20210812165918","resultno":"1","parvalue":"50","remark1":"110103353052108121658550256634","payno":"110103353052108121658550256634","fundbalance":"-47.5","sign":"EF34F6FB6D37E4FCB92DCD8F41CC67E1"}';
  630. $params = json_decode($body, true);
  631. refill\RefillFactory::instance()->notify('xianghongrui', $params);
  632. }
  633. public function testDianchong()
  634. {
  635. $providers = $this->getProvider('dianchong');
  636. // $resp = $providers->balance();
  637. // $resp = $providers->add(18074608795, 5, 30, ['order_sn' => $this->make_sn()]);
  638. // $resp = $providers->query(['order_sn' => '26671629190230227788']);
  639. $body = '{"seqNo":"5C2D85572F8743CF","orderNo":"26671629190230227788","result":"Q0000","transo":"1000000083421081716331202254","sign":"87F3F67EA2B91709FD05468CF74210A1"}';
  640. $params = json_decode($body, true);
  641. $providers = $this->getProvider('dianchong','RefillCallBack');
  642. $ret = $providers->verify($params);
  643. $resp = $providers->notify($params);
  644. }
  645. public function testXunyinOil()
  646. {
  647. $providers = $this->getProvider('xunyinoil','RefillOil');
  648. // $resp = $providers->balance();
  649. // $resp = $providers->add(9030230005180327, 1, 50, ['order_sn' => $this->make_sn()]);
  650. $resp = $providers->query(['order_sn' => '77791629450541412891']);
  651. // $body = '{"ext":"","code":"8888","sign":"7db98f3f271013688134f2fbd503dc15","statemes":"\u6210\u529f","id":"80641629442789487318","userid":"8417","operatorid":"2421082015001888","status":"SUCCESS"}';
  652. // $params = json_decode($body, true);
  653. // $providers = $this->getProvider('xunyinoil','RefillCallBack');
  654. // $ret = $providers->verify($params);
  655. // $resp = $providers->notify($params);
  656. }
  657. public function testJumiThird()
  658. {
  659. $providers = $this->getProvider('jumithird');
  660. // $resp = $providers->balance();
  661. $resp = $providers->add(588073521, 7, 100, [
  662. 'order_sn' => $this->make_sn(),
  663. 'goods_id' => 6978,
  664. 'product_code' => 'XYZ100747'
  665. ]);
  666. // $resp = $providers->query(['order_sn' => '53151629791019902609']);
  667. // $body = '{"order_no":"59251629777055495341","channel_order_no":"C2108241152003775025","status":3,"money":"100.00","cost_money":"97.00","mch_no":210303112631,"account":"588073521","official_sn":"","sign":"7d7b3e701865b54c8cf0d9e903fdf6bf"}';
  668. // $params = json_decode($body, true);
  669. // $providers = $this->getProvider('jumithird','RefillCallBack');
  670. // $ret = $providers->verify($params);
  671. // $resp = $providers->notify($params);
  672. }
  673. public function testWangliantx()
  674. {
  675. // $providers = $this->getProvider('wangliantx');
  676. // $resp = $providers->balance();
  677. // for ($i = 1; $i<=1; $i++){
  678. // $resp = $providers->add(18074608795, 6, 50, [
  679. // 'order_sn' => $this->make_sn(),
  680. // 'regin_no' => 1
  681. // ]);
  682. // }
  683. // $resp = $providers->query(['order_sn' => '85901629801033376170']);
  684. $body = '{"userid":"10073664","sporderid":"85901629801033376170","orderid":"C5C5D4F49DB61A8773664","resultno":"1","merchantsubmittime":"20210824183109","ordermoney":"47.6","verifystring":"b6a873ecd6dc9cea3a410c6386cdab84","sign":"4a80e2a8c7b07c8aacada4feedd581bd","supnumber":"1000000083421082418345386156"}';
  685. $params = json_decode($body, true);
  686. $providers = $this->getProvider('wangliantx','RefillCallBack');
  687. $ret = $providers->verify($params);
  688. $resp = $providers->notify($params);
  689. }
  690. public function testAmingjd()
  691. {
  692. // $providers = new refill\amingjd\RefillPhone([]);
  693. // $resp = $providers->add(13699279618, 5, 30, ['order_sn' => $this->make_sn()]);
  694. // $resp = $providers->query(['order_sn' => '42301616475989518588']);
  695. $body = '{"order_id":"83321616478215494884","mchid":"10003","tel":"13699279618","price":"30.00","sign":"01c49620c155a80bc43cecc2b1651868","status":"0","out_order_id":"0"}';
  696. $params = json_decode($body, true);
  697. refill\RefillFactory::instance()->notify('amingjd', $params);
  698. }
  699. public function testAmingjdmanPhone()
  700. {
  701. $providers = new refill\amingjdman\RefillPhone([]);
  702. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  703. // $resp = $providers->query(['order_sn' => '82741619577673758623']);
  704. $body = '{"order_id":"82741619577673758623","mchid":"10045","tel":"13699279618","price":"30.00","sign":"2fe55fb4d4b2acc2e98137adb82fa57e","status":"0","out_order_id":"0"}';
  705. $params = json_decode($body, true);
  706. refill\RefillFactory::instance()->notify('amingjdman', $params);
  707. }
  708. public function testWeishengyWtPhone()
  709. {
  710. $providers = new refill\weishengywt\RefillPhone([]);
  711. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  712. // $resp = $providers->query(['order_sn' => '27681620538125370652']);
  713. $data = '{"szOrderId":"27681620538125370652","fSalePrice":"47.5","szAgentId":"200045","nFlag":"2","szVerifyString":"92fafec121b77518d539ed9f5005fdf9","szPhoneNum":"18500608333","szRtnMsg":"110103308032105091328520502948","nDemo":"50"}';
  714. $params = json_decode($data, true);
  715. refill\RefillFactory::instance()->notify('weishengywt', $params);
  716. }
  717. public function testWeishengyJDPhone()
  718. {
  719. $providers = new refill\weishengyjd\RefillPhone([]);
  720. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  721. // $resp = $providers->query(['order_sn' => '14261620887423822879']);
  722. $data = '{"szOrderId":"14261620887423822879","fSalePrice":"44.0","szAgentId":"200050","nFlag":"3","szVerifyString":"3cceef390602058e1d2fdde2e07636a4","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"50"}';
  723. $params = json_decode($data, true);
  724. refill\RefillFactory::instance()->notify('weishengyjd', $params);
  725. }
  726. public function testYeziPhone()
  727. {
  728. $providers = new refill\yezi\RefillPhone([]);
  729. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  730. // $resp = $providers->query(['order_sn' => '35261620988265145105']);
  731. $data = '{"mchid":"10147","order_sn":"35261620988265145105","amount":"50.00","cardno":"18500608333","trade_no":"6363570674332280422825","idcard":"","card_name":"","official_sn":"","message":"","state":"CANCEL","sign":"b79f2ddbb5b7eef98f414585a5bd2cde"}';
  732. $params = json_decode($data, true);
  733. refill\RefillFactory::instance()->notify('yezi', $params);
  734. }
  735. public function testWeishengysixPhone()
  736. {
  737. $providers = new refill\weishengysix\RefillPhone([]);
  738. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  739. // $resp = $providers->query(['order_sn' => '17171624434289348649']);
  740. $data = '{"szOrderId":"17171624434289348649","fSalePrice":"44.5","szAgentId":"200074","nFlag":"2","szVerifyString":"fa5735090199d97e6a50e7f3083be111","szPhoneNum":"18500608333","szRtnMsg":"AW2021062315464045A27","nDemo":"50"}';
  741. $params = json_decode($data, true);
  742. refill\RefillFactory::instance()->notify('weishengysix', $params);
  743. }
  744. public function testHaohaoOil()
  745. {
  746. $providers = new refill\haohao\RefillOil([]);
  747. // $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
  748. $data['amount'] = 20000;
  749. $data['mchId'] = 467253;
  750. $data['mchOrderNo'] = '5514850674656058146707';
  751. $data['mobile'] = '';
  752. $data['sign'] = 'F282D68972A437F3CEB3516BB2FDD19A';
  753. $data['operator'] = 4;
  754. $data['number'] = '1000113200020348885';
  755. $data['thirdOrderNo'] = '2317184088901537792';
  756. $data['directStatus'] = 5;
  757. // $input = json_decode($data, true);
  758. refill\RefillFactory::instance()->notify('haohao',$data);
  759. }
  760. public function testJuzhuoOil()
  761. {
  762. $providers = new refill\juzhuo\RefillOil([]);
  763. // $resp = $providers->add(1000111100021211884, 2, 200, ['order_sn' => $this->make_sn()]);
  764. // $resp = $providers->query(['order_sn' => '20121621578185774451']);
  765. // $data = '{"channelsort":"OIL_CARD","channelno":"185176855832","onlystr":"20121621578185774451","channel":"JD","sign":"34dce9329fef7997c134987247ac6ee1","amt":"200","notifyurl":"https:\/\/www.xyzshops.cn\/mobile\/signature.php","cardtype":"Sinoepc","cardno":"1000111100021211884","orgid":"6095171500","account":"","status":"2"}';
  766. // $input = json_decode($data, true);
  767. $data['channelsort'] = 'OIL_CARD';
  768. $data['channelno'] = '';
  769. $data['onlystr'] = '0772770675248490450497';
  770. $data['channel'] = 'JD';
  771. $data['sign'] = '4a9f113bfa4aa2d155de7136ca0afe2d';
  772. $data['amt'] = '100';
  773. $data['notifyurl'] = 'http://121.89.212.167/racc/callback/lingzh/juzhuo.php';
  774. $data['cardtype'] = 'Sinoepc';
  775. $data['cardno'] = '1000113200029532754';
  776. $data['orgid'] = '6095171500';
  777. $data['account'] = '';
  778. $data['status'] = '3';
  779. refill\RefillFactory::instance()->notify('juzhuo',$data);
  780. }
  781. public function testZeheng()
  782. {
  783. $providers = new refill\zeheng\RefillOil([]);
  784. // $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 100, ['order_sn' => $this->make_sn()]);
  785. // $resp = $providers->query(['order_sn' => '45951620814813332604']);
  786. $data = '{"extOrderId":"45951620814813332604","orderId":"R2021051218240000192928","salePrice":"96.8000","sign":"0d6b9641eaf8d36ecba82cfefc6aa307","state":"4"}';
  787. $input = json_decode($data, true);
  788. refill\RefillFactory::instance()->notify('zeheng',$input);
  789. }
  790. public function testXiaoniu()
  791. {
  792. $providers = new refill\xiaoniu\RefillOil([]);
  793. // $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 500, ['order_sn' => $this->make_sn()]);
  794. // $resp = $providers->query(['order_sn' => '39911625819031601073']);
  795. // $data = '{"content":"\u3010\u4e2d\u56fd\u77f3\u5316\u3011\u60a8\u5c3e\u53f7\u4e3a211884\u7684\u52a0\u6cb9\u5361\u4e8e07\u670809\u65e5 16\u65f630\u5206\u5145\u503c\u6210\u529f,\u91d1\u989d500\u5143,\u8ba2\u5355\u53f7:2521070916304172","realAmt":"490.0000","status":"1","timestamp":"20210709163042","sign":"110aaae89243c9ed2d6aa4d753597224","orderNo":"XN20210709162351796707722","mOrderNo":"39911625819031601073"}';
  796. // $input = json_decode($data, true);
  797. // refill\RefillFactory::instance()->notify('xiaoniu',$input);
  798. $resp = $providers->balance();
  799. }
  800. public function testYingdian()
  801. {
  802. $providers = new refill\yingdian\RefillOil([]);
  803. // $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 200, ['order_sn' => $this->make_sn()]);
  804. // $resp = $providers->query(['order_sn' => '94691626688509004979']);
  805. $resp = $providers->query(['order_sn' => '45671626687631917892']);
  806. $data = '{"orderNo":"94691626688509004979","vouchers":"[\"2421071918070053\"]","orderId":"63400811-e877-11eb-a89f-00163e147a9b","spOrderNo":"052423YK241720210719175503603473","status":"SUCCESS"}';
  807. $input = json_decode($data, true);
  808. // refill\RefillFactory::instance()->notify('yingdian',$input);
  809. }
  810. public function testZhenqi()
  811. {
  812. $providers = new refill\zhenqi\RefillPhone([]);
  813. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  814. // $resp = $providers->query(['order_sn' => '42611626267945146350']);
  815. // $data = '{"out_trade_no":"14001626266194932132","create_time":"1626266201","sp_order_no":"110103353232107142044550619272","status":"1","sign":"3C2F8ED40EEB9151D2117E2DA1FA64AA"}';
  816. // $input = json_decode($data, true);
  817. // refill\RefillFactory::instance()->notify('zhenqi',$input);
  818. $resp = $providers->balance();
  819. }
  820. public function testYunsuoyaofs()
  821. {
  822. $providers = new refill\yunsuoyaofs\RefillPhone([]);
  823. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  824. // $resp = $providers->query(['order_sn' => '85681626322286098163']);
  825. // $data = '{"orderid":"AMU21071512111544162","sporderid":"85681626322286098163","userid":"10002671","merchantsubmittime":"20210715121132","resultno":"9","parvalue":"50","remark1":"","payno":"","fundbalance":"-47.7","sign":"45ECFF26E84F7DC3BFFDCFAFF3B1E561"}';
  826. // $input = json_decode($data, true);
  827. // refill\RefillFactory::instance()->notify('yunsuoyaofs',$input);
  828. $resp = $providers->balance();
  829. }
  830. public function testZhenqi1m()
  831. {
  832. $providers = new refill\zhenqi1m\RefillPhone([]);
  833. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  834. // $resp = $providers->query(['order_sn' => '45611626334593130605']);
  835. // $data = '{"out_trade_no":"45611626334593130605","create_time":"1626334606","sp_order_no":"202107152200117311004426885635","status":"1","sign":"CF8EB902F60B76591C898C991361BB4D"}';
  836. // $input = json_decode($data, true);
  837. // refill\RefillFactory::instance()->notify('zhenqi1m',$input);
  838. $resp = $providers->balance();
  839. }
  840. public function testHongxudayz()
  841. {
  842. $providers = new refill\hongxudayz\RefillPhone([]);
  843. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  844. // $resp = $providers->query(['order_sn' => '78221626445316011524']);
  845. $data = '{"sale_value":"29.76","supply_id":"18789504","order_status":"0","mer_oid":"78221626445316011524","phone_no":"18500608333","mer_id":"yzhfcz","sale_discount":"0.992","sign":"51696429B62E74266516326279C2C97B","cp_id":"","product_no":"HFLTBJ_****00003000","product_face":"30","cp_ctype":""}';
  846. $input = json_decode($data, true);
  847. refill\RefillFactory::instance()->notify('hongxudayz',$input);
  848. }
  849. public function testHongxudagy()
  850. {
  851. $providers = new refill\hongxudagy\RefillPhone([]);
  852. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  853. // $resp = $providers->query(['order_sn' => '86521626446475240639']);
  854. // $data = '{"sale_value":"29.76","supply_id":"18790079","order_status":"0","mer_oid":"86521626446475240639","phone_no":"18500608333","mer_id":"bjgyfl","sale_discount":"0.992","sign":"9BDA608364D4E08C653E8C6798151AC2","cp_id":"","product_no":"HFLTBJ_****00003000","product_face":"30","cp_ctype":""}';
  855. // $input = json_decode($data, true);
  856. // refill\RefillFactory::instance()->notify('hongxudagy',$input);
  857. $resp = $providers->balance();
  858. }
  859. public function testHongxudayz996()
  860. {
  861. $providers = new refill\hongxudayz996\RefillPhone([]);
  862. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  863. // $resp = $providers->query(['order_sn' => '73691626753698522472']);
  864. $data = '{"sale_value":"29.88","supply_id":"18888477","order_status":"3","mer_oid":"73691626753698522472","phone_no":"18500608333","mer_id":"bjyz2","sale_discount":"0.996","sign":"8E98EA2B6B81D832EBA8F89611A3F9B9","cp_id":"","product_no":"HFLTBJ_****00003000","product_face":"30","cp_ctype":""}';
  865. $input = json_decode($data, true);
  866. refill\RefillFactory::instance()->notify('hongxudayz996',$input);
  867. }
  868. public function testHongxudagy996()
  869. {
  870. $providers = new refill\hongxudagy996\RefillPhone([]);
  871. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  872. // $resp = $providers->query(['order_sn' => '87681626758209689412']);
  873. $data = '{"sale_value":"29.88","supply_id":"18889758","order_status":"3","mer_oid":"87681626758209689412","phone_no":"18500608333","mer_id":"bjgy2","sale_discount":"0.996","sign":"0CBA5B8F34D40914CB86CC74BE8EF15B","cp_id":"","product_no":"HFLTBJ_****00003000","product_face":"30","cp_ctype":""}';
  874. $input = json_decode($data, true);
  875. refill\RefillFactory::instance()->notify('hongxudagy996',$input);
  876. }
  877. public function testYunchonggong()
  878. {
  879. $providers = new refill\yunchonggong\RefillPhone([]);
  880. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  881. // $resp = $providers->query(['order_sn' => '96481626678323726593']);
  882. // $data = '{"szOrderId":"96481626678323726593","fSalePrice":"28.5","szAgentId":"200009","nFlag":"2","szVerifyString":"3f9cdc789c61646cf13079ee0464c6a0","szPhoneNum":"18500608333","szRtnMsg":"110103353092107191505440605544","nDemo":"30"}';
  883. // $input = json_decode($data, true);
  884. // refill\RefillFactory::instance()->notify('yunchonggong',$input);
  885. $resp = $providers->balance();
  886. }
  887. public function testBingdht()
  888. {
  889. $providers = new refill\bingdht\RefillPhone([]);
  890. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  891. // $resp = $providers->query(['order_sn' => '62491626761331174794']);
  892. // $data = '{"szOrderId":"62491626761331174794","fSalePrice":"45.25","szAgentId":"200044","nFlag":"3","szVerifyString":"46745191d31b16ee7978a7f5554357d6","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"50"}';
  893. // $input = json_decode($data, true);
  894. // refill\RefillFactory::instance()->notify('bingdht',$input);
  895. $resp = $providers->balance();
  896. }
  897. public function testYuecheng()
  898. {
  899. $providers = new refill\yuecheng\RefillPhone([]);
  900. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  901. // $resp = $providers->query(['order_sn' => '45101626776884387650']);
  902. $data = '{"ste":"0","cpid":"982100572516571","sign":"E0347851C8395B4FC08DA51FC650ABDA","dm":"49.6500","pid":"HFLTBJ_****00005000","oid":"45101626776884387650","sid":"200014603779","ct":"","tf":"50.0000","nb":"1","cardinfo":"","salevalue":"49.6500","pn":"18500608333","cid":"gyhf"}';
  903. $input = json_decode($data, true);
  904. refill\RefillFactory::instance()->notify('yuecheng',$input);
  905. }
  906. public function testPrice()
  907. {
  908. $amounts = [10, 20, 30, 50, 100, 200, 300, 500];
  909. $rate = 0.994;
  910. foreach ($amounts as $amount) {
  911. $price[] = $amount * $rate;
  912. }
  913. }
  914. public function testCallbackDir()
  915. {
  916. $path = "/callback";
  917. $file = "/mobile/callback/refill_call.php";
  918. $basename = basename($file);
  919. $tmp = "{$path}/{$basename}.php";
  920. return file_exists($tmp);
  921. }
  922. public function testWeisPhone()
  923. {
  924. $providers = new refill\weisyd\RefillPhone([]);
  925. $resp = $providers->add(17801048874, 4, 10, ['order_sn' => $this->make_sn()]);
  926. }
  927. public function testXcPhone()
  928. {
  929. $providers = new refill\xc\RefillPhone([]);
  930. $resp = $providers->add(13699279618, 5, 100, ['order_sn' => $this->make_sn()]);
  931. // $resp = $providers->query(['order_sn' => '87961616926444043617']);
  932. $params['pay_orderid'] = '87961616926444043617';
  933. $params['pay_iphone'] = '18500608333';
  934. $params['pay_money'] = '100';
  935. $params['wt_orderid'] = '202103281816121070';
  936. $params['status'] = '1';
  937. $params['sign'] = 'f7be2e859a5a6dc7b1a8273361617752';
  938. // refill\RefillFactory::instance()->notify('xc',$params);
  939. }
  940. public function testAfandPhone()
  941. {
  942. $providers = new refill\afand\RefillPhone([]);
  943. // for ($i = 3; $i > 0; --$i) {
  944. $resp = $providers->query(['order_sn' => '540668612768904780']);
  945. // }
  946. }
  947. public function testAfandengPhone()
  948. {
  949. $providers = new refill\afandeng\RefillPhone([]);
  950. // for ($i = 5; $i > 0; --$i) {
  951. $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  952. // }
  953. // $resp = $providers->query(['order_sn' => '20941616115610023539']);
  954. // $params['usr'] = 'afandeng';
  955. // $params['ord'] = '20941616115610023539';
  956. // $params['state'] = '2';
  957. // $params['bz'] = '';
  958. // $params['sgn'] = 'BA2C9D379C3EB648A0B7AAB3A21A3F6A';
  959. // refill\RefillFactory::instance()->notify('afandeng',$params);
  960. }
  961. public function testWantongPhone()
  962. {
  963. $providers = new refill\wantong\RefillPhone([]);
  964. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  965. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  966. $resp = $providers->query(['order_sn' => '26061618988575301841']);
  967. $data = '{"uid":"97396885","order_no":"26061618988575301841","mobile_order_no":"","phone_number":"13699279618","face_value":"3000","status":"9","sign":"1a019202656cf4feffe715025fab01bf"}';
  968. $input = json_decode($data, true);
  969. // refill\RefillFactory::instance()->notify('wantong',$input);
  970. }
  971. public function testXunyinPhone()
  972. {
  973. $providers = new refill\xunyin\RefillPhone([]);
  974. // $resp = $providers->add(17703711950, 6, 30, ['order_sn' => $this->make_sn()]);
  975. // $resp = $providers->query(['order_sn' => '76831617176125893158']);
  976. // $xml = '<Order><cpid>8417</cpid><orderid>40591617173295524057</orderid><order_no>14784226</order_no><msg>充值中</msg><Code>0000</Code><Cards/></Order>';
  977. // $resp = $providers->xmlToArray($xml);
  978. // if ($resp['Code'] === '0000') {
  979. // return [true, $resp['order_no'], false];
  980. // } else {
  981. // return [false, $resp['msg'], false];
  982. // }
  983. // $params['ext'] = '';
  984. // $params['code'] = '8888';
  985. // $params['sign'] = '428ac223cf3a1f6f3d382aac754e8e17';
  986. // $params['statemes'] = '成功';
  987. // $params['id'] = '76831617176125893158';
  988. // $params['userid'] = '8417';
  989. // $params['operatorid'] = '1000000083421033115583773201';
  990. // $params['status'] = 'SUCCESS';
  991. // refill\RefillFactory::instance()->notify('xunyin',$params);
  992. $resp = $providers->balance();
  993. }
  994. public function testFenshengPhone()
  995. {
  996. $file = BASE_HELPER_RAPI_PATH . "/qianqian/RefillPhone.php";
  997. if(!file_exists($file)){
  998. Log::record("provider api file={$file} not exist.",Log::DEBUG);
  999. return false;
  1000. } else {
  1001. require_once($file);
  1002. Log::record("file={$file} load success.",Log::DEBUG);
  1003. }
  1004. $providers = new refill\qianqian\RefillPhone([]);
  1005. $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1006. // $resp = $providers->query(['order_sn' => '27511617764278021035']);
  1007. // $datas = '[{"orderNo":"F2104071058069438461","status":"001","consumerNo":"27511617764278021035","voucherNo":"510490688023364042","mobile":"13699279618"}]';
  1008. // $datas = json_decode($datas,true);
  1009. // foreach ($datas as $data) {
  1010. // refill\RefillFactory::instance()->notify('fensheng',$data);
  1011. // }
  1012. }
  1013. public function testQianqianPhone()
  1014. {
  1015. $providers = new refill\qianqian\RefillPhone([]);
  1016. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1017. // $resp = $providers->query(['order_sn' => '27511617764278021035']);
  1018. // $datas = '[{"orderNo":"F2104071058069438461","status":"001","consumerNo":"27511617764278021035","voucherNo":"510490688023364042","mobile":"13699279618"}]';
  1019. // $datas = json_decode($datas,true);
  1020. // foreach ($datas as $data) {
  1021. // refill\RefillFactory::instance()->notify('fensheng',$data);
  1022. // }
  1023. $resp = $providers->balance();
  1024. }
  1025. public function testQianqianmanPhone()
  1026. {
  1027. $providers = new refill\qianqianman\RefillPhone([]);
  1028. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  1029. // $resp = $providers->query(['order_sn' => '72011621236975003462']);
  1030. $data = '{"orderNo":"F2105171538062539442","status":"019","consumerNo":"72011621236975003462","voucherNo":null,"mobile":"13699279618"}';
  1031. $input = json_decode($data, true);
  1032. refill\RefillFactory::instance()->notify('qianqianman',$input);
  1033. }
  1034. public function testRiyingPhone()
  1035. {
  1036. $providers = new refill\riying\RefillPhone([]);
  1037. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1038. $resp = $providers->query(['ch_trade_no' => '2021041311120213187423105022']);
  1039. $data = '{"UserId":"10050","SysOrderId":"2021041311120213187423105022","OrderId":"15641618283518423567","State":"4","Timestamp":"1618283565746","VoucherType":"1","VoucherContent":"511009928000087852","Sign":"a6ec70a3ea42baae941528398c6d0a43"}';
  1040. $input = json_decode($data, true);
  1041. // refill\RefillFactory::instance()->notify('riying',$input);
  1042. }
  1043. public function testWeishengyPhone()
  1044. {
  1045. $providers = new refill\weishengy\RefillPhone([]);
  1046. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1047. // $resp = $providers->query(['order_sn' => '15551618590601301527']);
  1048. $data = '{"masId":"699270071532654592","oids":"158877719094,166090529155,158887187476","orderNo":"62411618635377880788","orderPrice":"150.00","phone":"18500608333","sign":"3EC10A32FC4CCC976048E1164D0FCBF6","status":"1","time":"1618643281063","type":"2"}';
  1049. $input = json_decode($data, true);
  1050. refill\RefillFactory::instance()->notify('weishengy',$input);
  1051. }
  1052. public function testWailingPhone()
  1053. {
  1054. $providers = new refill\wailing\RefillPhone([]);
  1055. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1056. $resp = $providers->query(['order_sn' => '73241618543784045618']);
  1057. $data = '{"order_id":"73241618543784045618","mchid":"10045","tel":"13699279618","price":"30.00","sign":"4991de3e40f14c198b8c194455ea021b","status":"0","out_order_id":"0"}';
  1058. $input = json_decode($data, true);
  1059. // refill\RefillFactory::instance()->notify('wailing',$input);
  1060. }
  1061. public function testShengyingPhone()
  1062. {
  1063. $providers = new refill\shengying\RefillPhone([]);
  1064. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1065. $resp = $providers->query(['order_sn' => '37571618805115582483']);
  1066. $data = '{"TaskID":"129636","Mobile":"13699279618","Status":"4","ReportTime":"2021-04-19T12:06:16.050","ReportCode":"1:511531522026586295","OutTradeNo":"37571618805115582483","ReceiptNum":"511531522026586295","Sign":"a7f46a988bc8483091d94130804e5078"}';
  1067. $input = json_decode($data, true);
  1068. // refill\RefillFactory::instance()->notify('shengying',$input);
  1069. }
  1070. public function testYunlingPhone()
  1071. {
  1072. $providers = new refill\yunling\RefillPhone([]);
  1073. // $resp = $providers->add(18074608795, 6, 30, ['order_sn' => $this->make_sn()]);
  1074. // $resp = $providers->query(['order_sn' => '73791623147517199719']);
  1075. // $data = '{"orderid":"EAF21060818183032772","sporderid":"73791623147517199719","userid":"10002504","merchantsubmittime":"20210608181912","resultno":"1","parvalue":"30","remark1":"1000000083421060818483137636","payno":"1000000083421060818483137636","fundbalance":"-28.59","sign":"8D77517AC3905ED88BF79EE789A5FA86"}';
  1076. // $input = json_decode($data, true);
  1077. // refill\RefillFactory::instance()->notify('yunling',$input);
  1078. $resp = $providers->balance();
  1079. }
  1080. public function testZhongstPhone()
  1081. {
  1082. $providers = new refill\zhongst\RefillPhone([]);
  1083. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1084. // $resp = $providers->query(['order_sn' => '48941618981770389271']);
  1085. // $data = ' {"szOrderId":"66571619060147539784","fSalePrice":"46.5","szAgentId":"200030","nFlag":"2","szVerifyString":"c1e88701b89a4887996822d708bed5f5","szPhoneNum":"13699279618","szRtnMsg":"161122673971","nDemo":"50"}';
  1086. // $input = json_decode($data, true);
  1087. // refill\RefillFactory::instance()->notify('zhongst',$input);
  1088. $resp = $providers->balance();
  1089. }
  1090. public function testXunaoPhone()
  1091. {
  1092. $providers = new refill\xunao\RefillPhone([]);
  1093. // $resp = $providers->add(18074608795, 6, 10, ['order_sn' => $this->make_sn()]);
  1094. // $resp = $providers->query(['order_sn' => '40021619431386253803', 'card_no' => 18074608795, 'card_type' => 6]);
  1095. // $data = '{"amount":"10.00","orderNo":"40021619431386253803","supplierId":"10","orderId":"S20210426180311761051424910","notifyTime":"1619431456411","sign":"c4eef22091831104be7ae95a0292c703","discountAmount":"0.50","phoneNo":"18074608795","queryUrl":"https:\/\/www.189.cn\/client\/wap\/wapproject\/wapclient\/feecharge\/feecharge_result.html?sessionid=f633d8a270aa4e5892d0f7ca6f09e95e","payType":"alipay","ticketNo":"1000000083421042618356072935","company":"dx","status":"2"}';
  1096. // $input = json_decode($data, true);
  1097. // refill\RefillFactory::instance()->notify('xunao',$input);
  1098. $resp = $providers->balance();
  1099. }
  1100. public function testYonghePhone()
  1101. {
  1102. $providers = new refill\yonghe\RefillPhone([]);
  1103. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1104. // $resp = $providers->query(['order_sn' => '20461619597297972685']);
  1105. // $data = '{"szOrderId":"20461619597297972685","fSalePrice":"29.955","szAgentId":"200115","nFlag":"2","szVerifyString":"b5c292a13c5e67a9b850eb37239682ae","szPhoneNum":"13699279618","szRtnMsg":"2021042822001139701437383521","nDemo":"30"}';
  1106. // $input = json_decode($data, true);
  1107. // refill\RefillFactory::instance()->notify('yonghe',$input);
  1108. $resp = $providers->balance();
  1109. }
  1110. public function testJumiPhone()
  1111. {
  1112. $providers = new refill\jumikc\RefillPhone([]);
  1113. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  1114. // $resp = $providers->query(['order_sn' => '12161619768293529384']);
  1115. // $data = '{"order_no":"12161619768293529384","channel_order_no":"C2104300338227862125","status":1,"money":"50.00","cost_money":"48.60","mch_no":210303112631,"account":"13699279618","official_sn":"","sign":"efa99b969f318ef934d8120ccfc77c3e"}';
  1116. // $input = json_decode($data, true);
  1117. // refill\RefillFactory::instance()->notify('jumi',$input);
  1118. $resp = $providers->balance();
  1119. }
  1120. public function testJumiOil()
  1121. {
  1122. $providers = new refill\jumi\RefillOil([]);
  1123. // $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
  1124. // $resp = $providers->query(['order_sn' => '29021620617872685187']);
  1125. $data = '{"order_no":"29021620617872685187","channel_order_no":"C2105101138061082025","status":1,"money":"100.00","cost_money":"98.00","mch_no":210303112631,"account":"1000111100021211884","official_sn":"","sign":"0914807052a04282aeb855f459fcc7b7"}';
  1126. $input = json_decode($data, true);
  1127. refill\RefillFactory::instance()->notify('jumi',$input);
  1128. }
  1129. public function testFengyePhone()
  1130. {
  1131. $providers = new refill\fengye\RefillPhone([]);
  1132. // $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
  1133. // $resp = $providers->query(['order_sn' => '53511620355988978053', 'card_no' => 18074608795, 'card_type' => 6]);
  1134. $data = '{"amount":"50.00","orderNo":"53511620355988978053","supplierId":"13","orderId":"S20210507105309202749918513","notifyTime":"1620356062365","sign":"371260b007f2e64d86873ce3ede67fa3","discountAmount":"2.50","phoneNo":"18074608795","queryUrl":"https:\/\/www.189.cn\/client\/wap\/wapproject\/wapclient\/feecharge\/feecharge_result.html?sessionid=e896e66c2e134ba3b469b26df34d12d1","payType":"wechat","ticketNo":"1000000083421050710397228882","company":"dx","status":"2"}';
  1135. $input = json_decode($data, true);
  1136. refill\RefillFactory::instance()->notify('fengye',$input);
  1137. }
  1138. public function testYunsuoyaoPhone()
  1139. {
  1140. $providers = new refill\yunsuoyao\RefillPhone([]);
  1141. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1142. // $resp = $providers->query(['order_sn' => '20431621331092296201']);
  1143. // $data = '{"orderid":"RLU21051817441937847","sporderid":"20431621331092296201","userid":"10002501","merchantsubmittime":"20210518174858","resultno":"9","parvalue":"30","remark1":"","payno":"","fundbalance":"-28.74","sign":"426EAC103B79505BAE7AB3F16886F1A8"}';
  1144. // $input = json_decode($data, true);
  1145. // refill\RefillFactory::instance()->notify('yunsuoyao',$input);
  1146. $resp = $providers->balance();
  1147. }
  1148. public function testAfdPhone()
  1149. {
  1150. $providers = new refill\afd\RefillPhone([]);
  1151. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1152. // $resp = $providers->query(['order_sn' => '71001621233525947994']);
  1153. $data = '{"code":"000","merchantorderId":"71001621233525947994","platformorderid":"aab01693204b95c4df1268313","orderid":"经度110103308082105171438580570638","rechargeno":"18500608333","amount":"50.00","payamount":"47.40000","rechargestate":"99","createtime":"2021-05-17 14:38:29","sign":"62d9af5833e1bf489998a0425107573f"}';
  1154. $input = json_decode($data, true);
  1155. refill\RefillFactory::instance()->notify('afd',$input);
  1156. }
  1157. public function testLuqianPhone()
  1158. {
  1159. $providers = new refill\luqian\RefillPhone([]);
  1160. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  1161. $resp = $providers->query(['order_sn' => '2829660672500596314764']);
  1162. $data = '{"amount":"100","charge_type":"0","code":"1","partner_id":"38","phone":"18500608333","sign":"c2c86cccc73fa991a63c369e683c91f2","partner_order_no":"34101618897099329575","official_order_id":"110103308072104201338340278420"}';
  1163. $input = json_decode($data, true);
  1164. // refill\RefillFactory::instance()->notify('luqian',$input);
  1165. }
  1166. public function testAfandfsPhone()
  1167. {
  1168. $providers = new refill\afandfs\RefillPhone([]);
  1169. // $resp = $providers->add(15139608757, 4, 30, ['order_sn' => $this->make_sn()]);
  1170. // $resp = $providers->query(['order_sn' => '65101618975926761630']);
  1171. // $data = '{"amount":"30","charge_type":"2","code":"1","partner_id":"52","phone":"15139608757","sign":"a7f54c1ac3e1af72f9fc849086cc4bec","partner_order_no":"65101618975926761630","official_order_id":"20210421113256628350"}';
  1172. // $input = json_decode($data, true);
  1173. // refill\RefillFactory::instance()->notify('afandfs',$input);
  1174. $resp = $providers->balance();
  1175. }
  1176. public function testYunlingfsPhone()
  1177. {
  1178. $providers = new refill\yunlingfs\RefillPhone([]);
  1179. // $resp = $providers->add(15139608757, 4, 50, ['order_sn' => $this->make_sn()]);
  1180. // $resp = $providers->query(['order_sn' => '79251623739433607563']);
  1181. // $data = '{"orderid":"BGC21061514434393910","sporderid":"79251623739433607563","userid":"10002543","merchantsubmittime":"20210615144434","resultno":"1","parvalue":"50","remark1":"20210615144420321813","payno":"20210615144420321813","fundbalance":"-47.65","sign":"6B9B7C15A3F9CBC773562327B6744B1E"}';
  1182. // $input = json_decode($data, true);
  1183. // refill\RefillFactory::instance()->notify('yunlingfs',$input);
  1184. $resp = $providers->balance();
  1185. }
  1186. public function testTianchengPhone()
  1187. {
  1188. $providers = new refill\tiancheng\RefillPhone([]);
  1189. // $resp = $providers->add(18074608795, 6, 30, ['order_sn' => $this->make_sn()]);
  1190. // $resp = $providers->query(['order_sn' => '15301619399212504464']);
  1191. // $data = ' {"result":"fail","msg":"0","order":"null","phone_no":"13699279618","amount":"10","op_no":"84801619340283980506","settle":"0","sign":"D64039ED791920B08BDA9DD95700C0E6"}';
  1192. // $input = json_decode($data, true);
  1193. // refill\RefillFactory::instance()->notify('tiancheng',$input);
  1194. $resp = $providers->balance();
  1195. }
  1196. public function testLingzhPhone()
  1197. {
  1198. $providers = new refill\lingzh\RefillPhone([]);
  1199. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  1200. // $resp = $providers->query(['order_sn' => '59911615124025101286']);
  1201. $resp = $providers->balance();
  1202. // $input['usr'] = 1;
  1203. // $input['ord'] = '52741615119546453690';
  1204. // $input['bz'] = '';
  1205. // $input['state'] = 2;
  1206. // $input['sgn'] = 'FFCBB75C307154DD306F4EC75BB69A6D';
  1207. // refill\RefillFactory::instance()->notify('lingzh',$input);
  1208. }
  1209. public function testAfandnewPhone()
  1210. {
  1211. $providers = new refill\afandnew\RefillPhone([]);
  1212. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  1213. // $resp = $providers->query(['order_sn' => '45371617101073876975', 'ch_trade_no' => '33018443659736309']);
  1214. $params = '{"amount":"100","carrierOrderNo":null,"mobile":"18500608333","orderNo":"45371617101073876975","orderStatus":3,"sign":"8DE392AD6B4730AD9EE0FC2B95BBDF17","tradeNo":"33018443659736309"}';
  1215. $input = json_decode($params, true);
  1216. refill\RefillFactory::instance()->notify('afandnew', $input);
  1217. }
  1218. public function testYifaPhone()
  1219. {
  1220. $providers = new refill\yifa\RefillPhone([]);
  1221. $resp = $providers->add(15120035568, 5, 50, ['order_sn' => $this->make_sn()]);
  1222. }
  1223. public function testTianjtOil()
  1224. {
  1225. $cardno = 1000111100021211884;
  1226. $providers = new refill\tianjt\RefillOil([]);
  1227. $resp = $providers->add($cardno, 2, 500, ['order_sn' => $this->make_sn()]);
  1228. }
  1229. public function testWeitPhone()
  1230. {
  1231. $providers = new refill\weit\RefillPhone([]);
  1232. for ($i = 0; $i <= 10; $i++) {
  1233. $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  1234. }
  1235. }
  1236. public function testWeitCB()
  1237. {
  1238. $params['sign'] = 'af820c33472f4b571fa0c48483dfb975';
  1239. $params['status'] = 0;
  1240. $params['price'] = 30;
  1241. $params['op_order_id'] = '';
  1242. $params['mch_order_id'] = '900664281823957221';
  1243. $params['pt_order_id'] = '2021011802434412825405218901';
  1244. $params['pay_type'] = '';
  1245. $params['tel'] = 18500608333;
  1246. $params['mchid'] = 10014;
  1247. $resp = http_request($this->mReqHost . "/mobile/refill_weit.php", $params, 'POST');
  1248. }
  1249. public function testYifaCB()
  1250. {
  1251. $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"}';
  1252. $input = json_decode($body, true);
  1253. refill\RefillFactory::instance()->notify('yifa', $input);
  1254. }
  1255. public function testBjbQuery()
  1256. {
  1257. $providers = new refill\bjb\RefillPhone([]);
  1258. $refill_info = ['order_sn' => 110667993758599771, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  1259. $resp = $providers->query($refill_info);
  1260. }
  1261. public function testXcQuery()
  1262. {
  1263. $providers = new refill\xc\RefillPhone([]);
  1264. $refill_info = ['order_sn' => 950663423236726632, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  1265. $resp = $providers->query($refill_info);
  1266. }
  1267. public function testTianjtQuery()
  1268. {
  1269. $providers = new refill\tianjt\RefillOil([]);
  1270. $refill_info = ['order_sn' => 680665862267622221, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  1271. $resp = $providers->query($refill_info);
  1272. }
  1273. public function testSaihuOil()
  1274. {
  1275. $providers = new refill\saihu\RefillOil([]);
  1276. $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
  1277. }
  1278. public function testBdtOil()
  1279. {
  1280. $providers = new refill\bdt\RefillOil([]);
  1281. $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => '200229600556618886']);
  1282. }
  1283. public function testGFTDOil()
  1284. {
  1285. $providers = new refill\gftd\RefillOil([]);
  1286. $resp = $providers->add(1000111100020445281, mtopcard\SinopecCard, 100, ['order_sn' => $this->make_sn()]);
  1287. }
  1288. public function testYichangtOil()
  1289. {
  1290. $providers = new refill\yichangt\RefillOil([]);
  1291. $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 200, ['order_sn' => $this->make_sn()]);
  1292. // $resp = $providers->query(['order_sn' => '87591620379260314044']);
  1293. $data = '{"appid":"app570259129507","order_id":"M202105077888184428723706","merchant_order_id":"82231620378877155624","status":"3","cash":"100","time":"1620378961450","nonce":"2fad56d59a9f46d896c15b0cff74bc","signature":"57a6d24ec376b58bb433cfcf8528d53cb276eac8"}';
  1294. $input = json_decode($data, true);
  1295. // refill\RefillFactory::instance()->notify('yichangt',$input);
  1296. }
  1297. public function testGFTDCB()
  1298. {
  1299. $data = '{"channelOrderNumber":"79091610959059372019","orderNumber":"GYFL1610959060397001","message":"充值成功","storage":"881036222bd8f067ff47d248c75f4c8d","voucher":"","status":101}';
  1300. $url = "http://192.168.1.220/mobile/refill_gftd.php?" . $data;
  1301. $resp = http_post_data($url, $data, ['Content-Type: application/json;charset=UTF-8;', 'Accept:application/json;charset=UTF-8;']);
  1302. }
  1303. public function testJiecPhone()
  1304. {
  1305. $providers = new refill\jiec\RefillPhone([]);
  1306. $resp = $providers->add('18500608333', 5, 30, ['order_sn' => $this->make_sn()]);
  1307. }
  1308. public function testBxtwtCB()
  1309. {
  1310. $data = '{"order_number":18219726,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"863b4d972f2a4d39a9af7396879116c4","voucher":"","vouchertype":"","voucherurl":"","tradeNo":"100662475851197741"}';
  1311. }
  1312. public function testTianjtJDVerify()
  1313. {
  1314. $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';
  1315. $url = "http://192.168.1.220/mobile/refill_tianjt.php?" . $data;
  1316. $resp = http_request($url);
  1317. }
  1318. public function testSuhcPDD()
  1319. {
  1320. $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';
  1321. $url = "https://www.xyzshops.cn/mobile/refill_suhcpdd.php?" . $data;
  1322. $resp = http_request($url);
  1323. }
  1324. public function testSuhcTMVerify()
  1325. {
  1326. $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';
  1327. $url = "https://www.xyzshops.cn/mobile/refill_suhctm.php?" . $data;
  1328. $resp = http_request($url);
  1329. }
  1330. public function testBeixtVerify()
  1331. {
  1332. $data = '{"order_number":18219726,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"863b4d972f2a4d39a9af7396879116c4","voucher":"","vouchertype":"","voucherurl":"","tradeNo":"100662475851197741"}';
  1333. $url = "https://www.xyzshops.cn/mobile/refill_bxtwt.php";
  1334. $headers = ['Content-Type: application/json'];
  1335. $resp = http_post_data($url, $data, $headers);
  1336. }
  1337. public function testInput()
  1338. {
  1339. $input = fopen("php://input", "rw");
  1340. file_put_contents($input, 'xxxx');
  1341. $content = file_get_contents('php://input');
  1342. }
  1343. public function testUrl()
  1344. {
  1345. $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';
  1346. $params = preg_split('/&/', $data);
  1347. foreach ($params as $pair) {
  1348. $kv = explode('=', $pair);
  1349. $count = count($kv);
  1350. if ($count === 1) {
  1351. $key = $kv[0];
  1352. $val = "";
  1353. } elseif ($count === 2) {
  1354. $key = $kv[0];
  1355. $val = $kv[1];
  1356. } else {
  1357. continue;
  1358. }
  1359. Log::record("{$key}:{$val}", Log::DEBUG);
  1360. }
  1361. }
  1362. public function testAddoil()
  1363. {
  1364. $url = $this->mReqHost . "/mobile/index.php";
  1365. $notifyurl = 'http://121.89.196.45/mobile/signature.php';
  1366. $params = ['mchid' => $this->mMchid,
  1367. 'cardno' => '1000111100020445281',
  1368. 'amount' => "100",
  1369. "act" => "refill",
  1370. "op" => "add",
  1371. 'order_sn' => $this->make_sn(),
  1372. 'notifyurl' => $notifyurl];
  1373. $resp = $this->send_md5($url, $params);
  1374. Log::record($resp, Log::DEBUG);
  1375. }
  1376. public function testBalance()
  1377. {
  1378. $url = $this->mReqHost . "/mobile/index.php";
  1379. $params = ['mchid' => 1092,
  1380. "act" => "refill",
  1381. "op" => "balance"];
  1382. $resp = $this->send_md5($url, $params);
  1383. Log::record($resp, Log::DEBUG);
  1384. }
  1385. public function testAddPhoe()
  1386. {
  1387. $url = $this->mReqHost . "/mobile/index.php";
  1388. $params = ['mchid' => $this->mMchid,
  1389. 'cardno' => '',
  1390. 'amount' => 100,
  1391. "act" => "refill",
  1392. "op" => "add",
  1393. 'order_sn' => '',
  1394. 'notifyurl' => "https://www.baoyung.com/api/unionservice/yezicharge"];
  1395. Log::record(json_encode($params), Log::DEBUG);
  1396. // $resp = $this->send_md5($url, $params);
  1397. }
  1398. public function testProxyHelper()
  1399. {
  1400. $phone = '13911129867';
  1401. $amount = 100;
  1402. $url = $this->mReqHost . "/mobile/index.php";
  1403. $params = ['mchid' => $this->mMchid,
  1404. 'cardno' => $phone,
  1405. 'amount' => $amount,
  1406. "act" => "refill",
  1407. "op" => "add",
  1408. 'order_sn' => $this->make_sn(),
  1409. 'notifyurl' => "https://xxx"];
  1410. $proxy = new refill_proxy("xxx");
  1411. $resp = $proxy->send($url, $params);
  1412. }
  1413. public function testGoods()
  1414. {
  1415. $req_url = $this->mReqHost . '/mobile/index.php';
  1416. $params = ['mchid' => $this->mMchid,
  1417. "act" => "refill",
  1418. "op" => "goods"];
  1419. $resp = $this->send_md5($req_url, $params);
  1420. }
  1421. public function testQueryFactory()
  1422. {
  1423. refill\RefillFactory::instance()->query(295);
  1424. }
  1425. public function testQuery()
  1426. {
  1427. //$req_url = 'https://www.xyzshops.cn/mobile/index.php';
  1428. // $notifyurl = 'https://www.xyzshops.cn/mobile/signature.php';
  1429. $req_url = BASE_SITE_URL . '/mobile/index.php';
  1430. $notifyurl = 'https://www.xyzshops.cn/mobile/signature.php';
  1431. $params = ['mchid' => 1,
  1432. "act" => "refill",
  1433. "op" => "query",
  1434. 'order_sn' => "13281476"];
  1435. $resp = $this->send_md5($req_url, $params);
  1436. }
  1437. public function testRemoveSession()
  1438. {
  1439. $resp = http_request(BASE_SITE_URL . "/mobile/signature.php", [], 'POST');
  1440. }
  1441. public function testTianjtCB()
  1442. {
  1443. // $notifyurl = BASE_SITE_URL . "/mobile/refill_tianjt.php";
  1444. $notifyurl = "https://www.xyzshops.cn/mobile/refill_tianjt.php";
  1445. // $notifyurl = "https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_tianjt.php";
  1446. $params = ['onlystr' => '690665858589475818',
  1447. 'amt' => 1000,
  1448. 'jdno' => '',
  1449. 'notifyurl' => $notifyurl,
  1450. 'cardtype' => 'Sinoepc',
  1451. 'batchid' => 30589,
  1452. 'cardno' => '1000113300007993287',
  1453. 'orgid' => '1590993600',
  1454. 'status' => 3];
  1455. $sign = $this->md5_sign($params);
  1456. $params['sign'] = $sign;
  1457. $resp = http_request($notifyurl, $params, 'POST');
  1458. Log::record($resp, Log::DEBUG);
  1459. }
  1460. public function testBJBCB()
  1461. {
  1462. $params = [
  1463. 'usr' => '13699279618',
  1464. 'ord' => '710662733975412771',
  1465. 'state' => '2',
  1466. 'bz' => '',
  1467. 'sgn' => 'AC9AFD254DE682D8440A97CA68B992DA'
  1468. ];
  1469. $resp = http_request("https://www.xyzshops.cn/mobile/refill_bjb.php", $params, 'POST');
  1470. }
  1471. public function testJiecCB()
  1472. {
  1473. $params['result'] = 'fail';
  1474. $params['msg'] = '0';
  1475. $params['order'] = 'null';
  1476. $params['phone_no'] = '18500608333';
  1477. $params['amount'] = '30.00';
  1478. $params['op_no'] = '800663597981819221';
  1479. $params['sign'] = '2510046895e8e12322c8a32547905ee9';
  1480. $resp = http_request($this->mReqHost . "/mobile/refill_jiec.php", $params, 'POST');
  1481. }
  1482. public function testZFKJ()
  1483. {
  1484. //带签名参数:mchid=1090&act=refill&op=add&cardno=100112121212212133
  1485. //&amount=10&order_sn=PH2012261356569433&
  1486. //notifyurl=https%3A%2F%2Fqzcz.edusahoo.com.cn%2Findex%2Findex%2Fcallback
  1487. //&sign=4a3ac5f9706e64aa70c6cab0fc5839d3
  1488. $params = ['mchid' => 1090,
  1489. 'cardno' => '100112121212212133',
  1490. 'amount' => '10',
  1491. "act" => "refill",
  1492. "op" => "add",
  1493. 'order_sn' => 'PH2012261356569433',
  1494. 'notifyurl' => 'https://qzcz.edusahoo.com.cn/index/index/callback'];
  1495. $resp = $this->send_md5(BASE_SITE_URL . '/mobile/index.php', $params);
  1496. }
  1497. protected function check_empty($value)
  1498. {
  1499. if (!isset($value))
  1500. return true;
  1501. if ($value === null)
  1502. return true;
  1503. if (trim($value) === "")
  1504. return true;
  1505. return false;
  1506. }
  1507. public function testcreateSign()
  1508. {
  1509. $params['act'] = 'refill';
  1510. $params['amount'] = '30';
  1511. $params['cardno'] = '18111516552';
  1512. $params['mchid'] = '10179';
  1513. $params['notifyurl'] = 'http://czapi2.1jinb.net/YeZiHCCallBackOrderServlet';
  1514. $params['op'] = 'add';
  1515. $params['order_sn'] = 'JFNOR10835056877';
  1516. $sign = $this->md5_sign($params);
  1517. }
  1518. public function testCheckphone()
  1519. {
  1520. $check = function ($phone) {
  1521. $url = 'https://mobileempty.shumaidata.com/mobileempty';
  1522. $params['mobile'] = $phone;
  1523. $headers = array();
  1524. array_push($headers, "Authorization:APPCODE " . '8f92d951293f4d2ea48ff86d5a70c537');
  1525. $resp = http_request($url, $params, 'GET', false, $headers);
  1526. $resp = json_decode($resp, true);
  1527. if ($resp['success'] == true && $resp['code'] == 200) {
  1528. Log::record("data phone:{$phone} , status : {$resp['data']['status']}", Log::DEBUG);
  1529. if (in_array($resp['data']['status'], [0, 3, 4, 5])) {
  1530. return false;
  1531. }
  1532. } else {
  1533. Log::record("data phone:{$phone} , 不支持的号段", Log::DEBUG);
  1534. }
  1535. };
  1536. $check(17801048874);
  1537. }
  1538. public function testCtSign()
  1539. {
  1540. $params['act'] = 'refill';
  1541. $params['amount'] = 1;
  1542. $params['cardno'] = 18888888888;
  1543. $params['mchid'] = 1101;
  1544. $params['op'] = 'add';
  1545. $params['notifyurl'] = '';
  1546. $params['order_sn'] = '1231212';
  1547. $sign = $this->md5_sign($params);
  1548. }
  1549. private function md5_sign($params)
  1550. {
  1551. ksort($params);
  1552. $body = "";
  1553. $i = 0;
  1554. foreach ($params as $k => $v) {
  1555. if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
  1556. if ($i == 0) {
  1557. $body .= "{$k}" . "=" . urlencode($v);
  1558. } else {
  1559. $body .= "&" . "{$k}" . "=" . urlencode($v);
  1560. }
  1561. $i++;
  1562. }
  1563. }
  1564. $body .= "&key=E63AFB19FA130AC0E35C5BD1C42470A5";
  1565. return md5($body);
  1566. }
  1567. public function testCallMech()
  1568. {
  1569. $logic = Logic('queue');
  1570. $logic->NotifyMerchantComplete(['order_id' => 18171, 'manual' => true]);
  1571. }
  1572. //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefill::testCallMech)( .*)?$/" --test-suffix TestRefill.php /var/www/html/test
  1573. private function send($url, $params)
  1574. {
  1575. $mchid = $params['mchid'];
  1576. $pri_key = BASE_DATA_PATH . "/api/merchant/key/{$mchid}_pri.pem";
  1577. $key = file_get_contents($pri_key);
  1578. $pri = openssl_get_privatekey($key);
  1579. $body = $this->body($params);
  1580. openssl_sign($body, $signed, $pri);
  1581. $sign = base64_encode($signed);
  1582. $params['sign'] = $sign;
  1583. $resp = http_request($url, $params, 'POST');
  1584. Log::record("resp:{$resp}", Log::DEBUG);
  1585. }
  1586. private function send_md5($url, $params)
  1587. {
  1588. $body = $this->body($params);
  1589. $body .= "&key={$this->mKey}";
  1590. $params['sign'] = md5($body);
  1591. $resp = http_request($url, $params, 'POST');
  1592. Log::record("resp:{$resp}", Log::DEBUG);
  1593. return $resp;
  1594. }
  1595. public function testCardType()
  1596. {
  1597. $cardno = '1000111100021211884';
  1598. $ret = preg_match('/^1[0-9]{18}$/', $cardno, $matches);
  1599. }
  1600. public function testMtrand()
  1601. {
  1602. }
  1603. public function testHttpRefill()
  1604. {
  1605. $mchid = '000001';
  1606. $pri_key = BASE_DATA_PATH . "/api/merchant/key/{$mchid}_pri.pem";
  1607. $key = file_get_contents($pri_key);
  1608. $pri = openssl_get_privatekey($key);
  1609. $params = ['MCHID' => $mchid, 'cardno' => '1000111100021211884', 'amt' => "100", "act" => "refill", "op" => "addoil"];
  1610. $body = $this->body($params);
  1611. openssl_sign($body, $signed, $pri);
  1612. $sign = base64_encode($signed);
  1613. $params['sign'] = $sign;
  1614. $resp = http_request(BASE_SITE_URL . "/mobile/index.php", $params, 'POST');
  1615. }
  1616. private function body($params)
  1617. {
  1618. ksort($params);
  1619. $body = "";
  1620. $i = 0;
  1621. foreach ($params as $k => $v) {
  1622. if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) {
  1623. if ($i == 0) {
  1624. $body .= "{$k}" . "=" . urlencode($v);
  1625. } else {
  1626. $body .= "&" . "{$k}" . "=" . urlencode($v);
  1627. }
  1628. $i++;
  1629. }
  1630. }
  1631. return $body;
  1632. }
  1633. private function checkEmpty($value)
  1634. {
  1635. if (!isset($value))
  1636. return true;
  1637. if ($value === null)
  1638. return true;
  1639. if (trim($value) === "")
  1640. return true;
  1641. return false;
  1642. }
  1643. public function testKsort()
  1644. {
  1645. $age = ["Peter" => "35", "Ben" => "37", "Joe" => "43"];
  1646. ksort($age);
  1647. foreach ($age as $x => $x_value) {
  1648. echo "Key=" . $x . ", Value=" . $x_value;
  1649. echo "<br>";
  1650. }
  1651. }
  1652. public function testip()
  1653. {
  1654. $model_merchant = Model('merchant');
  1655. $merchant_info = $model_merchant->getMerchantInfo(['mchid' => 1]);
  1656. $ipwhitelist = unserialize($merchant_info['ip_white_list']);
  1657. $res = json_encode($ipwhitelist);
  1658. }
  1659. //测试向内部店提交订单,可先屏蔽其它充值通道
  1660. public function testAddoilToInnerStore()
  1661. {
  1662. $url = $this->mReqHost . "/mobile/index.php";
  1663. $notifyurl = BASE_SITE_URL . '/mobile/signature.php';
  1664. $params = ['mchid' => 1,
  1665. 'cardno' => '1000111100020445281',
  1666. 'amount' => "1000",
  1667. "act" => "refill",
  1668. "op" => "add",
  1669. 'order_sn' => $this->make_sn(),
  1670. 'notifyurl' => $notifyurl];
  1671. $resp = $this->send_md5($url, $params);
  1672. Log::record($resp, Log::DEBUG);
  1673. }
  1674. public function testRefillInnerCB()
  1675. {
  1676. $params = ['state_type' => 'order_cancel', 'order_id' => 311, 'channel_name' => 'lx'];
  1677. $resp = http_request(BASE_SITE_URL . '/mobile/refill_inner.php', $params, 'POST');
  1678. }
  1679. public function testArgs()
  1680. {
  1681. Log::record($_SERVER['argv'], Log::DEBUG);
  1682. }
  1683. public function testCall()
  1684. {
  1685. $order_id = 14974;
  1686. QueueClient::async_push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => true], 10);
  1687. }
  1688. public function testSyncconfig()
  1689. {
  1690. $name_val_cfg = function ($items) {
  1691. $result = [];
  1692. foreach ($items as $item) {
  1693. $name = $item->name();
  1694. $result[$name] = $item;
  1695. }
  1696. return $result;
  1697. };
  1698. $name_val_row = function ($items) {
  1699. $result = [];
  1700. foreach ($items as $item) {
  1701. $name = $item['name'];
  1702. $result[$name] = $item;
  1703. }
  1704. return $result;
  1705. };
  1706. $match = function ($all, $cur) {
  1707. $insert = [];
  1708. foreach ($all as $key => $value) {
  1709. if (!array_key_exists($key, $cur)) {
  1710. $insert[] = $key;
  1711. }
  1712. }
  1713. return $insert;
  1714. };
  1715. $inserter = function ($mod, $type, $names) {
  1716. foreach ($names as $name) {
  1717. $data = ['name' => $name, 'type' => $type];
  1718. $mod->insert($data);
  1719. }
  1720. };
  1721. $providers = refill\RefillFactory::instance()->providers();
  1722. $oils = $name_val_cfg($providers['oil']);
  1723. $phones = $name_val_cfg($providers['phone']);
  1724. $mod_prov = Model('refill_provider');
  1725. $oil_items = $mod_prov->getProviderList(['type' => 1]);
  1726. $oil_items = $name_val_row($oil_items);
  1727. $oil_inserts = $match($oils, $oil_items);
  1728. $phone_items = $mod_prov->getProviderList(['type' => 2]);
  1729. $phone_items = $name_val_row($phone_items);
  1730. $phone_inserts = $match($phones, $phone_items);
  1731. $inserter($mod_prov, 1, $oil_inserts);
  1732. $inserter($mod_prov, 2, $phone_inserts);
  1733. }
  1734. public function testStat()
  1735. {
  1736. $model_refill_order = Model('refill_order');
  1737. $stat = Model('')->table('refill_order,vr_order')->join('inner')
  1738. ->on('refill_order.order_id=vr_order.order_id')
  1739. ->field('sum(refill_amount) as refill_amounts , sum(channel_amount) as channel_amounts , sum(mch_amount) as mch_amounts')
  1740. ->where([])->select();
  1741. }
  1742. public function testRefillGoods()
  1743. {
  1744. $goods = refill\RefillFactory::instance()->goods();
  1745. }
  1746. private function make_mobile()
  1747. {
  1748. $no = "1" . mt_rand(3000000000, 3999999999);
  1749. return $no;
  1750. }
  1751. private function refill_info($card_no, $card_type)
  1752. {
  1753. $data = rcache($card_no, 'cardrefill-');
  1754. if (empty($data)) {
  1755. $mod_topcard = Model('topcard');
  1756. $ret = $mod_topcard->get_card($card_no);
  1757. if (empty($ret)) {
  1758. $bind_phone = $this->make_mobile();
  1759. $mod_topcard->add($card_no, $card_type, time(), $bind_phone);
  1760. $data['bind_phone'] = $bind_phone;
  1761. $data['refill_time'] = time();
  1762. $data['times'] = 0;
  1763. wcache($card_no, $data, 'cardrefill-');
  1764. } else {
  1765. $val = $ret[0];
  1766. $data['bind_phone'] = $val['bind_phone'];
  1767. $data['refill_time'] = time();
  1768. $data['times'] = 0;
  1769. }
  1770. }
  1771. return $data;
  1772. }
  1773. public function testGetMobile()
  1774. {
  1775. $card_no = '1000119000001679247';
  1776. $card_type = 1;
  1777. $info = $this->refill_info($card_no, $card_type);
  1778. }
  1779. private function check_mchorder($mchid, $mch_order)
  1780. {
  1781. if (empty($mch_order)) {
  1782. return true;
  1783. } else {
  1784. $refill_order = Model('refill_order');
  1785. $ret = $refill_order->getOrderInfo(['mchid' => $mchid, 'mch_order' => $mch_order]);
  1786. return empty($ret);
  1787. }
  1788. }
  1789. public function testCheckMchorder()
  1790. {
  1791. $ret = $this->check_mchorder(1, '13281475');
  1792. }
  1793. public function testMakemobile()
  1794. {
  1795. $mobile = refill\util::make_mobile();
  1796. $ret = refill\util::set_black('1000111100020445281');
  1797. }
  1798. public function testLoadBlack()
  1799. {
  1800. $path = BASE_DATA_PATH . "/log";
  1801. $names = ['20210119-mobile.log',
  1802. '20210120-mobile.log', '20210121-mobile.log', '20210122-mobile.log', '20210123-mobile.log',
  1803. '20210124-mobile.log', '20210125-mobile.log'];
  1804. foreach ($names as $name) {
  1805. $file_name = $path . "/" . $name;
  1806. refill\util::black_from_log($file_name);
  1807. }
  1808. }
  1809. public function testStats()
  1810. {
  1811. $date = date('Y-m-d', time());
  1812. $today = strtotime("{$date}");
  1813. $times_begin = function ($start) {
  1814. $times = [];
  1815. $begin = $start;
  1816. for ($i = 0; $i < 7; $i++) {
  1817. $times[] = $begin;
  1818. $begin -= 86400;
  1819. }
  1820. return $times;
  1821. };
  1822. $reader = function ($mchid, $time) {
  1823. $cond['mchid'] = $mchid;
  1824. $cond['inner_status'] = 0;
  1825. $cond['refill_order.order_time'] = ['between', [$time, $time + 86400 - 1]];
  1826. $items = Model('')->table('refill_order,vr_order')->join('inner')
  1827. ->on('refill_order.order_id=vr_order.order_id')
  1828. ->field('count(*) as order_count, vr_order.order_state, sum(mch_amount) as mch_amounts')
  1829. ->group('vr_order.order_state')
  1830. ->where($cond)->select();
  1831. return $items;
  1832. };
  1833. $begins = $times_begin($today);
  1834. $mchid = 10096;
  1835. // $states = rcache($this->mchid() , 'refillstat-');
  1836. $states = unserialize($states ?? "");
  1837. if (empty($states)) $states = [];
  1838. $result = [];
  1839. $cache = [];
  1840. foreach ($begins as $begin) {
  1841. if (array_key_exists($begin, $states)) {
  1842. $item = $states[$begin];
  1843. } else {
  1844. $item = $reader($mchid, $begin);
  1845. }
  1846. $result[$begin] = $item;
  1847. //判断item 中充值中的状态是否为0,为0的情况下放进cache
  1848. $cache = $item;
  1849. }
  1850. wcache($this->mchid(), $cache, 'refillstat-');
  1851. return $result;
  1852. }
  1853. public function testNotifyx()
  1854. {
  1855. $mch_cache = rcache("merchant-notify", 'refill-');
  1856. $caches = empty($mch_cache['data']) ? [] : unserialize($mch_cache['data']);
  1857. $new_caches = [];
  1858. $merchants = Model('merchant')->getMerchantList([], '', '', 'merchant.*,member.available_predeposit', "0,1000");
  1859. foreach ($merchants as $merchant) {
  1860. $mchid = $merchant['mchid'];
  1861. $phone = $merchant['contact_phone'] ?? "";
  1862. $available_pd = intval($merchant['available_predeposit']);
  1863. $alarm_pd = intval($merchant['alarm_amount']) < 10000 ? 10000 : intval($merchant['alarm_amount']);
  1864. if (array_key_exists($mchid, $caches)) {
  1865. $mch_cache = $caches[$mchid];
  1866. } else {
  1867. $mch_cache = ['last_time' => 0, 'send_count' => 0];
  1868. }
  1869. if (!empty($phone) && ($available_pd < $alarm_pd)) {
  1870. $counts = $mch_cache['send_count'];
  1871. if (($mch_cache['last_time'] + 300 < time()) && $counts < 5) {
  1872. $mch_cache = ['last_time' => time(), 'send_count' => $counts + 1];
  1873. QueueClient::push('sendSMS', ['mobile' => $merchant['contact_phone'],
  1874. 'type' => 'balance_warning', 'datas' => [date("m月d日H时"), $merchant['available_predeposit']]]);
  1875. }
  1876. } else {
  1877. $mch_cache = ['last_time' => 0, 'send_count' => 0];
  1878. }
  1879. $new_caches[$mchid] = $mch_cache;
  1880. }
  1881. wcache("merchant-notify", ['data' => serialize($new_caches)], 'refill-');
  1882. }
  1883. public function testReadChannel()
  1884. {
  1885. refill\RefillFactory::instance()->read_channel();
  1886. }
  1887. public function testAllow()
  1888. {
  1889. $allow = refill\RefillFactory::instance()->allow(10096, 1, 100);
  1890. }
  1891. public function testCheckData()
  1892. {
  1893. $str = '|2|110667993758599771-充值失败|';
  1894. // $str = '0|提交成功|-36557.7400';
  1895. // if(preg_match( '/^-*[0-9]{1,3}\|[\x{4e00}-\x{9fa5}]+\|-*[0-9]+\.*[0-9]+$/u',$str,$matches)) {
  1896. // return true;
  1897. // }
  1898. // if(preg_match('/^[0-3]\|[0-9]+-*[\x{4e00}-\x{9fa5}]+\|[0-9]*$/u',$str,$matches)){
  1899. // return true;
  1900. // }
  1901. // return false;
  1902. $resp = ltrim($str, '|');
  1903. $resp = explode('|', $resp);
  1904. if (count($resp) != 3) {
  1905. return [false, '返回值错误'];
  1906. }
  1907. }
  1908. public function testErrre()
  1909. {
  1910. $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}';
  1911. $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);
  1912. }
  1913. public function testExpolode()
  1914. {
  1915. $x = "HTTP-504";
  1916. [$type,$code] = explode('-',$x);
  1917. }
  1918. public function testMchctl()
  1919. {
  1920. $ctl = new refill\mchctl();
  1921. }
  1922. public function testAsyncadd()
  1923. {
  1924. $x = \refill\util::async_add(['xxxx' => 1],4);
  1925. }
  1926. private function getProvider($name,$type = 'RefillPhone')
  1927. {
  1928. $file = BASE_HELPER_RAPI_PATH . "/$name/{$type}.php";
  1929. if(!file_exists($file)){
  1930. Log::record("provider api file={$file} not exist.",Log::DEBUG);
  1931. return false;
  1932. } else {
  1933. require_once($file);
  1934. Log::record("file={$file} load success.",Log::DEBUG);
  1935. }
  1936. $class_name = "refill\\{$name}\\{$type}";
  1937. if (class_exists($class_name, false)) {
  1938. $caller = new $class_name([]);
  1939. return $caller;
  1940. } else {
  1941. $error = "Base Error: class {$class_name} isn't exists!";
  1942. Log::record($error, Log::ERR);
  1943. return false;
  1944. }
  1945. }
  1946. }
  1947. //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefill::testLoadBlack)( .*)?$/" --test-suffix TestRefill.php /var/www/html/test
  1948. //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