TestRefill.php 128 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792
  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. $params = [
  46. "mchid" => 10193,
  47. "order_sn" => 'open1632462013152110599086',
  48. "amount" => '100.0000',//intval($refill_info['refill_amount'] + 0.05),
  49. "cardno" => 18505101761,
  50. "trade_no" => '4034130685806092699201',
  51. "idcard" => $refill_info['idcard'] ?? "",
  52. "card_name" => $refill_info['card_name'] ?? "",
  53. 'official_sn' => '110103353072109241341340249560',
  54. 'message' => '',
  55. "state" => 'SUCCESS'
  56. ];
  57. $params['sign'] = $this->md5_sign($params, '0a845c18fbefaa121f36169ab8c880f3');
  58. $notify_url = 'http://v3.biyingniao.com/web/yezi/v2/straight_url?from=equityOpen';
  59. $resp = http_request($notify_url, $params, 'POST');
  60. }
  61. public function testFactory()
  62. {
  63. $providers = refill\RefillFactory::instance();
  64. }
  65. private function make_sn()
  66. {
  67. return mt_rand(1000, 9999)
  68. . sprintf('%010d', time())
  69. . sprintf('%06d', (float)microtime() * 1000000);
  70. }
  71. public function testRandomMobile()
  72. {
  73. $no = "1" . mt_rand(1, 9999999999);
  74. Log::record("phone no={$no}", Log::DEBUG);
  75. }
  76. public function testBJBAddPhone()
  77. {
  78. $providers = new refill\bjb\RefillPhone([]);
  79. for ($i = 3; $i > 0; --$i) {
  80. $resp = $providers->add(13911129867, 4, 10, ['order_sn' => $this->make_sn()]);
  81. $resp = $providers->add(18500608333, 4, 10, ['order_sn' => $this->make_sn()]);
  82. $resp = $providers->add(18510683168, 4, 10, ['order_sn' => $this->make_sn()]);
  83. $resp = $providers->add(18513846008, 4, 10, ['order_sn' => $this->make_sn()]);
  84. $resp = $providers->add(18518237398, 4, 10, ['order_sn' => $this->make_sn()]);
  85. }
  86. }
  87. public function testOilticket()
  88. {
  89. $providers = new refill\bjb\RefillPhone([]);
  90. }
  91. public function testBjbRet()
  92. {
  93. $resp = '0|提交成功|14936.8600';
  94. $resp = explode('|', $resp);
  95. }
  96. public function testIpWhiteList()
  97. {
  98. $x = serialize(['47.99.57.105']);
  99. $ips = unserialize('a:1:{i:0;s:12:"47.99.57.105";}');
  100. if (!empty($ips)) {
  101. $addr = '47.99.57.105';
  102. Log::record("request ip:{$addr}", Log::DEBUG);
  103. if (!in_array($addr, $ips)) {
  104. throw new Exception("请求地址不在白名单中");
  105. }
  106. }
  107. }
  108. public function testBaizePhone()
  109. {
  110. $providers = new refill\baizeyd\RefillPhone([]);
  111. // $resp = $providers->add(17801048874, 5, 10, ['order_sn' => $this->make_sn()]);
  112. $resp = $providers->query(['order_sn' => '930668700375312006']);
  113. // $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';
  114. // $input = $this->parse_request($str);
  115. // $input['amount'] = 10.00;
  116. // $input['orderId'] = '92391614943913061206';
  117. // $input['phone'] = 17801048874;
  118. // $input['payTime'] = '2021-03-05 19:31:55';
  119. // $input['sign'] = 'bef6ae50319fb1e8cb3f21302f0abef8';
  120. // $input['appKey'] = 'uECmTOFAY6RPCTtI';
  121. // $input['payUrl'] = '';
  122. // $input['statusDes'] = '支付失败';
  123. // $input['status'] = 7;
  124. // refill\RefillFactory::instance()->notify('baizeyd',$input);
  125. }
  126. private function parse_request($squery)
  127. {
  128. if (empty($squery)) return [];
  129. $result = [];
  130. $params = preg_split('/&/', $squery);
  131. foreach ($params as $pair) {
  132. if (empty($pair)) continue;
  133. $kv = explode('=', $pair);
  134. $count = count($kv);
  135. if ($count === 1) {
  136. $key = $kv[0];
  137. $val = "";
  138. } elseif ($count === 2) {
  139. $key = $kv[0];
  140. $val = urldecode($kv[1]);
  141. } else {
  142. continue;
  143. }
  144. if (!empty($key)) {
  145. $result[$key] = $val;
  146. }
  147. }
  148. return $result;
  149. }
  150. public function testAmPhone()
  151. {
  152. // $providers = new refill\aming\RefillPhone([]);
  153. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  154. $input['result'] = 'fail';
  155. $input['msg'] = 0;
  156. $input['order'] = 'null';
  157. $input['phone_no'] = 18500608333;
  158. $input['sign'] = 'c925ad19c63c3eb36ffc52d938e24604';
  159. $input['amount'] = '10.00';
  160. $input['op_no'] = '42601615096072517841';
  161. refill\RefillFactory::instance()->notify('aming', $input);
  162. }
  163. public function testBhcPhone()
  164. {
  165. $providers = new refill\binghc\RefillPhone([]);
  166. $resp = $providers->query(['order_sn' => 250668618955902006]);
  167. // $input['result'] = 'fail';
  168. // $input['msg'] = 0;
  169. // $input['order'] = 'null';
  170. // $input['phone_no'] = 18500608333;
  171. // $input['sign'] = 'c3aa38ee07cd1b69bfd5ead56f6da8d6';
  172. // $input['amount'] = '10.00';
  173. // $input['op_no'] = '24061615096361999002';
  174. // refill\RefillFactory::instance()->notify('binghc',$input);
  175. }
  176. public function testRuishunPhone()
  177. {
  178. // $providers = new refill\ruishun\RefillPhone([]);
  179. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  180. $input['result'] = 'fail';
  181. $input['msg'] = 0;
  182. $input['order'] = null;
  183. $input['phone_no'] = 18500608333;
  184. $input['sign'] = 'e234f7d1c0458ca236f53a0008436b46';
  185. $input['amount'] = "10.00";
  186. $input['op_no'] = '76361615095403188513';
  187. refill\RefillFactory::instance()->notify('ruishun', $input);
  188. }
  189. public function testWuchenPhone()
  190. {
  191. $providers = new refill\wuchen\RefillPhone([]);
  192. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  193. $resp = $providers->query(['order_sn' => '790668630498425006']);
  194. // $input['app_id'] = '70016';
  195. // $input['message'] = 'fail';
  196. // $input['order_sn'] = '43101615277293035501';
  197. // $input['platform_order_id'] = '';
  198. // $input['sign'] = '5ea59f8ac51a518f2c622824d7db2a04';
  199. // $input['state'] = "fail";
  200. // $input['sys_sn'] = '202103091608231836913889';
  201. // $input['timestamp'] = '1615277361';
  202. // refill\RefillFactory::instance()->notify('wuchen',$input);
  203. }
  204. public function testYibaoPhone()
  205. {
  206. $providers = new refill\yibao\RefillPhone([]);
  207. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  208. $resp = $providers->query(['ch_trade_no' => '31215002972142736']);
  209. // $str = '{"amount":"30","carrierOrderNo":null,"mobile":"13699279618","orderNo":"27961615532426088043","orderStatus":3,"sign":"012BA0B093A0473D7DD1634A8356DCB1","tradeNo":"31215002972142736"}';
  210. // $data = json_decode($str,true);
  211. // refill\RefillFactory::instance()->notify('yibao',$data);
  212. }
  213. public function testAmingydPhone()
  214. {
  215. $providers = new refill\amingyd\RefillPhone([]);
  216. // $resp = $providers->add('13699279618', 5, 30, ['order_sn' => $this->make_sn()]);
  217. $resp = $providers->query(['order_sn' => '15421615627436792938']);
  218. // $str = '{"orderId":"15421615627436792938","amount":3000,"appKey":"40695059","timestamp":1615627503,"status":3,"operatorId":"508353854027968617","sign":"2A0562319ED4845AB9E3812A58F0B425"}';
  219. // $data = json_decode($str,true);
  220. // refill\RefillFactory::instance()->notify('amingyd',$data);
  221. }
  222. public function testChukaPhone()
  223. {
  224. $providers = new refill\chuka\RefillPhone([]);
  225. // $resp = $providers->add('18500608333', 5, 20, ['order_sn' => $this->make_sn()]);
  226. // $resp = $providers->query(['order_sn' => '92161616314884175179']);
  227. $params['customerId'] = '101787';
  228. $params['orderno'] = 'C1616314888506705492';
  229. $params['tmporder'] = '92161616314884175179';
  230. $params['code'] = '1';
  231. $params['number'] = '18500608333';
  232. $params['money'] = '20';
  233. $params['amount'] = '0';
  234. refill\RefillFactory::instance()->notify('chuka', $params);
  235. }
  236. public function testLegouPhone()
  237. {
  238. $providers = new refill\legou\RefillPhone([]);
  239. // $resp = $providers->add('18500608333', 5, 30, ['order_sn' => '200649600557718881' , 'order_id' => 247 , 'buyer_id' => 52667]);
  240. $resp = $providers->query(['order_sn' => '200649600557718881', 'order_id' => 247]);
  241. $params['username'] = 'lzdc';
  242. $params['orderNumber'] = '690653407667699667';
  243. $params['cardNumber'] = '18500608333';
  244. $params['orderMoney'] = '30.0';
  245. $params['orderPay'] = '1.0';
  246. $params['resultCode'] = '2';
  247. $params['rechargeDesc'] = '{"rechargeStatus":600200,"rechargeDesc":"充值成功"}';
  248. $params['rechargeVoucher'] = '100407307092103291444050244599';
  249. $params['sign'] = 'c054884422a8c3749cbfda0e82b9af70';
  250. // refill\RefillFactory::instance()->notify('legou',$params);
  251. }
  252. public function testFeinimoshu()
  253. {
  254. $providers = new refill\feinimoshu\RefillOil([]);
  255. // $resp = $providers->query(['order_sn' => '3708210680873565742704']);
  256. $resp = $providers->balance();
  257. }
  258. public function testFeinimoshu_hf()
  259. {
  260. $providers = new refill\feinimoshu_hf\RefillPhone([]);
  261. // $resp = $providers->query(['order_sn' => '3708210680873565742704']);
  262. $resp = $providers->balance();
  263. }
  264. public function testFeiniaoPhone()
  265. {
  266. $providers = new refill\feiniao\RefillPhone([]);
  267. // $order_sn = $this->make_sn();
  268. // Log::record($order_sn, Log::DEBUG);
  269. // $resp = $providers->add('13699279618', 4, 50, ['order_sn' => $order_sn]);
  270. $resp = $providers->query(['order_sn' => '28641617178590981824']);
  271. $params['result'] = 'fail';
  272. $params['msg'] = '0';
  273. $params['order'] = 'null';
  274. $params['phone_no'] = '18500608333';
  275. $params['amount'] = '100.00';
  276. $params['op_no'] = '64591617090761169983';
  277. $params['settle'] = '0';
  278. $params['sign'] = '907d2640f96e8d78d59202d090ddb470';
  279. // refill\RefillFactory::instance()->notify('feiniao',$params);
  280. }
  281. public function testTongyPhone()
  282. {
  283. $providers = new refill\tongy\RefillPhone([]);
  284. // $resp = $providers->add('18500608333', 5, 30, ['order_sn' => '690653407667699667', 'order_id' => 248, 'buyer_id' => 52667]);
  285. // $params['UserId'] = '100857';
  286. // $params['ShopId'] = '300000';
  287. // $params['SysOrderId'] = '21070215141210085700010';
  288. // $params['OrderId'] = '9241650678554051429291';
  289. // $params['State'] = '5';
  290. // $params['Timestamp'] = '1625210740472';
  291. // $params['sign'] = 'C5C4E888A3B678470071CDA6DC31719D';
  292. // $params['ParValue'] = '100.0000';
  293. // $params['VoucherType'] = '';
  294. // $params['VoucherContent'] = '';
  295. // $params['CreateTime'] = '2021-07-02 15:14:12';
  296. // $params['CompleteTime'] = '2021-07-02 15:25:40';
  297. // refill\RefillFactory::instance()->notify('tongy',$params);
  298. $resp = $providers->balance();
  299. }
  300. public function testWeiyiPhone()
  301. {
  302. $providers = new refill\weiyi\RefillPhone([]);
  303. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  304. // $resp = $providers->query(['order_sn' => '90401621489214002876']);
  305. $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"}';
  306. $params = json_decode($body, true);
  307. refill\RefillFactory::instance()->notify('weiyi', $params);
  308. }
  309. public function testWeiyimanPhone()
  310. {
  311. $providers = new refill\weiyiman\RefillPhone([]);
  312. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  313. // $resp = $providers->query(['order_sn' => '47591620898269370373']);
  314. $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"}';
  315. $params = json_decode($data, true);
  316. refill\RefillFactory::instance()->notify('weiyiman', $params);
  317. }
  318. public function testWeiyiWtPhone()
  319. {
  320. $providers = new refill\weiyiwt\RefillPhone([]);
  321. // $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
  322. // $resp = $providers->query(['order_sn' => '38451621924366009924']);
  323. $body = '{"szOrderId":"38451621924366009924","fSalePrice":"47.25","szAgentId":"200016","nFlag":"2","szVerifyString":"a0b5bfc0bbf6c121a4cd74d9ecb2427d","szPhoneNum":"18074608795","szRtnMsg":"1000000083421052514441119833","nDemo":"50"}';
  324. $params = json_decode($body, true);
  325. refill\RefillFactory::instance()->notify('weiyiwt', $params);
  326. }
  327. public function testXiaochuangPhone()
  328. {
  329. $providers = new refill\xiaochuang\RefillPhone([]);
  330. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  331. // $resp = $providers->query(['order_sn' => '84891623028826872085']);
  332. // $body = '{"fail_msg":"","order_sn":"84891623028826872085","order_status":"4","p_order_sn":"2021060709203558011797441162","sign":"E842203C3CA48E924D60B1B56AB93C3B"}';
  333. // $params = json_decode($body , true);
  334. // refill\RefillFactory::instance()->notify('xiaochuang',$params);
  335. $resp = $providers->balance();
  336. }
  337. public function testYintengPhone()
  338. {
  339. $providers = new refill\yinteng\RefillPhone([]);
  340. // $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
  341. // $resp = $providers->query(['order_sn' => '49631623737966351874']);
  342. // $data = '{"szOrderId":"49631623737966351874","fSalePrice":"47.35","szAgentId":"200009","nFlag":"2","szVerifyString":"01c5fafb1d67175f0533b69a762286e8","szPhoneNum":"18074608795","szRtnMsg":"1000000083421061514495400262","nDemo":"50"}';
  343. // $params = json_decode($data , true);
  344. // refill\RefillFactory::instance()->notify('yinteng',$params);
  345. $resp = $providers->balance();
  346. }
  347. public function testMoxjPhone()
  348. {
  349. $providers = new refill\moxj\RefillPhone([]);
  350. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  351. $resp = $providers->query(['order_sn' => '91131623906171663147']);
  352. $data = '{"result":"fail","msg":"0","order":"null","phone_no":"18500608333","amount":"50.0","op_no":"84901623900668776864","sign":"896b54914a07b814573d7f6cc403848a"}';
  353. $params = json_decode($data, true);
  354. // refill\RefillFactory::instance()->notify('moxj',$params);
  355. }
  356. public function testMoxj_fsPhone()
  357. {
  358. $providers = new refill\moxj_fs\RefillPhone([]);
  359. // $resp = $providers->add(15139608757, 4, 100, ['order_sn' => $this->make_sn()]);
  360. // $resp = $providers->query(['order_sn' => '42741624242693157165']);
  361. // $data = '{"amount":"100","charge_type":"2","code":"1","partner_id":"58","phone":"15139608757","sign":"30d193dba4101e50851ed0efabb75fb1","partner_order_no":"42741624242693157165","official_order_id":"20210621103211948830"}';
  362. // $params = json_decode($data , true);
  363. // refill\RefillFactory::instance()->notify('moxj_fs',$params);
  364. $resp = $providers->balance();
  365. }
  366. public function testZanzanquickPhone()
  367. {
  368. $providers = new refill\zanzanquick\RefillPhone([]);
  369. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  370. // $resp = $providers->query(['order_sn' => '90831623925322675223']);
  371. // $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"}';
  372. // $params = json_decode($data , true);
  373. // refill\RefillFactory::instance()->notify('zanzanquick',$params);
  374. $resp = $providers->balance();
  375. }
  376. public function testFengyemanPhone()
  377. {
  378. $providers = new refill\fengyeman\RefillPhone([]);
  379. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  380. // $resp = $providers->query(['order_sn' => '46221624265179185139']);
  381. // $data = '{"order_id":"46221624265179185139","mchid":"HF67a65_10008","tel":"18500608333","price":"50.00","sign":"2bb4ed5edc97ba7f60cf3848aab82cf4","out_order_id":"206877995456","status":"1"}';
  382. // $params = json_decode($data , true);
  383. // refill\RefillFactory::instance()->notify('fengyeman',$params);
  384. $resp = $providers->balance();
  385. }
  386. public function testMoxj_ydPhone()
  387. {
  388. $providers = new refill\moxj_yd\RefillPhone([]);
  389. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  390. // $resp = $providers->query(['order_sn' => '52101624413125875436']);
  391. // $data = '{"customer_order_no":"47651624412877257722","status":1,"merchant_id":"76505818","sign":"c185a0f2152b3ac3ee3f29009dec5a6b"}';
  392. // $params = json_decode($data , true);
  393. // refill\RefillFactory::instance()->notify('moxj_yd',$params);
  394. $resp = $providers->balance();
  395. }
  396. public function testXingzyPhone()
  397. {
  398. $providers = new refill\xingzy\RefillPhone([]);
  399. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  400. // $resp = $providers->query(['order_sn' => '76791624441423287373', 'ch_trade_no' => '210623174333941000']);
  401. // $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}';
  402. // $params = json_decode($data , true);
  403. // refill\RefillFactory::instance()->notify('xingzy',$params);
  404. $resp = $providers->balance();
  405. }
  406. public function testYuanmaiPhone()
  407. {
  408. $providers = new refill\yuanmai\RefillPhone([]);
  409. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  410. // $resp = $providers->query(['order_sn' => '24231624865882625203', 'ch_trade_no' => '210623174333941000']);
  411. // $data = '{"orderid":"24231624865882625203","status":"2","ordermoney":"50","sign":"94be5b1754ffcc7f0fe1551072146941","spsno":""}';
  412. // $params = json_decode($data, true);
  413. // refill\RefillFactory::instance()->notify('yuanmai',$params);
  414. $resp = $providers->balance();
  415. }
  416. public function testLangkePhone()
  417. {
  418. $providers = new refill\langke\RefillPhone([]);
  419. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  420. $resp = $providers->query(['order_sn' => '29461624952660047520', 'ch_trade_no' => '210623174333941000']);
  421. $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"}';
  422. $params = json_decode($data, true);
  423. // refill\RefillFactory::instance()->notify('langke',$params);
  424. }
  425. public function testYunlingdsPhone()
  426. {
  427. $providers = new refill\yunlingds\RefillPhone([]);
  428. // $resp = $providers->add(18074608795, 6, 30, ['order_sn' => $this->make_sn()]);
  429. // $resp = $providers->query(['order_sn' => '85351624961920020593']);
  430. // $data = '{"orderid":"OWS21062918188862392","sporderid":"85351624961920020593","userid":"10002623","merchantsubmittime":"20210629181929","resultno":"1","parvalue":"30","remark1":"AW20210629181906yRAvM","payno":"AW20210629181906yRAvM","fundbalance":"-28.59","sign":"11369509ADCF2A2612B3531A15049BDD"}';
  431. // $params = json_decode($data, true);
  432. // refill\RefillFactory::instance()->notify('yunlingds',$params);
  433. $resp = $providers->balance();
  434. }
  435. public function testLingzhmanPhone()
  436. {
  437. $providers = new refill\lingzhman\RefillPhone([]);
  438. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  439. // $resp = $providers->query(['order_sn' => '29771625215707976538']);
  440. // $data = '{"orderNo":"F2107021536431562574","status":"019","consumerNo":"60191625211393862930","voucherNo":null,"mobile":"18500608333"}';
  441. // $params = json_decode($data, true);
  442. // refill\RefillFactory::instance()->notify('lingzhman',$params);
  443. $resp = $providers->balance();
  444. }
  445. public function testQijutangPhone()
  446. {
  447. $providers = new refill\qijutang\RefillPhone([]);
  448. // for ($i=1;$i<2;$i++) {
  449. // $resp = $providers->add(13699279618, 4, 100, ['order_sn' => $this->make_sn()]);
  450. // }
  451. // $resp = $providers->query(['order_sn' => '51501625218912512231']);
  452. // $data = '{"szOrderId":"51501625218912512231","fSalePrice":"28.44","szAgentId":"200010","nFlag":"3","szVerifyString":"20cf16c6bb239e2a703d0bf3e5ef2d5a","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"30"}';
  453. // $params = json_decode($data, true);
  454. // refill\RefillFactory::instance()->notify('qijutang',$params);
  455. $resp = $providers->balance();
  456. }
  457. public function testLingzhman48Phone()
  458. {
  459. $providers = new refill\lingzhman48\RefillPhone([]);
  460. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  461. // $resp = $providers->query(['order_sn' => '49951625814151937287']);
  462. $data = '{"orderNo":"F2107091503134670764","status":"020","consumerNo":"49951625814151937287","voucherNo":null,"mobile":"18500608333"}';
  463. $params = json_decode($data, true);
  464. refill\RefillFactory::instance()->notify('lingzhman48', $params);
  465. }
  466. public function testcangbuPhone()
  467. {
  468. $providers = $this->getProvider('cangbu');
  469. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  470. $resp = $providers->query(['order_sn' => '4024880687558152076462']);
  471. // $data = '{"customerId":"112","tmporder":"35041626071052333060","orderno":"s16260710607417944801112","number":"18500608333","money":"100","amount":"94.9000","code":"1","cardno":"","voucher":"110103307042107121424210550266","sign":"de463c3d389a4afe4a2c58257972121a"}';
  472. // $params = json_decode($data, true);
  473. // refill\RefillFactory::instance()->notify('cangbu',$params);
  474. $resp = $providers->balance();
  475. }
  476. public function testCangbukami()
  477. {
  478. $providers = new refill\cangbukami\RefillPhone([]);
  479. // $resp = $providers->add(18500608333, 5, 20, ['order_sn' => $this->make_sn()]);
  480. $resp = $providers->query(['order_sn' => '23231627380108954478']);
  481. }
  482. public function testTongykamiPhone()
  483. {
  484. $providers = new refill\tongykami\RefillPhone([]);
  485. // $resp = $providers->add(18500608333, 5, 20, ['order_sn' => $this->make_sn()]);
  486. $resp = $providers->query(['order_sn' => '26961626077050756648']);
  487. $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"}';
  488. $params = json_decode($data, true);
  489. // refill\RefillFactory::instance()->notify('tongykami',$params);
  490. }
  491. public function testTongluPhone()
  492. {
  493. $providers = new refill\tonglu\RefillPhone([]);
  494. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  495. $resp = $providers->query(['order_sn' => '22961616468561936356']);
  496. // $body = '{"order_no":"22961616468561936356","order_status":"5","phone_no":"18500608333","amount":5000,"time_paid":1616468856287,"order_cert_no":"","paid":false,"order_id":"20210323966497008"}';
  497. // $sign = '9E41F52F612D60EBB654B3A5D1E2F1E5';
  498. // $params = json_decode($body , true);
  499. // $params['sign'] = $sign;
  500. // refill\RefillFactory::instance()->notify('tonglu',$params);
  501. }
  502. public function testSialan()
  503. {
  504. $providers = new refill\sialan\RefillPhone([]);
  505. // $resp = $providers->add(13699279618, 4, 10, ['order_sn' => $this->make_sn()]);
  506. // $resp = $providers->query(['order_sn' => '79651627436983840352', 'card_no' => 13699279618]);
  507. // $body = '{"cpid":"39780","order_no":"21072809494539780728903528","mobile":"13699279618","amount":"10","status":"success","sz_order_no":"2021072822001158391454773955","ret_para":"79651627436983840352","sign":"aa7e8a2e589660e98319c5546cb432fa"}';
  508. // $params = json_decode($body, true);
  509. // refill\RefillFactory::instance()->notify('sialan', $params);
  510. $resp = $providers->balance();
  511. }
  512. public function testMoxj_new()
  513. {
  514. $providers = new refill\moxj_new\RefillPhone([]);
  515. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  516. // $resp = $providers->query(['order_sn' => '33301627887529587739', 'card_no' => 13699279618]);
  517. // $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"}';
  518. // $params = json_decode($body, true);
  519. // refill\RefillFactory::instance()->notify('moxj_new', $params);
  520. $resp = $providers->balance();
  521. }
  522. public function testKangkai()
  523. {
  524. $providers = new refill\kangkai\RefillPhone([]);
  525. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  526. // $resp = $providers->query(['order_sn' => '25431627898461762024']);
  527. // $body = '{"TaskID":"267459","Mobile":"18500608333","Status":"5","ReportTime":"2021-08-02T18:02:01.777","ReportCode":"7:","OutTradeNo":"25431627898461762024","Price":"44.2500","ReceiptNum":"","Sign":"f0934a621fd0b076373f77a9bf8d7051"}';
  528. // $params = json_decode($body, true);
  529. // refill\RefillFactory::instance()->notify('kangkai', $params);
  530. $resp = $providers->balance();
  531. }
  532. public function testLechong()
  533. {
  534. $providers = new refill\lechong\RefillPhone([]);
  535. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  536. // $resp = $providers->query(['order_sn' => '55641627902450221838']);
  537. // $body = '{"sellerid":"55641627902450221838","agentcode":"202108021753","account":"MTg1MDA2MDgzMzM=","value":"50","payvalue":"47.8500","voucher":"","createtime":"20210802190739","endtime":"20210802191008","state":"4","remark":"","time":"20210802191008","sign":"0e2d69318d03871d887debd498cc50f2"}';
  538. // $params = json_decode($body, true);
  539. // refill\RefillFactory::instance()->notify('lechong', $params);
  540. $resp = $providers->balance();
  541. }
  542. public function testXinhengyang()
  543. {
  544. $providers = new refill\xinhengyang\RefillPhone([]);
  545. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  546. // $resp = $providers->query(['order_sn' => '50441628062235230398']);
  547. // $resp = $providers->balance();
  548. $body = '{"szOrderId":"50441628062235230398","fSalePrice":"28.68","szAgentId":"200026","nFlag":"3","szVerifyString":"0166cec8496c59b377744ef5dd9e02dc","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"30"}';
  549. $params = json_decode($body, true);
  550. refill\RefillFactory::instance()->notify('xinhengyang', $params);
  551. }
  552. public function testMiaoxt()
  553. {
  554. $providers = new refill\miaoxt\RefillPhone([]);
  555. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  556. // $resp = $providers->query(['order_sn' => '85101628064401524483']);
  557. // $resp = $providers->balance();
  558. $body = '{"szOrderId":"85101628064401524483","fSalePrice":"10.2","szAgentId":"200050","nFlag":"2","szVerifyString":"7a08b9a71a297a28843d749a7bf79dbc","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"10"}';
  559. $params = json_decode($body, true);
  560. refill\RefillFactory::instance()->notify('miaoxt', $params);
  561. }
  562. public function testTianyan()
  563. {
  564. $providers = new refill\tianyan\RefillPhone([]);
  565. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  566. // $resp = $providers->query(['order_sn' => '71241628067981955316', 'card_no' => 18500608333, 'card_type' => 5]);
  567. // $resp = $providers->balance();
  568. $params['amount'] = '100.00';
  569. $params['orderNo'] = '2618380681466713437097';
  570. $params['supplierId'] = '48';
  571. $params['orderId'] = 'S20210805081833371976224648';
  572. $params['notifyTime'] = '1628122793669';
  573. $params['sign'] = '4d8f70bf451608359e256ee1e5f30de1';
  574. $params['discountAmount'] = '5.50';
  575. $params['phoneNo'] = '17696554433';
  576. $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';
  577. $params['payType'] = 'wechat';
  578. $params['ticketNo'] = '110103353022108050819140250945';
  579. $params['company'] = 'lt';
  580. $params['status'] = '2';
  581. refill\RefillFactory::instance()->notify('tianyan', $params);
  582. }
  583. public function testYunsuoyaoman()
  584. {
  585. // $providers = $this->getProvider('yunsuoyaoman');
  586. // $resp = $providers->balance();
  587. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  588. // $resp = $providers->query(['order_sn' => '58771629702960801700']);
  589. $body = '{"orderid":"RLD21082315152651196","sporderid":"58771629702960801700","userid":"10002745","merchantsubmittime":"20210823152623","resultno":"9","parvalue":"30","remark1":"","payno":"","fundbalance":"-27.45","sign":"76A29E0101644831526138D63917C130"}';
  590. $params = json_decode($body, true);
  591. $providers = $this->getProvider('yunsuoyaoman', 'RefillCallBack');
  592. $ret = $providers->verify($params);
  593. $resp = $providers->notify($params);
  594. }
  595. public function testYouhe()
  596. {
  597. // $providers = $this->getProvider('youhe');
  598. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  599. // $resp = $providers->query(['order_sn' => '41051635145081582785']);
  600. // $resp = $providers->balance();
  601. $body = ' {"seqNo":"FE4D9D65781C0758","orderNo":"46101635142848462768","result":"Q0001","transo":"","sign":"3B02C7864154C94D8479305D27F3831C"}';
  602. $params = json_decode($body, true);
  603. $providers = $this->getProvider('youhe','RefillCallback');
  604. $ret = $providers->verify($params);
  605. $resp = $providers->notify($params);
  606. }
  607. public function testWenye()
  608. {
  609. $providers = new refill\wenye\RefillPhone([]);
  610. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  611. // $resp = $providers->query(['order_sn' => '88871628157083445809']);
  612. // $resp = $providers->balance();
  613. $body = '{"orderNo":"F2108051529062719948","status":"019","consumerNo":"95291628148539909985","voucherNo":null,"mobile":"18500608333"}';
  614. $params = json_decode($body, true);
  615. // refill\RefillFactory::instance()->notify('wenye', $params);
  616. }
  617. public function testXinyang()
  618. {
  619. $providers = new refill\xinyang\RefillPhone([]);
  620. // $resp = $providers->add(13699279618, 4, 10, ['order_sn' => $this->make_sn()]);
  621. // $resp = $providers->query(['order_sn' => '68151628157534687971']);
  622. // $resp = $providers->balance();
  623. $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"}';
  624. $params = json_decode($body, true);
  625. refill\RefillFactory::instance()->notify('xinyang', $params);
  626. }
  627. public function testGuochuang()
  628. {
  629. $providers = $this->getProvider('guochuang');
  630. $resp = $providers->add(13699279618, 4, 5, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
  631. // $resp = $providers->query(['order_sn' => '82951628231038096078']);
  632. // $resp = $providers->balance();
  633. // $body = '{"account":"18074608795","evidence":"1000000083421080614310024563","evidenceType":"","id":"D2021080614235942044","inTime":"2021/08/06 14:26:22","money":"10","outerId":"82951628231038096078","status":"SUCCESS"}';
  634. // $params['ts'] = 1628231182;
  635. // $params['sign'] = '545F7024870B145915934CA36C6D341E';
  636. // $params['body'] = $body;
  637. // refill\RefillFactory::instance()->notify('guochuang', $params);
  638. [$goods_id, $price] = $providers->goods(2, 10, 4, 1, []);
  639. }
  640. public function testXianghongrui()
  641. {
  642. $providers = new refill\xianghongrui\RefillPhone([]);
  643. // $resp = $providers->balance();
  644. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  645. // $resp = $providers->query(['order_sn' => '87691628758730981608']);
  646. $body = '{"orderid":"BAT21081216581941649","sporderid":"87691628758730981608","userid":"10002503","merchantsubmittime":"20210812165918","resultno":"1","parvalue":"50","remark1":"110103353052108121658550256634","payno":"110103353052108121658550256634","fundbalance":"-47.5","sign":"EF34F6FB6D37E4FCB92DCD8F41CC67E1"}';
  647. $params = json_decode($body, true);
  648. refill\RefillFactory::instance()->notify('xianghongrui', $params);
  649. }
  650. public function testDianchong()
  651. {
  652. $providers = $this->getProvider('dianchong');
  653. // $resp = $providers->balance();
  654. // $resp = $providers->add(18074608795, 5, 30, ['order_sn' => $this->make_sn()]);
  655. // $resp = $providers->query(['order_sn' => '26671629190230227788']);
  656. $body = '{"seqNo":"5C2D85572F8743CF","orderNo":"26671629190230227788","result":"Q0000","transo":"1000000083421081716331202254","sign":"87F3F67EA2B91709FD05468CF74210A1"}';
  657. $params = json_decode($body, true);
  658. $providers = $this->getProvider('dianchong', 'RefillCallBack');
  659. $ret = $providers->verify($params);
  660. $resp = $providers->notify($params);
  661. }
  662. public function testXunyinOil()
  663. {
  664. $providers = $this->getProvider('xunyinoil', 'RefillOil');
  665. // $resp = $providers->balance();
  666. // $resp = $providers->add(9030230005180327, 1, 50, ['order_sn' => $this->make_sn()]);
  667. $resp = $providers->query(['order_sn' => '77791629450541412891']);
  668. // $body = '{"ext":"","code":"8888","sign":"7db98f3f271013688134f2fbd503dc15","statemes":"\u6210\u529f","id":"80641629442789487318","userid":"8417","operatorid":"2421082015001888","status":"SUCCESS"}';
  669. // $params = json_decode($body, true);
  670. // $providers = $this->getProvider('xunyinoil','RefillCallBack');
  671. // $ret = $providers->verify($params);
  672. // $resp = $providers->notify($params);
  673. }
  674. public function testJumiThird()
  675. {
  676. $providers = $this->getProvider('jumithird');
  677. // $resp = $providers->balance();
  678. $resp = $providers->add(588073521, 7, 100, [
  679. 'order_sn' => $this->make_sn(),
  680. 'goods_id' => 6978,
  681. 'product_code' => 'XYZ100747'
  682. ]);
  683. // $resp = $providers->query(['order_sn' => '53151629791019902609']);
  684. // $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"}';
  685. // $params = json_decode($body, true);
  686. // $providers = $this->getProvider('jumithird','RefillCallBack');
  687. // $ret = $providers->verify($params);
  688. // $resp = $providers->notify($params);
  689. }
  690. public function testWangliantx()
  691. {
  692. // $providers = $this->getProvider('wangliantx');
  693. // $resp = $providers->balance();
  694. // for ($i = 1; $i<=1; $i++){
  695. // $resp = $providers->add(18074608795, 6, 50, [
  696. // 'order_sn' => $this->make_sn(),
  697. // 'regin_no' => 1
  698. // ]);
  699. // }
  700. // $resp = $providers->query(['order_sn' => '85901629801033376170']);
  701. $body = '{"userid":"10073664","sporderid":"85901629801033376170","orderid":"C5C5D4F49DB61A8773664","resultno":"1","merchantsubmittime":"20210824183109","ordermoney":"47.6","verifystring":"b6a873ecd6dc9cea3a410c6386cdab84","sign":"4a80e2a8c7b07c8aacada4feedd581bd","supnumber":"1000000083421082418345386156"}';
  702. $params = json_decode($body, true);
  703. $providers = $this->getProvider('wangliantx', 'RefillCallBack');
  704. $ret = $providers->verify($params);
  705. $resp = $providers->notify($params);
  706. }
  707. public function testZhuojian()
  708. {
  709. // $providers = $this->getProvider('zhuojian');
  710. // $resp = $providers->add(18500608333, 5, 50, [
  711. // 'order_sn' => $this->make_sn()
  712. // ]);
  713. // $resp = $providers->query(['order_sn' => '87231630026579229295']);
  714. $body = '{"money":"50.00","official_trade_no":"","out_trade_no":"87231630026579229295","status":"4","trade_no":"10000077828","sign":"0e19142c014ef6fe263601956e0be436"}';
  715. $params = json_decode($body, true);
  716. $providers = $this->getProvider('zhuojian', 'RefillCallBack');
  717. $ret = $providers->verify($params);
  718. $resp = $providers->notify($params);
  719. }
  720. public function testXianghongruifs()
  721. {
  722. // $providers = $this->getProvider('xianghongruifs');
  723. // $resp = $providers->balance();
  724. // $resp = $providers->add(15252490862, 4, 30, [
  725. // 'order_sn' => $this->make_sn()
  726. // ]);
  727. // $resp = $providers->query(['order_sn' => '70881632644084577858']);
  728. $body = '{"orderid":"AAO21092616144271467","sporderid":"70881632644084577858","userid":"10002524","merchantsubmittime":"20210926161610","resultno":"9","parvalue":"30","remark1":"","payno":"","fundbalance":"-28.5","sign":"343C28C4EB13F68E2EE251FA0F2A8262"}';
  729. $params = json_decode($body, true);
  730. $providers = $this->getProvider('xianghongruifs', 'RefillCallBack');
  731. $ret = $providers->verify($params);
  732. $resp = $providers->notify($params);
  733. }
  734. public function testYilin()
  735. {
  736. $providers = $this->getProvider('yilin');
  737. $resp = $providers->balance();
  738. // $resp = $providers->add(18500608333, 5, 30, [
  739. // 'order_sn' => $this->make_sn()
  740. // ]);
  741. // $resp = $providers->query(['order_sn' => '86981630484634157631']);
  742. // $body = '{"orderid":"NZX21090116244713140","sporderid":"86981630484634157631","userid":"10002543","merchantsubmittime":"20210901163039","resultno":"9","parvalue":"30","remark1":"","payno":"","fundbalance":"-28.71","sign":"53717BF9ECE83F4AD96C1EDD4BAE4E87"}';
  743. // $params = json_decode($body, true);
  744. // $providers = $this->getProvider('yilin','RefillCallBack');
  745. // $ret = $providers->verify($params);
  746. // $resp = $providers->notify($params);
  747. }
  748. public function testMiaoxt_fs()
  749. {
  750. $providers = $this->getProvider('miaoxt_fs');
  751. // $resp = $providers->balance();
  752. // $resp = $providers->add(13945846040, 4, 10, [
  753. // 'order_sn' => $this->make_sn()
  754. // ]);
  755. $resp = $providers->query(['order_sn' => '33101630577689278074']);
  756. // $body = '{"szOrderId":"33101630577689278074","fSalePrice":"9.95","szAgentId":"200055","nFlag":"2","szVerifyString":"1649fb2815926b75e4ed7e0fef3172ae","szPhoneNum":"13945846040","szRtnMsg":"","nDemo":"10"}';
  757. // $params = json_decode($body, true);
  758. // $providers = $this->getProvider('miaoxt_fs','RefillCallBack');
  759. // $ret = $providers->verify($params);
  760. // $resp = $providers->notify($params);
  761. }
  762. public function testXianzhibb()
  763. {
  764. // $providers = $this->getProvider('xianzhibb');
  765. // $resp = $providers->balance();
  766. // $resp = $providers->add(13699279618, 4, 200, [
  767. // 'order_sn' => $this->make_sn()
  768. // ]);
  769. // $resp = $providers->query(['order_sn' => '80881630650784871094']);
  770. $body = '{"code":"000","merchantorderId":"1854680684077057846998","platformorderid":"aada9b09583f66b2b83370016","orderid":"","rechargeno":"15971954673","amount":"50.00","payamount":"47.75000","rechargestate":"3","createtime":"2021-09-04 13:26:20","sign":"07b8a341c55639d3512a239f9cd07e31"}';
  771. $params = json_decode($body, true);
  772. $providers = $this->getProvider('xianzhibb', 'RefillCallBack');
  773. $ret = $providers->verify($params);
  774. $resp = $providers->notify($params);
  775. }
  776. public function testYikatong()
  777. {
  778. $providers = $this->getProvider('yikatong');
  779. $resp = $providers->balance();
  780. // $resp = $providers->add(18500608333, 5, 50, [
  781. // 'order_sn' => $this->make_sn()
  782. // ]);
  783. // $resp = $providers->query(['order_sn' => '17631630896153830023']);
  784. // $body = '{"szOrderId":"17631630896153830023","fSalePrice":"47.25","szAgentId":"200001","nFlag":"2","szVerifyString":"4ab7914e333a452d32be85b51b075f48","szPhoneNum":"18500608333","szRtnMsg":"110103353182109061043150295134","nDemo":"50"}';
  785. // $params = json_decode($body, true);
  786. // $providers = $this->getProvider('yikatong','RefillCallBack');
  787. // $ret = $providers->verify($params);
  788. // $resp = $providers->notify($params);
  789. }
  790. public function testSanti()
  791. {
  792. $providers = $this->getProvider('santi');
  793. // $resp = $providers->get_product(17801048874);
  794. // $resp = $providers->add(18500608333, 5, 1024, [
  795. // 'order_sn' => $this->make_sn(),
  796. // 'goods_id' => 7000,
  797. // 'product_code' => 'XYZ100751'
  798. // ]);
  799. $resp = $providers->query(['ch_trade_no' => '1631945759171581']);
  800. // $resp = $providers->balance();
  801. $body = '{"channelOrderNo":"49991631861285846684","extraData":"","orderNo":"1631861288127072","orderStatus":"4","providerResultCode":"3","providerResultReason":"\u5145\u503c\u6210\u529f","resultCode":"1000","resultMessage":"\u6210\u529f","sign":"472490783eaa82c76a1af8702881f04f"}';
  802. $params = json_decode($body, true);
  803. $providers = $this->getProvider('santi', 'RefillCallBack');
  804. $ret = $providers->verify($params);
  805. $resp = $providers->notify($params);
  806. }
  807. public function testSialan_tax()
  808. {
  809. // $providers = $this->getProvider('sialan_tax');
  810. // $resp = $providers->add(18500608333, 5, 100, [
  811. // 'order_sn' => $this->make_sn()
  812. // ]);
  813. // $resp = $providers->query(['order_sn' => '98871630991459034712', 'card_no' => 18500608333]);
  814. // $resp = $providers->balance();
  815. $body = '{"cpid":"23412","order_no":"21090713111223412478608977","mobile":"18500608333","amount":"100","status":"success","sz_order_no":"11010335O202109071311130276561","ret_para":"98871630991459034712","sign":"82cf6e08339f5b859e8946cc7c2a5e14"}';
  816. $params = json_decode($body, true);
  817. $providers = $this->getProvider('sialan_tax', 'RefillCallBack');
  818. $ret = $providers->verify($params);
  819. $resp = $providers->notify($params);
  820. }
  821. public function testYunchonggong_yd()
  822. {
  823. $providers = $this->getProvider('yunchonggong_yd');
  824. for ($i = 1; $i <= 5; $i++) {
  825. $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  826. }
  827. // $resp = $providers->query(['order_sn' => '34061631002071526340']);
  828. // $resp = $providers->balance();
  829. // $body = '{"szOrderId":"34061631002071526340","fSalePrice":"47.7","szAgentId":"200043","nFlag":"3","szVerifyString":"48a7329c13af06b5be1d2fdad706b22e","szPhoneNum":"13699279618","szRtnMsg":"","nDemo":"50"}';
  830. // $params = json_decode($body, true);
  831. // $providers = $this->getProvider('yunchonggong_yd','RefillCallBack');
  832. // $ret = $providers->verify($params);
  833. // $resp = $providers->notify($params);
  834. }
  835. public function testGuochuang_nation()
  836. {
  837. $providers = $this->getProvider('guochuang_nation');
  838. // $resp = $providers->add(18500608333, 5, 1, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
  839. $resp = $providers->query(['order_sn' => '4372390688043259849812']);
  840. // $body = '{"account":"19982440060","evidence":"1000000083421102010443856304","evidenceType":"","id":"D2021102010210473815","inTime":"2021/10/20 10:31:14","money":"100","outerId":"1659990688040464576756","status":"SUCCESS"}';
  841. // $params['ts'] = 1634697074;
  842. // $params['sign'] = 'C93583DEF43208A26983BC5427CFFF12';
  843. // $params['body'] = $body;
  844. // $providers = $this->getProvider('guochuang_nation','RefillCallBack');
  845. // $ret = $providers->verify($params);
  846. // $resp = $providers->notify($params);
  847. }
  848. public function testTianyanman()
  849. {
  850. $providers = $this->getProvider('tianyanman');
  851. $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  852. // $resp = $providers->query(['order_sn' => '12191631078826857172', 'card_no' => 18500608333, 'card_type' => 5]);
  853. // $resp = $providers->balance();
  854. // $body = '{"amount":"30.00","orderNo":"12191631078826857172","supplierId":"48","orderId":"S20210908132721339071815348","notifyTime":"1631078841755","sign":"8a5676d4fbd1fd9a64385d71061be44a","discountAmount":"1.65","phoneNo":"18500608333","queryUrl":"","payType":"","ticketNo":"","company":"lt","status":"0"}';
  855. // $params = json_decode($body, true);
  856. // $providers = $this->getProvider('tianyanman','RefillCallBack');
  857. // $ret = $providers->verify($params);
  858. // $resp = $providers->notify($params);
  859. }
  860. public function testShimer()
  861. {
  862. $providers = $this->getProvider('shimier');
  863. // $resp = $providers->balance();
  864. $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  865. // $resp = $providers->query(['order_sn' => '56391631086657239320']);
  866. // $body = '{"orderId":"210908153756535112","appId":"b3k6DRwSOw","outOrderId":"56391631086657239320","sign":"86f9e783a3374463d546bedfc6920eff","orderStatus":"3","completeTime":"20210908154810","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
  867. // $params = json_decode($body, true);
  868. // $providers = $this->getProvider('shimier','RefillCallBack');
  869. // $ret = $providers->verify($params);
  870. // $resp = $providers->notify($params);
  871. }
  872. public function testZhongst_mix()
  873. {
  874. // $providers = $this->getProvider('zhongst_mix');
  875. // $resp = $providers->balance();
  876. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  877. // $resp = $providers->query(['order_sn' => '46291631503985151158']);
  878. $body = '{"szOrderId":"46291631503985151158","fSalePrice":"29.85","szAgentId":"200053","nFlag":"2","szVerifyString":"be07db2c82b63bc2610eee3eac23245b","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"30"}';
  879. $params = json_decode($body, true);
  880. $providers = $this->getProvider('zhongst_mix','RefillCallBack');
  881. $ret = $providers->verify($params);
  882. $resp = $providers->notify($params);
  883. }
  884. public function testHangtong()
  885. {
  886. // $providers = $this->getProvider('hangtong');
  887. // $resp = $providers->balance();
  888. // $resp = $providers->add(13699279618, 4, 100, ['order_sn' => $this->make_sn()]);
  889. // $resp = $providers->query(['order_sn' => '68221631775122967358']);
  890. $body = '{"phone":"13699279618","orderNo":"F2109161452121045530","status":"success","otherNo":"68221631775122967358","msg":"提交/充值成功","ext":"524501553021467113"}';
  891. $params = json_decode($body, true);
  892. $providers = $this->getProvider('hangtong','RefillCallBack');
  893. $ret = $providers->verify($params);
  894. $resp = $providers->notify($params);
  895. }
  896. public function testJinfeng()
  897. {
  898. // $providers = $this->getProvider('jinfeng');
  899. // $resp = $providers->balance();
  900. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  901. // $resp = $providers->query(['order_sn' => '78561631769733386091']);
  902. $body = '{"orderNo":"F2109161322374838924","status":"003","consumerNo":"78561631769733386091","voucherNo":null,"mobile":"18500608333"}';
  903. $params = json_decode($body, true);
  904. $providers = $this->getProvider('jinfeng','RefillCallBack');
  905. $ret = $providers->verify($params);
  906. $resp = $providers->notify($params);
  907. }
  908. public function testDashang()
  909. {
  910. // $providers = $this->getProvider('dashang');
  911. // $resp = $providers->balance();
  912. // $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
  913. // $resp = $providers->query(['order_sn' => '63101631784169445345']);
  914. $body = '{"userId":"80800346","bizId":"90290050","ejId":"90916171545126","downstreamSerialno":"67971631783703671946","status":"3","voucher":"","voucherType":"0","sign":"46b13acf67f271e2f85db189ab9e1391"}';
  915. $params = json_decode($body, true);
  916. $providers = $this->getProvider('dashang','RefillCallBack');
  917. $ret = $providers->verify($params);
  918. $resp = $providers->notify($params);
  919. }
  920. public function testYuanta()
  921. {
  922. $providers = $this->getProvider('yuanta');
  923. // $resp = $providers->balance();
  924. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  925. $resp = $providers->query(['order_sn' => '61501631786913519186']);
  926. // $body = '{"szOrderId":"61501631786913519186","fSalePrice":"45.75","szAgentId":"200029","nFlag":"2","szVerifyString":"3a580a84b477efa431d78b505fd7389e","szPhoneNum":"18500608333","szRtnMsg":"110103353072109161810250286803","nDemo":"50"}';
  927. // $params = json_decode($body, true);
  928. // $providers = $this->getProvider('yuanta','RefillCallBack');
  929. // $ret = $providers->verify($params);
  930. // $resp = $providers->notify($params);
  931. }
  932. public function testDuojing()
  933. {
  934. // $providers = $this->getProvider('duojing');
  935. // $resp = $providers->balance();
  936. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  937. // $resp = $providers->query(['order_sn' => '24731632377651122245']);
  938. $body = '{"appKey":"30000419","number":"56521092314142544365","orderId":"24731632377651122245","mobile":"18500608333","reason":"","amount":"50.00","actualAmount":"49.85","createdAt":"2021-09-23 14:14:25","status":"SUCCESS","sign":"8D7A526CF3F6C1279BD1819028B7683A"}';
  939. $params = json_decode($body, true);
  940. $providers = $this->getProvider('duojing','RefillCallBack');
  941. $ret = $providers->verify($params);
  942. $resp = $providers->notify($params);
  943. }
  944. public function testMenggu()
  945. {
  946. $providers = $this->getProvider('menggu','RefillOil');
  947. // $resp = $providers->add(1000111100021211884, 2, 500, ['order_sn' => $this->make_sn()]);
  948. $resp = $providers->query(['order_sn' => '63021632301956855605']);
  949. // $body = '{"orderId":"210922171242123506","appId":"1hqLCRUja7","outOrderId":"63021632301956855605","sign":"f3f0b48657bb4e3b993aa284159c6565","orderStatus":"2","completeTime":"20210922171306","orderDesc":"\u8ba2\u5355\u6210\u529f","ext1":"\u3010\u4e2d\u56fd\u77f3\u5316\u3011\u60a8\u5c3e\u53f7\u4e3a211884\u7684\u52a0\u6cb9\u5361\u4e8e09\u670822\u65e5 17\u65f612\u5206\u5145\u503c\u6210\u529f,\u91d1\u989d500\u5143,\u8ba2\u5355\u53f7:2521092217126714"}';
  950. // $params = json_decode($body, true);
  951. // $providers = $this->getProvider('menggu','RefillCallBack');
  952. // $ret = $providers->verify($params);
  953. // $resp = $providers->notify($params);
  954. }
  955. public function testMenggu_hf()
  956. {
  957. $providers = $this->getProvider('menggu_hf');
  958. // $resp = $providers->balance();
  959. $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  960. // $resp = $providers->query(['order_sn' => '24481632298991701065']);
  961. // $body = '{"orderId":"210922162318123069","appId":"1hqLCRUja7","outOrderId":"24481632298991701065","sign":"73faefba3e179641af0df6f59becce8f","orderStatus":"3","completeTime":"20210922162451","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
  962. // $params = json_decode($body, true);
  963. // $providers = $this->getProvider('menggu_hf','RefillCallBack');
  964. // $ret = $providers->verify($params);
  965. // $resp = $providers->notify($params);
  966. }
  967. public function testChizeng()
  968. {
  969. // $providers = $this->getProvider('chizeng');
  970. // $resp = $providers->balance();
  971. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  972. // $resp = $providers->query(['order_sn' => '70391632388843650753']);
  973. $body = '{"szOrderId":"70391632388843650753","fSalePrice":"28.35","szAgentId":"200017","nFlag":"3","szVerifyString":"784d7c138783265d4f64b943701712ff","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"30"}';
  974. $params = json_decode($body, true);
  975. $providers = $this->getProvider('chizeng','RefillCallBack');
  976. $ret = $providers->verify($params);
  977. $resp = $providers->notify($params);
  978. }
  979. public function testJinxin()
  980. {
  981. // $providers = $this->getProvider('jinxin');
  982. // $resp = $providers->balance();
  983. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  984. // $resp = $providers->query(['order_sn' => '83481632465671278322']);
  985. $body = '{"orderNo":"210924140000185","requestId":"83481632465671278322","sign":"80184350EC5C60445A50C9450D6CFB28","status":1,"supplierNo":"110103353192109241442090289402","timeStamp":"2021-09-24 14:43:07"}';
  986. $params = json_decode($body, true);
  987. $providers = $this->getProvider('jinxin','RefillCallBack');
  988. $ret = $providers->verify($params);
  989. $resp = $providers->notify($params);
  990. }
  991. public function testKachong()
  992. {
  993. // $providers = $this->getProvider('kachong');
  994. // $resp = $providers->balance();
  995. // $resp = $providers->add(18500608333, 5, 20, ['order_sn' => $this->make_sn()]);
  996. // $resp = $providers->query(['order_sn' => '30691632889605245135']);
  997. $body = '{"szAgentId":"200046","szOrderId":"30691632889605245135","szPhoneNum":"18500608333","nDemo":"20","fSalePrice":"19.82","nFlag":"2","szVerifyString":"dbac0df5e9ff2b067f74850f0cf55f3c","szRtnMsg":"982100337029603"}';
  998. $params = json_decode($body, true);
  999. $providers = $this->getProvider('kachong','RefillCallBack');
  1000. $ret = $providers->verify($params);
  1001. $resp = $providers->notify($params);
  1002. }
  1003. public function testXingzyNormal()
  1004. {
  1005. // $providers = $this->getProvider('xingzy_normal');
  1006. // $resp = $providers->balance();
  1007. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1008. // $resp = $providers->query(['order_sn' => '62881632898853651364']);
  1009. $body = '{"access_key":"211394711","code":3,"data":{"sellprice":28.65,"phone":"18500608333","pass":null,"official_id":null,"official_ch":null},"orderid":210929150115656000,"out_trade_no":"62881632898853651364","sign":"qIkEYEougSzg3EImlHTJKBHv4OQ=","timestamp":1632898943485}';
  1010. $params = json_decode($body, true);
  1011. $providers = $this->getProvider('xingzy_normal','RefillCallBack');
  1012. $ret = $providers->verify($params);
  1013. $resp = $providers->notify($params);
  1014. }
  1015. public function testDingxin()
  1016. {
  1017. $providers = $this->getProvider('dingxin');
  1018. $resp = $providers->balance();
  1019. }
  1020. public function testPushang()
  1021. {
  1022. $providers = $this->getProvider('pushang');
  1023. // $resp = $providers->balance();
  1024. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1025. $resp = $providers->query(['order_sn' => '23391632986567769626']);
  1026. // $body = '{"msg":"\u8d26\u52a1\u6263\u6b3e\u5931\u8d25","extOrderId":"22081632982700152800","orderId":"R2021093014240000154555","salePrice":"30.0900","sign":"b0fe238f16e516316729589d42ab97b1","state":"5","exchangeTraded":""}';
  1027. // $params = json_decode($body, true);
  1028. // $providers = $this->getProvider('pushang','RefillCallBack');
  1029. // $ret = $providers->verify($params);
  1030. // $resp = $providers->notify($params);
  1031. }
  1032. public function testDinghui()
  1033. {
  1034. $providers = $this->getProvider('dinghui');
  1035. $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1036. // $resp = $providers->query(['order_sn' => '84891634279500368841']);
  1037. // $body = '{"method":"order.charge.status.update.notify","format":"json","sign":"26f66f194771ca278f39fa9c9c53222f6347abbe79a8a1c8987342116c5eec9f5737e387630e82f024663ec0b82a2cfd1f2da4731aac118ecacf700c110b865166b1dd20d7225b52aee37d91ce12f534c5d480da843d0b824d165d7bba90cb63a9556d4395b59492a25ee97a3ca099d12bc3b7366f6c2d832f02306615baf5cda391b91c1c2cbe8935e2dfbc7b648c747cbfbd8d4767f0dc7582f558607fe821b12ff607dcfbbc14bbac1064f15d36fd741503287e8075fd7b7106bffaccaf2173740a51838419c24bd61bc8cde53d336972f2c8ff3d526542139271da9c7b95247db886feb22e74cefcc82ae0d2ff228343759d2fc51e986f09a61716f1833e","message":"5l8ZOxxDVYYDNBWWJ06QDGbbsMPeV5eLpb\/gmCweXM\/BR1l+I09T73OvhPsA8ujFLw4oReK7P+z\/DTU2tFn83I+6YU4QgTiLVp3tW\/kKaKmUhTB+BQZhnVk39wHZD4BBeDlTlAkmU6mskB8MCO9xG5W11vhrSn16ssG6CFEYcpkvDihF4rs\/7P8NNTa0Wfzc78MrVtylby5Lw8MIrIbtfr62lBQ9jUm2lMFeQVBUZ9GUhTB+BQZhnVk39wHZD4BBNoOYx9z9iwfCLYmU0ili4A==","msgtype":"notify_msg","version":"V2.0","app_id":"yeziapi","notify_id":"0000017c78f9c8190130d3298000000a","timestamp":"1634117208089"}';
  1038. // $params = json_decode($body, true);
  1039. // $providers = $this->getProvider('dinghui','RefillCallBack');
  1040. // $ret = $providers->verify($params);
  1041. // $resp = $providers->notify($params);
  1042. }
  1043. public function testHuafutong()
  1044. {
  1045. // $providers = $this->getProvider('huafutong');
  1046. // $resp = $providers->balance();
  1047. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1048. // $resp = $providers->query(['order_sn' => '48151634200413207059']);
  1049. $body = '{"PostData":"MJ88hD85bb2VPjI+q9R64jrR2TnZQSUn+4PHZCz1of27YQswyLKdNoNyyNuVEd2+98raKRC0pD+KFQf6beJn5mgOe+u9JjTtqxM5VcVYX93DQACU1ZdfJ+rSx5WRMwvi"}';
  1050. $params = json_decode($body, true);
  1051. $providers = $this->getProvider('huafutong','RefillCallBack');
  1052. $data = $providers->notify($params);
  1053. }
  1054. public function testShuoruan()
  1055. {
  1056. $providers = $this->getProvider('shuoruan');
  1057. // $resp = $providers->balance();
  1058. $resp = $providers->add(13699279618, 4, 10, ['order_sn' => $this->make_sn()]);
  1059. // $resp = $providers->query(['order_sn' => '80261634802627091026']);
  1060. $params['Action'] = 'CX';
  1061. $params['AgentAccount'] = '18600608333';
  1062. $params['Agentbalance'] = '-9.970';
  1063. $params['Orderid'] = '80261634802627091026';
  1064. $params['Chargeid'] = '2162076796';
  1065. $params['Orderstatu_int'] = '16';
  1066. $params['Orderstatu_text'] = '缴费成功_';
  1067. $params['TransCash'] = '10.000';
  1068. $params['OrderPayment'] = '9.970';
  1069. $params['Errorcode'] = '0000';
  1070. $params['Errormsg'] = '';
  1071. $params['Sign'] = '654fbc24c3d0878247bc3be3ed699f16';
  1072. $providers = $this->getProvider('shuoruan','RefillCallBack');
  1073. // $ret = $providers->verify($params);
  1074. // $data = $providers->notify($params);
  1075. }
  1076. public function testLinzhu()
  1077. {
  1078. // $providers = $this->getProvider('linzhu');
  1079. // $resp = $providers->balance();
  1080. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1081. // $resp = $providers->query(['order_sn' => '43881634986696312260']);
  1082. $body = '{"orderNo":"F2110231858443112627","status":"019","consumerNo":"43881634986696312260","voucherNo":null,"mobile":"18500608333"}';
  1083. $params = json_decode($body, true);
  1084. $providers = $this->getProvider('linzhu','RefillCallBack');
  1085. $ret = $providers->verify($params);
  1086. $data = $providers->notify($params);
  1087. }
  1088. public function testFangxing()
  1089. {
  1090. $providers = $this->getProvider('fangxing');
  1091. // $resp = $providers->balance();
  1092. // $resp = $providers->add(13898167806, 4, 10, ['order_sn' => $this->make_sn(), 'order_id' => 111111]);
  1093. $resp = $providers->query(['order_sn' => '82581635239506988570']);
  1094. $body = '{"orderId":"O21102617115969210570","respCode":"10003","respMsg":"\u6210\u529f \u5bf9\u7aef\u6d41\u6c34\u53f7: 21102617611981771","sign":"013F54D5E415668D3E012BBDE9E4BF16","transNo":"82581635239506988570"}';
  1095. $params = json_decode($body, true);
  1096. $providers = $this->getProvider('fangxing','RefillCallBack');
  1097. $ret = $providers->verify($params);
  1098. $data = $providers->notify($params);
  1099. }
  1100. public function testAmingjd()
  1101. {
  1102. // $providers = new refill\amingjd\RefillPhone([]);
  1103. // $resp = $providers->add(13699279618, 5, 30, ['order_sn' => $this->make_sn()]);
  1104. // $resp = $providers->query(['order_sn' => '42301616475989518588']);
  1105. $body = '{"order_id":"83321616478215494884","mchid":"10003","tel":"13699279618","price":"30.00","sign":"01c49620c155a80bc43cecc2b1651868","status":"0","out_order_id":"0"}';
  1106. $params = json_decode($body, true);
  1107. refill\RefillFactory::instance()->notify('amingjd', $params);
  1108. }
  1109. public function testAmingjdmanPhone()
  1110. {
  1111. $providers = new refill\amingjdman\RefillPhone([]);
  1112. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1113. // $resp = $providers->query(['order_sn' => '82741619577673758623']);
  1114. $body = '{"order_id":"82741619577673758623","mchid":"10045","tel":"13699279618","price":"30.00","sign":"2fe55fb4d4b2acc2e98137adb82fa57e","status":"0","out_order_id":"0"}';
  1115. $params = json_decode($body, true);
  1116. refill\RefillFactory::instance()->notify('amingjdman', $params);
  1117. }
  1118. public function testWeishengyWtPhone()
  1119. {
  1120. $providers = new refill\weishengywt\RefillPhone([]);
  1121. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1122. // $resp = $providers->query(['order_sn' => '27681620538125370652']);
  1123. $data = '{"szOrderId":"27681620538125370652","fSalePrice":"47.5","szAgentId":"200045","nFlag":"2","szVerifyString":"92fafec121b77518d539ed9f5005fdf9","szPhoneNum":"18500608333","szRtnMsg":"110103308032105091328520502948","nDemo":"50"}';
  1124. $params = json_decode($data, true);
  1125. refill\RefillFactory::instance()->notify('weishengywt', $params);
  1126. }
  1127. public function testWeishengyJDPhone()
  1128. {
  1129. $providers = new refill\weishengyjd\RefillPhone([]);
  1130. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1131. // $resp = $providers->query(['order_sn' => '14261620887423822879']);
  1132. $data = '{"szOrderId":"14261620887423822879","fSalePrice":"44.0","szAgentId":"200050","nFlag":"3","szVerifyString":"3cceef390602058e1d2fdde2e07636a4","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"50"}';
  1133. $params = json_decode($data, true);
  1134. refill\RefillFactory::instance()->notify('weishengyjd', $params);
  1135. }
  1136. public function testYeziPhone()
  1137. {
  1138. $providers = new refill\yezi\RefillPhone([]);
  1139. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1140. // $resp = $providers->query(['order_sn' => '35261620988265145105']);
  1141. $data = '{"mchid":"10147","order_sn":"35261620988265145105","amount":"50.00","cardno":"18500608333","trade_no":"6363570674332280422825","idcard":"","card_name":"","official_sn":"","message":"","state":"CANCEL","sign":"b79f2ddbb5b7eef98f414585a5bd2cde"}';
  1142. $params = json_decode($data, true);
  1143. refill\RefillFactory::instance()->notify('yezi', $params);
  1144. }
  1145. public function testWeishengysixPhone()
  1146. {
  1147. $providers = new refill\weishengysix\RefillPhone([]);
  1148. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1149. // $resp = $providers->query(['order_sn' => '17171624434289348649']);
  1150. $data = '{"szOrderId":"17171624434289348649","fSalePrice":"44.5","szAgentId":"200074","nFlag":"2","szVerifyString":"fa5735090199d97e6a50e7f3083be111","szPhoneNum":"18500608333","szRtnMsg":"AW2021062315464045A27","nDemo":"50"}';
  1151. $params = json_decode($data, true);
  1152. refill\RefillFactory::instance()->notify('weishengysix', $params);
  1153. }
  1154. public function testHaohaoOil()
  1155. {
  1156. $providers = new refill\haohao\RefillOil([]);
  1157. // $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
  1158. $data['amount'] = 20000;
  1159. $data['mchId'] = 467253;
  1160. $data['mchOrderNo'] = '5514850674656058146707';
  1161. $data['mobile'] = '';
  1162. $data['sign'] = 'F282D68972A437F3CEB3516BB2FDD19A';
  1163. $data['operator'] = 4;
  1164. $data['number'] = '1000113200020348885';
  1165. $data['thirdOrderNo'] = '2317184088901537792';
  1166. $data['directStatus'] = 5;
  1167. // $input = json_decode($data, true);
  1168. refill\RefillFactory::instance()->notify('haohao',$data);
  1169. }
  1170. public function testJuzhuoOil()
  1171. {
  1172. $providers = new refill\juzhuo\RefillOil([]);
  1173. // $resp = $providers->add(1000111100021211884, 2, 200, ['order_sn' => $this->make_sn()]);
  1174. // $resp = $providers->query(['order_sn' => '20121621578185774451']);
  1175. // $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"}';
  1176. // $input = json_decode($data, true);
  1177. $data['channelsort'] = 'OIL_CARD';
  1178. $data['channelno'] = '';
  1179. $data['onlystr'] = '0772770675248490450497';
  1180. $data['channel'] = 'JD';
  1181. $data['sign'] = '4a9f113bfa4aa2d155de7136ca0afe2d';
  1182. $data['amt'] = '100';
  1183. $data['notifyurl'] = 'http://121.89.212.167/racc/callback/lingzh/juzhuo.php';
  1184. $data['cardtype'] = 'Sinoepc';
  1185. $data['cardno'] = '1000113200029532754';
  1186. $data['orgid'] = '6095171500';
  1187. $data['account'] = '';
  1188. $data['status'] = '3';
  1189. refill\RefillFactory::instance()->notify('juzhuo',$data);
  1190. }
  1191. public function testZeheng()
  1192. {
  1193. $providers = new refill\zeheng\RefillOil([]);
  1194. // $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 100, ['order_sn' => $this->make_sn()]);
  1195. // $resp = $providers->query(['order_sn' => '45951620814813332604']);
  1196. $data = '{"extOrderId":"45951620814813332604","orderId":"R2021051218240000192928","salePrice":"96.8000","sign":"0d6b9641eaf8d36ecba82cfefc6aa307","state":"4"}';
  1197. $input = json_decode($data, true);
  1198. refill\RefillFactory::instance()->notify('zeheng',$input);
  1199. }
  1200. public function testXiaoniu()
  1201. {
  1202. $providers = $this->getProvider('xiaoniu','RefillOil');
  1203. // $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 500, ['order_sn' => $this->make_sn()]);
  1204. $resp = $providers->query(['order_sn' => '15981632813532634860']);
  1205. // $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"}';
  1206. // $input = json_decode($data, true);
  1207. // refill\RefillFactory::instance()->notify('xiaoniu',$input);
  1208. // $resp = $providers->balance();
  1209. }
  1210. public function testYingdian()
  1211. {
  1212. $providers = new refill\yingdian\RefillOil([]);
  1213. // $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 200, ['order_sn' => $this->make_sn()]);
  1214. // $resp = $providers->query(['order_sn' => '94691626688509004979']);
  1215. $resp = $providers->query(['order_sn' => '45671626687631917892']);
  1216. $data = '{"orderNo":"94691626688509004979","vouchers":"[\"2421071918070053\"]","orderId":"63400811-e877-11eb-a89f-00163e147a9b","spOrderNo":"052423YK241720210719175503603473","status":"SUCCESS"}';
  1217. $input = json_decode($data, true);
  1218. // refill\RefillFactory::instance()->notify('yingdian',$input);
  1219. }
  1220. public function testZhenqi()
  1221. {
  1222. $providers = new refill\zhenqi\RefillPhone([]);
  1223. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1224. // $resp = $providers->query(['order_sn' => '42611626267945146350']);
  1225. // $data = '{"out_trade_no":"14001626266194932132","create_time":"1626266201","sp_order_no":"110103353232107142044550619272","status":"1","sign":"3C2F8ED40EEB9151D2117E2DA1FA64AA"}';
  1226. // $input = json_decode($data, true);
  1227. // refill\RefillFactory::instance()->notify('zhenqi',$input);
  1228. $resp = $providers->balance();
  1229. }
  1230. public function testYunsuoyaofs()
  1231. {
  1232. $providers = new refill\yunsuoyaofs\RefillPhone([]);
  1233. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  1234. // $resp = $providers->query(['order_sn' => '85681626322286098163']);
  1235. // $data = '{"orderid":"AMU21071512111544162","sporderid":"85681626322286098163","userid":"10002671","merchantsubmittime":"20210715121132","resultno":"9","parvalue":"50","remark1":"","payno":"","fundbalance":"-47.7","sign":"45ECFF26E84F7DC3BFFDCFAFF3B1E561"}';
  1236. // $input = json_decode($data, true);
  1237. // refill\RefillFactory::instance()->notify('yunsuoyaofs',$input);
  1238. $resp = $providers->balance();
  1239. }
  1240. public function testZhenqi1m()
  1241. {
  1242. $providers = new refill\zhenqi1m\RefillPhone([]);
  1243. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1244. // $resp = $providers->query(['order_sn' => '45611626334593130605']);
  1245. // $data = '{"out_trade_no":"45611626334593130605","create_time":"1626334606","sp_order_no":"202107152200117311004426885635","status":"1","sign":"CF8EB902F60B76591C898C991361BB4D"}';
  1246. // $input = json_decode($data, true);
  1247. // refill\RefillFactory::instance()->notify('zhenqi1m',$input);
  1248. $resp = $providers->balance();
  1249. }
  1250. public function testHongxudayz()
  1251. {
  1252. $providers = new refill\hongxudayz\RefillPhone([]);
  1253. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1254. // $resp = $providers->query(['order_sn' => '78221626445316011524']);
  1255. $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":""}';
  1256. $input = json_decode($data, true);
  1257. refill\RefillFactory::instance()->notify('hongxudayz',$input);
  1258. }
  1259. public function testHongxudagy()
  1260. {
  1261. $providers = new refill\hongxudagy\RefillPhone([]);
  1262. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1263. // $resp = $providers->query(['order_sn' => '86521626446475240639']);
  1264. // $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":""}';
  1265. // $input = json_decode($data, true);
  1266. // refill\RefillFactory::instance()->notify('hongxudagy',$input);
  1267. $resp = $providers->balance();
  1268. }
  1269. public function testHongxudayz996()
  1270. {
  1271. $providers = new refill\hongxudayz996\RefillPhone([]);
  1272. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1273. // $resp = $providers->query(['order_sn' => '73691626753698522472']);
  1274. $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":""}';
  1275. $input = json_decode($data, true);
  1276. refill\RefillFactory::instance()->notify('hongxudayz996',$input);
  1277. }
  1278. public function testHongxudagy996()
  1279. {
  1280. $providers = new refill\hongxudagy996\RefillPhone([]);
  1281. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1282. // $resp = $providers->query(['order_sn' => '87681626758209689412']);
  1283. $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":""}';
  1284. $input = json_decode($data, true);
  1285. refill\RefillFactory::instance()->notify('hongxudagy996',$input);
  1286. }
  1287. public function testYunchonggong()
  1288. {
  1289. $providers = $this->getProvider('yunchonggong');
  1290. // $resp = $providers->balance();
  1291. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1292. $resp = $providers->query(['order_sn' => '59901635220132734124']);
  1293. $body = '{"orderId":"211026114901000481","appId":"c4vuuOV43q","outOrderId":"59901635220132734124","sign":"4749539f129242a13f1f083dbc114f23","orderStatus":"3","completeTime":"20211026115027","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
  1294. $params = json_decode($body, true);
  1295. $providers = $this->getProvider('yunchonggong', 'RefillCallback');
  1296. $ret = $providers->verify($params);
  1297. $resp = $providers->notify($params);
  1298. }
  1299. public function testBingdht()
  1300. {
  1301. $providers = new refill\bingdht\RefillPhone([]);
  1302. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1303. // $resp = $providers->query(['order_sn' => '62491626761331174794']);
  1304. // $data = '{"szOrderId":"62491626761331174794","fSalePrice":"45.25","szAgentId":"200044","nFlag":"3","szVerifyString":"46745191d31b16ee7978a7f5554357d6","szPhoneNum":"18500608333","szRtnMsg":"","nDemo":"50"}';
  1305. // $input = json_decode($data, true);
  1306. // refill\RefillFactory::instance()->notify('bingdht',$input);
  1307. $resp = $providers->balance();
  1308. }
  1309. public function testYuecheng()
  1310. {
  1311. $providers = new refill\yuecheng\RefillPhone([]);
  1312. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1313. // $resp = $providers->query(['order_sn' => '45101626776884387650']);
  1314. $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"}';
  1315. $input = json_decode($data, true);
  1316. refill\RefillFactory::instance()->notify('yuecheng',$input);
  1317. }
  1318. public function testPrice()
  1319. {
  1320. $amounts = [10, 20, 30, 50, 100, 200, 300, 500];
  1321. $rate = 0.994;
  1322. foreach ($amounts as $amount) {
  1323. $price[] = $amount * $rate;
  1324. }
  1325. }
  1326. public function testCallbackDir()
  1327. {
  1328. $path = "/callback";
  1329. $file = "/mobile/callback/refill_call.php";
  1330. $basename = basename($file);
  1331. $tmp = "{$path}/{$basename}.php";
  1332. return file_exists($tmp);
  1333. }
  1334. public function testWeisPhone()
  1335. {
  1336. $providers = new refill\weisyd\RefillPhone([]);
  1337. $resp = $providers->add(17801048874, 4, 10, ['order_sn' => $this->make_sn()]);
  1338. }
  1339. public function testXcPhone()
  1340. {
  1341. $providers = new refill\xc\RefillPhone([]);
  1342. $resp = $providers->add(13699279618, 5, 100, ['order_sn' => $this->make_sn()]);
  1343. // $resp = $providers->query(['order_sn' => '87961616926444043617']);
  1344. $params['pay_orderid'] = '87961616926444043617';
  1345. $params['pay_iphone'] = '18500608333';
  1346. $params['pay_money'] = '100';
  1347. $params['wt_orderid'] = '202103281816121070';
  1348. $params['status'] = '1';
  1349. $params['sign'] = 'f7be2e859a5a6dc7b1a8273361617752';
  1350. // refill\RefillFactory::instance()->notify('xc',$params);
  1351. }
  1352. public function testAfandPhone()
  1353. {
  1354. $providers = new refill\afand\RefillPhone([]);
  1355. // for ($i = 3; $i > 0; --$i) {
  1356. $resp = $providers->query(['order_sn' => '540668612768904780']);
  1357. // }
  1358. }
  1359. public function testAfandengPhone()
  1360. {
  1361. $providers = new refill\afandeng\RefillPhone([]);
  1362. // for ($i = 5; $i > 0; --$i) {
  1363. $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  1364. // }
  1365. // $resp = $providers->query(['order_sn' => '20941616115610023539']);
  1366. // $params['usr'] = 'afandeng';
  1367. // $params['ord'] = '20941616115610023539';
  1368. // $params['state'] = '2';
  1369. // $params['bz'] = '';
  1370. // $params['sgn'] = 'BA2C9D379C3EB648A0B7AAB3A21A3F6A';
  1371. // refill\RefillFactory::instance()->notify('afandeng',$params);
  1372. }
  1373. public function testWantongPhone()
  1374. {
  1375. $providers = new refill\wantong\RefillPhone([]);
  1376. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1377. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1378. $resp = $providers->query(['order_sn' => '26061618988575301841']);
  1379. $data = '{"uid":"97396885","order_no":"26061618988575301841","mobile_order_no":"","phone_number":"13699279618","face_value":"3000","status":"9","sign":"1a019202656cf4feffe715025fab01bf"}';
  1380. $input = json_decode($data, true);
  1381. // refill\RefillFactory::instance()->notify('wantong',$input);
  1382. }
  1383. public function testXunyinPhone()
  1384. {
  1385. $providers = $this->getProvider('xunyin');
  1386. $resp = $providers->balance();
  1387. // $resp = $providers->add(17703711950, 6, 30, ['order_sn' => $this->make_sn()]);
  1388. // $resp = $providers->query(['order_sn' => '76831617176125893158']);
  1389. // $xml = '<Order><cpid>8417</cpid><orderid>40591617173295524057</orderid><order_no>14784226</order_no><msg>充值中</msg><Code>0000</Code><Cards/></Order>';
  1390. // $resp = $providers->xmlToArray($xml);
  1391. // if ($resp['Code'] === '0000') {
  1392. // return [true, $resp['order_no'], false];
  1393. // } else {
  1394. // return [false, $resp['msg'], false];
  1395. // }
  1396. // $params['ext'] = '';
  1397. // $params['code'] = '8888';
  1398. // $params['sign'] = '428ac223cf3a1f6f3d382aac754e8e17';
  1399. // $params['statemes'] = '成功';
  1400. // $params['id'] = '76831617176125893158';
  1401. // $params['userid'] = '8417';
  1402. // $params['operatorid'] = '1000000083421033115583773201';
  1403. // $params['status'] = 'SUCCESS';
  1404. // refill\RefillFactory::instance()->notify('xunyin',$params);
  1405. $resp = $providers->balance();
  1406. }
  1407. public function testFenshengPhone()
  1408. {
  1409. $file = BASE_HELPER_RAPI_PATH . "/qianqian/RefillPhone.php";
  1410. if(!file_exists($file)){
  1411. Log::record("provider api file={$file} not exist.",Log::DEBUG);
  1412. return false;
  1413. } else {
  1414. require_once($file);
  1415. Log::record("file={$file} load success.",Log::DEBUG);
  1416. }
  1417. $providers = new refill\qianqian\RefillPhone([]);
  1418. $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1419. // $resp = $providers->query(['order_sn' => '27511617764278021035']);
  1420. // $datas = '[{"orderNo":"F2104071058069438461","status":"001","consumerNo":"27511617764278021035","voucherNo":"510490688023364042","mobile":"13699279618"}]';
  1421. // $datas = json_decode($datas,true);
  1422. // foreach ($datas as $data) {
  1423. // refill\RefillFactory::instance()->notify('fensheng',$data);
  1424. // }
  1425. }
  1426. public function testQianqianPhone()
  1427. {
  1428. $providers = new refill\qianqian\RefillPhone([]);
  1429. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1430. // $resp = $providers->query(['order_sn' => '27511617764278021035']);
  1431. // $datas = '[{"orderNo":"F2104071058069438461","status":"001","consumerNo":"27511617764278021035","voucherNo":"510490688023364042","mobile":"13699279618"}]';
  1432. // $datas = json_decode($datas,true);
  1433. // foreach ($datas as $data) {
  1434. // refill\RefillFactory::instance()->notify('fensheng',$data);
  1435. // }
  1436. $resp = $providers->balance();
  1437. }
  1438. public function testQianqianmanPhone()
  1439. {
  1440. $providers = new refill\qianqianman\RefillPhone([]);
  1441. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  1442. // $resp = $providers->query(['order_sn' => '72011621236975003462']);
  1443. $data = '{"orderNo":"F2105171538062539442","status":"019","consumerNo":"72011621236975003462","voucherNo":null,"mobile":"13699279618"}';
  1444. $input = json_decode($data, true);
  1445. refill\RefillFactory::instance()->notify('qianqianman',$input);
  1446. }
  1447. public function testRiyingPhone()
  1448. {
  1449. $providers = new refill\riying\RefillPhone([]);
  1450. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1451. $resp = $providers->query(['ch_trade_no' => '2021041311120213187423105022']);
  1452. $data = '{"UserId":"10050","SysOrderId":"2021041311120213187423105022","OrderId":"15641618283518423567","State":"4","Timestamp":"1618283565746","VoucherType":"1","VoucherContent":"511009928000087852","Sign":"a6ec70a3ea42baae941528398c6d0a43"}';
  1453. $input = json_decode($data, true);
  1454. // refill\RefillFactory::instance()->notify('riying',$input);
  1455. }
  1456. public function testWeishengyPhone()
  1457. {
  1458. $providers = new refill\weishengy\RefillPhone([]);
  1459. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1460. // $resp = $providers->query(['order_sn' => '15551618590601301527']);
  1461. $data = '{"masId":"699270071532654592","oids":"158877719094,166090529155,158887187476","orderNo":"62411618635377880788","orderPrice":"150.00","phone":"18500608333","sign":"3EC10A32FC4CCC976048E1164D0FCBF6","status":"1","time":"1618643281063","type":"2"}';
  1462. $input = json_decode($data, true);
  1463. refill\RefillFactory::instance()->notify('weishengy',$input);
  1464. }
  1465. public function testWailingPhone()
  1466. {
  1467. $providers = new refill\wailing\RefillPhone([]);
  1468. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1469. $resp = $providers->query(['order_sn' => '73241618543784045618']);
  1470. $data = '{"order_id":"73241618543784045618","mchid":"10045","tel":"13699279618","price":"30.00","sign":"4991de3e40f14c198b8c194455ea021b","status":"0","out_order_id":"0"}';
  1471. $input = json_decode($data, true);
  1472. // refill\RefillFactory::instance()->notify('wailing',$input);
  1473. }
  1474. public function testShengyingPhone()
  1475. {
  1476. $providers = new refill\shengying\RefillPhone([]);
  1477. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1478. $resp = $providers->query(['order_sn' => '37571618805115582483']);
  1479. $data = '{"TaskID":"129636","Mobile":"13699279618","Status":"4","ReportTime":"2021-04-19T12:06:16.050","ReportCode":"1:511531522026586295","OutTradeNo":"37571618805115582483","ReceiptNum":"511531522026586295","Sign":"a7f46a988bc8483091d94130804e5078"}';
  1480. $input = json_decode($data, true);
  1481. // refill\RefillFactory::instance()->notify('shengying',$input);
  1482. }
  1483. public function testYunlingPhone()
  1484. {
  1485. $providers = new refill\yunling\RefillPhone([]);
  1486. // $resp = $providers->add(18074608795, 6, 30, ['order_sn' => $this->make_sn()]);
  1487. // $resp = $providers->query(['order_sn' => '73791623147517199719']);
  1488. // $data = '{"orderid":"EAF21060818183032772","sporderid":"73791623147517199719","userid":"10002504","merchantsubmittime":"20210608181912","resultno":"1","parvalue":"30","remark1":"1000000083421060818483137636","payno":"1000000083421060818483137636","fundbalance":"-28.59","sign":"8D77517AC3905ED88BF79EE789A5FA86"}';
  1489. // $input = json_decode($data, true);
  1490. // refill\RefillFactory::instance()->notify('yunling',$input);
  1491. $resp = $providers->balance();
  1492. }
  1493. public function testZhongstPhone()
  1494. {
  1495. $providers = new refill\zhongst\RefillPhone([]);
  1496. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1497. // $resp = $providers->query(['order_sn' => '48941618981770389271']);
  1498. // $data = ' {"szOrderId":"66571619060147539784","fSalePrice":"46.5","szAgentId":"200030","nFlag":"2","szVerifyString":"c1e88701b89a4887996822d708bed5f5","szPhoneNum":"13699279618","szRtnMsg":"161122673971","nDemo":"50"}';
  1499. // $input = json_decode($data, true);
  1500. // refill\RefillFactory::instance()->notify('zhongst',$input);
  1501. $resp = $providers->balance();
  1502. }
  1503. public function testXunaoPhone()
  1504. {
  1505. $providers = new refill\xunao\RefillPhone([]);
  1506. // $resp = $providers->add(18074608795, 6, 10, ['order_sn' => $this->make_sn()]);
  1507. // $resp = $providers->query(['order_sn' => '40021619431386253803', 'card_no' => 18074608795, 'card_type' => 6]);
  1508. // $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"}';
  1509. // $input = json_decode($data, true);
  1510. // refill\RefillFactory::instance()->notify('xunao',$input);
  1511. $resp = $providers->balance();
  1512. }
  1513. public function testYonghePhone()
  1514. {
  1515. $providers = new refill\yonghe\RefillPhone([]);
  1516. // $resp = $providers->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
  1517. // $resp = $providers->query(['order_sn' => '20461619597297972685']);
  1518. // $data = '{"szOrderId":"20461619597297972685","fSalePrice":"29.955","szAgentId":"200115","nFlag":"2","szVerifyString":"b5c292a13c5e67a9b850eb37239682ae","szPhoneNum":"13699279618","szRtnMsg":"2021042822001139701437383521","nDemo":"30"}';
  1519. // $input = json_decode($data, true);
  1520. // refill\RefillFactory::instance()->notify('yonghe',$input);
  1521. $resp = $providers->balance();
  1522. }
  1523. public function testJumiPhone()
  1524. {
  1525. $providers = new refill\jumikc\RefillPhone([]);
  1526. // $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
  1527. // $resp = $providers->query(['order_sn' => '12161619768293529384']);
  1528. // $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"}';
  1529. // $input = json_decode($data, true);
  1530. // refill\RefillFactory::instance()->notify('jumi',$input);
  1531. $resp = $providers->balance();
  1532. }
  1533. public function testJumiOil()
  1534. {
  1535. $providers = new refill\jumi\RefillOil([]);
  1536. // $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
  1537. // $resp = $providers->query(['order_sn' => '29021620617872685187']);
  1538. $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"}';
  1539. $input = json_decode($data, true);
  1540. refill\RefillFactory::instance()->notify('jumi',$input);
  1541. }
  1542. public function testFengyePhone()
  1543. {
  1544. $providers = new refill\fengye\RefillPhone([]);
  1545. // $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
  1546. // $resp = $providers->query(['order_sn' => '53511620355988978053', 'card_no' => 18074608795, 'card_type' => 6]);
  1547. $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"}';
  1548. $input = json_decode($data, true);
  1549. refill\RefillFactory::instance()->notify('fengye',$input);
  1550. }
  1551. public function testYunsuoyaoPhone()
  1552. {
  1553. $providers = new refill\yunsuoyao\RefillPhone([]);
  1554. // $resp = $providers->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
  1555. // $resp = $providers->query(['order_sn' => '20431621331092296201']);
  1556. // $data = '{"orderid":"RLU21051817441937847","sporderid":"20431621331092296201","userid":"10002501","merchantsubmittime":"20210518174858","resultno":"9","parvalue":"30","remark1":"","payno":"","fundbalance":"-28.74","sign":"426EAC103B79505BAE7AB3F16886F1A8"}';
  1557. // $input = json_decode($data, true);
  1558. // refill\RefillFactory::instance()->notify('yunsuoyao',$input);
  1559. $resp = $providers->balance();
  1560. }
  1561. public function testAfdPhone()
  1562. {
  1563. $providers = new refill\afd\RefillPhone([]);
  1564. // $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
  1565. // $resp = $providers->query(['order_sn' => '71001621233525947994']);
  1566. $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"}';
  1567. $input = json_decode($data, true);
  1568. refill\RefillFactory::instance()->notify('afd',$input);
  1569. }
  1570. public function testLuqianPhone()
  1571. {
  1572. $providers = new refill\luqian\RefillPhone([]);
  1573. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  1574. $resp = $providers->query(['order_sn' => '2829660672500596314764']);
  1575. $data = '{"amount":"100","charge_type":"0","code":"1","partner_id":"38","phone":"18500608333","sign":"c2c86cccc73fa991a63c369e683c91f2","partner_order_no":"34101618897099329575","official_order_id":"110103308072104201338340278420"}';
  1576. $input = json_decode($data, true);
  1577. // refill\RefillFactory::instance()->notify('luqian',$input);
  1578. }
  1579. public function testAfandfsPhone()
  1580. {
  1581. $providers = new refill\afandfs\RefillPhone([]);
  1582. // $resp = $providers->add(15139608757, 4, 30, ['order_sn' => $this->make_sn()]);
  1583. // $resp = $providers->query(['order_sn' => '65101618975926761630']);
  1584. // $data = '{"amount":"30","charge_type":"2","code":"1","partner_id":"52","phone":"15139608757","sign":"a7f54c1ac3e1af72f9fc849086cc4bec","partner_order_no":"65101618975926761630","official_order_id":"20210421113256628350"}';
  1585. // $input = json_decode($data, true);
  1586. // refill\RefillFactory::instance()->notify('afandfs',$input);
  1587. $resp = $providers->balance();
  1588. }
  1589. public function testYunlingfsPhone()
  1590. {
  1591. $providers = new refill\yunlingfs\RefillPhone([]);
  1592. // $resp = $providers->add(15139608757, 4, 50, ['order_sn' => $this->make_sn()]);
  1593. // $resp = $providers->query(['order_sn' => '79251623739433607563']);
  1594. // $data = '{"orderid":"BGC21061514434393910","sporderid":"79251623739433607563","userid":"10002543","merchantsubmittime":"20210615144434","resultno":"1","parvalue":"50","remark1":"20210615144420321813","payno":"20210615144420321813","fundbalance":"-47.65","sign":"6B9B7C15A3F9CBC773562327B6744B1E"}';
  1595. // $input = json_decode($data, true);
  1596. // refill\RefillFactory::instance()->notify('yunlingfs',$input);
  1597. $resp = $providers->balance();
  1598. }
  1599. public function testTianchengPhone()
  1600. {
  1601. $providers = new refill\tiancheng\RefillPhone([]);
  1602. // $resp = $providers->add(18074608795, 6, 30, ['order_sn' => $this->make_sn()]);
  1603. // $resp = $providers->query(['order_sn' => '15301619399212504464']);
  1604. // $data = ' {"result":"fail","msg":"0","order":"null","phone_no":"13699279618","amount":"10","op_no":"84801619340283980506","settle":"0","sign":"D64039ED791920B08BDA9DD95700C0E6"}';
  1605. // $input = json_decode($data, true);
  1606. // refill\RefillFactory::instance()->notify('tiancheng',$input);
  1607. $resp = $providers->balance();
  1608. }
  1609. public function testLingzhPhone()
  1610. {
  1611. $providers = new refill\lingzh\RefillPhone([]);
  1612. // $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  1613. // $resp = $providers->query(['order_sn' => '59911615124025101286']);
  1614. $resp = $providers->balance();
  1615. // $input['usr'] = 1;
  1616. // $input['ord'] = '52741615119546453690';
  1617. // $input['bz'] = '';
  1618. // $input['state'] = 2;
  1619. // $input['sgn'] = 'FFCBB75C307154DD306F4EC75BB69A6D';
  1620. // refill\RefillFactory::instance()->notify('lingzh',$input);
  1621. }
  1622. public function testAfandnewPhone()
  1623. {
  1624. $providers = new refill\afandnew\RefillPhone([]);
  1625. // $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
  1626. // $resp = $providers->query(['order_sn' => '45371617101073876975', 'ch_trade_no' => '33018443659736309']);
  1627. $params = '{"amount":"100","carrierOrderNo":null,"mobile":"18500608333","orderNo":"45371617101073876975","orderStatus":3,"sign":"8DE392AD6B4730AD9EE0FC2B95BBDF17","tradeNo":"33018443659736309"}';
  1628. $input = json_decode($params, true);
  1629. refill\RefillFactory::instance()->notify('afandnew', $input);
  1630. }
  1631. public function testYifaPhone()
  1632. {
  1633. $providers = new refill\yifa\RefillPhone([]);
  1634. $resp = $providers->add(15120035568, 5, 50, ['order_sn' => $this->make_sn()]);
  1635. }
  1636. public function testTianjtOil()
  1637. {
  1638. $cardno = 1000111100021211884;
  1639. $providers = new refill\tianjt\RefillOil([]);
  1640. $resp = $providers->add($cardno, 2, 500, ['order_sn' => $this->make_sn()]);
  1641. }
  1642. public function testWeitPhone()
  1643. {
  1644. $providers = new refill\weit\RefillPhone([]);
  1645. for ($i = 0; $i <= 10; $i++) {
  1646. $resp = $providers->add(18500608333, 5, 10, ['order_sn' => $this->make_sn()]);
  1647. }
  1648. }
  1649. public function testWeitCB()
  1650. {
  1651. $params['sign'] = 'af820c33472f4b571fa0c48483dfb975';
  1652. $params['status'] = 0;
  1653. $params['price'] = 30;
  1654. $params['op_order_id'] = '';
  1655. $params['mch_order_id'] = '900664281823957221';
  1656. $params['pt_order_id'] = '2021011802434412825405218901';
  1657. $params['pay_type'] = '';
  1658. $params['tel'] = 18500608333;
  1659. $params['mchid'] = 10014;
  1660. $resp = http_request($this->mReqHost . "/mobile/refill_weit.php", $params, 'POST');
  1661. }
  1662. public function testYifaCB()
  1663. {
  1664. $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"}';
  1665. $input = json_decode($body, true);
  1666. refill\RefillFactory::instance()->notify('yifa', $input);
  1667. }
  1668. public function testBjbQuery()
  1669. {
  1670. $providers = new refill\bjb\RefillPhone([]);
  1671. $refill_info = ['order_sn' => 110667993758599771, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  1672. $resp = $providers->query($refill_info);
  1673. }
  1674. public function testXcQuery()
  1675. {
  1676. $providers = new refill\xc\RefillPhone([]);
  1677. $refill_info = ['order_sn' => 950663423236726632, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  1678. $resp = $providers->query($refill_info);
  1679. }
  1680. public function testTianjtQuery()
  1681. {
  1682. $providers = new refill\tianjt\RefillOil([]);
  1683. $refill_info = ['order_sn' => 680665862267622221, 'ch_trade_no' => 499, 'card_no' => 1000111200005252927];
  1684. $resp = $providers->query($refill_info);
  1685. }
  1686. public function testSaihuOil()
  1687. {
  1688. $providers = new refill\saihu\RefillOil([]);
  1689. $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
  1690. }
  1691. public function testBdtOil()
  1692. {
  1693. $providers = new refill\bdt\RefillOil([]);
  1694. $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => '200229600556618886']);
  1695. }
  1696. public function testGFTDOil()
  1697. {
  1698. $providers = new refill\gftd\RefillOil([]);
  1699. $resp = $providers->add(1000111100020445281, mtopcard\SinopecCard, 100, ['order_sn' => $this->make_sn()]);
  1700. }
  1701. public function testYichangtOil()
  1702. {
  1703. $providers = new refill\yichangt\RefillOil([]);
  1704. $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 200, ['order_sn' => $this->make_sn()]);
  1705. // $resp = $providers->query(['order_sn' => '87591620379260314044']);
  1706. $data = '{"appid":"app570259129507","order_id":"M202105077888184428723706","merchant_order_id":"82231620378877155624","status":"3","cash":"100","time":"1620378961450","nonce":"2fad56d59a9f46d896c15b0cff74bc","signature":"57a6d24ec376b58bb433cfcf8528d53cb276eac8"}';
  1707. $input = json_decode($data, true);
  1708. // refill\RefillFactory::instance()->notify('yichangt',$input);
  1709. }
  1710. public function testGFTDCB()
  1711. {
  1712. $data = '{"channelOrderNumber":"79091610959059372019","orderNumber":"GYFL1610959060397001","message":"充值成功","storage":"881036222bd8f067ff47d248c75f4c8d","voucher":"","status":101}';
  1713. $url = "http://192.168.1.220/mobile/refill_gftd.php?" . $data;
  1714. $resp = http_post_data($url, $data, ['Content-Type: application/json;charset=UTF-8;', 'Accept:application/json;charset=UTF-8;']);
  1715. }
  1716. public function testJiecPhone()
  1717. {
  1718. $providers = new refill\jiec\RefillPhone([]);
  1719. $resp = $providers->add('18500608333', 5, 30, ['order_sn' => $this->make_sn()]);
  1720. }
  1721. public function testBxtwtCB()
  1722. {
  1723. $data = '{"order_number":18219726,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"863b4d972f2a4d39a9af7396879116c4","voucher":"","vouchertype":"","voucherurl":"","tradeNo":"100662475851197741"}';
  1724. }
  1725. public function testTianjtJDVerify()
  1726. {
  1727. $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';
  1728. $url = "http://192.168.1.220/mobile/refill_tianjt.php?" . $data;
  1729. $resp = http_request($url);
  1730. }
  1731. public function testSuhcPDD()
  1732. {
  1733. $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';
  1734. $url = "https://www.xyzshops.cn/mobile/refill_suhcpdd.php?" . $data;
  1735. $resp = http_request($url);
  1736. }
  1737. public function testSuhcTMVerify()
  1738. {
  1739. $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';
  1740. $url = "https://www.xyzshops.cn/mobile/refill_suhctm.php?" . $data;
  1741. $resp = http_request($url);
  1742. }
  1743. public function testBeixtVerify()
  1744. {
  1745. $data = '{"order_number":18219726,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"863b4d972f2a4d39a9af7396879116c4","voucher":"","vouchertype":"","voucherurl":"","tradeNo":"100662475851197741"}';
  1746. $url = "https://www.xyzshops.cn/mobile/refill_bxtwt.php";
  1747. $headers = ['Content-Type: application/json'];
  1748. $resp = http_post_data($url, $data, $headers);
  1749. }
  1750. public function testInput()
  1751. {
  1752. $input = fopen("php://input", "rw");
  1753. file_put_contents($input, 'xxxx');
  1754. $content = file_get_contents('php://input');
  1755. }
  1756. public function testUrl()
  1757. {
  1758. $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';
  1759. $params = preg_split('/&/', $data);
  1760. foreach ($params as $pair) {
  1761. $kv = explode('=', $pair);
  1762. $count = count($kv);
  1763. if ($count === 1) {
  1764. $key = $kv[0];
  1765. $val = "";
  1766. } elseif ($count === 2) {
  1767. $key = $kv[0];
  1768. $val = $kv[1];
  1769. } else {
  1770. continue;
  1771. }
  1772. Log::record("{$key}:{$val}", Log::DEBUG);
  1773. }
  1774. }
  1775. public function testAddoil()
  1776. {
  1777. $url = $this->mReqHost . "/mobile/index.php";
  1778. $notifyurl = 'http://121.89.196.45/mobile/signature.php';
  1779. $params = ['mchid' => $this->mMchid,
  1780. 'cardno' => '1000111100020445281',
  1781. 'amount' => "100",
  1782. "act" => "refill",
  1783. "op" => "add",
  1784. 'order_sn' => $this->make_sn(),
  1785. 'notifyurl' => $notifyurl];
  1786. $resp = $this->send_md5($url, $params);
  1787. Log::record($resp, Log::DEBUG);
  1788. }
  1789. public function testBalance()
  1790. {
  1791. $url = $this->mReqHost . "/mobile/index.php";
  1792. $params = ['mchid' => 1092,
  1793. "act" => "refill",
  1794. "op" => "balance"];
  1795. $resp = $this->send_md5($url, $params);
  1796. Log::record($resp, Log::DEBUG);
  1797. }
  1798. public function testNotify()
  1799. {
  1800. $params = [
  1801. "mchid" => 10202,
  1802. "order_sn" => '21090216132600003_11675',
  1803. "amount" => '30.00',//intval($refill_info['refill_amount'] + 0.05),
  1804. "cardno" => 18639492164,
  1805. "trade_no" => 8693160683914496896438,
  1806. "idcard" => "",
  1807. "card_name" => "",
  1808. 'official_sn' => "",
  1809. 'message' => "匹配不到合适的充值通道",
  1810. "state" => 'CANCEL'];
  1811. $sign = $this->md5_sign($params,'KxK9f3yaBDOXVwvuOKDozvQ9Mt1CoqRX');
  1812. $notify_url = 'https://openapi-gateway-test.bbinsure.cn/ants_charge/v1/charge/order/notify/yeziOrderNew/1140';
  1813. $resp = http_request($notify_url, $params, 'POST');
  1814. }
  1815. public function testAddPhoe()
  1816. {
  1817. $url = $this->mReqHost . "/mobile/index.php";
  1818. $params = ['mchid' => $this->mMchid,
  1819. 'cardno' => '',
  1820. 'amount' => 100,
  1821. "act" => "refill",
  1822. "op" => "add",
  1823. 'order_sn' => '',
  1824. 'notifyurl' => "https://www.baoyung.com/api/unionservice/yezicharge"];
  1825. Log::record(json_encode($params), Log::DEBUG);
  1826. // $resp = $this->send_md5($url, $params);
  1827. }
  1828. public function testProxyHelper()
  1829. {
  1830. $phone = '13911129867';
  1831. $amount = 100;
  1832. $url = $this->mReqHost . "/mobile/index.php";
  1833. $params = ['mchid' => $this->mMchid,
  1834. 'cardno' => $phone,
  1835. 'amount' => $amount,
  1836. "act" => "refill",
  1837. "op" => "add",
  1838. 'order_sn' => $this->make_sn(),
  1839. 'notifyurl' => "https://xxx"];
  1840. $proxy = new refill_proxy("xxx");
  1841. $resp = $proxy->send($url, $params);
  1842. }
  1843. public function testGoods()
  1844. {
  1845. $req_url = $this->mReqHost . '/mobile/index.php';
  1846. $params = ['mchid' => $this->mMchid,
  1847. "act" => "refill",
  1848. "op" => "goods"];
  1849. $resp = $this->send_md5($req_url, $params);
  1850. }
  1851. public function testQueryFactory()
  1852. {
  1853. refill\RefillFactory::instance()->query(295);
  1854. }
  1855. public function testQuery()
  1856. {
  1857. //$req_url = 'https://www.xyzshops.cn/mobile/index.php';
  1858. // $notifyurl = 'https://www.xyzshops.cn/mobile/signature.php';
  1859. $req_url = BASE_SITE_URL . '/mobile/index.php';
  1860. $notifyurl = 'https://www.xyzshops.cn/mobile/signature.php';
  1861. $params = ['mchid' => 1,
  1862. "act" => "refill",
  1863. "op" => "query",
  1864. 'order_sn' => "13281476"];
  1865. $resp = $this->send_md5($req_url, $params);
  1866. }
  1867. public function testRemoveSession()
  1868. {
  1869. $resp = http_request(BASE_SITE_URL . "/mobile/signature.php", [], 'POST');
  1870. }
  1871. public function testTianjtCB()
  1872. {
  1873. // $notifyurl = BASE_SITE_URL . "/mobile/refill_tianjt.php";
  1874. $notifyurl = "https://www.xyzshops.cn/mobile/refill_tianjt.php";
  1875. // $notifyurl = "https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_tianjt.php";
  1876. $params = ['onlystr' => '690665858589475818',
  1877. 'amt' => 1000,
  1878. 'jdno' => '',
  1879. 'notifyurl' => $notifyurl,
  1880. 'cardtype' => 'Sinoepc',
  1881. 'batchid' => 30589,
  1882. 'cardno' => '1000113300007993287',
  1883. 'orgid' => '1590993600',
  1884. 'status' => 3];
  1885. $sign = $this->md5_sign($params);
  1886. $params['sign'] = $sign;
  1887. $resp = http_request($notifyurl, $params, 'POST');
  1888. Log::record($resp, Log::DEBUG);
  1889. }
  1890. public function testBJBCB()
  1891. {
  1892. $params = [
  1893. 'usr' => '13699279618',
  1894. 'ord' => '710662733975412771',
  1895. 'state' => '2',
  1896. 'bz' => '',
  1897. 'sgn' => 'AC9AFD254DE682D8440A97CA68B992DA'
  1898. ];
  1899. $resp = http_request("https://www.xyzshops.cn/mobile/refill_bjb.php", $params, 'POST');
  1900. }
  1901. public function testJiecCB()
  1902. {
  1903. $params['result'] = 'fail';
  1904. $params['msg'] = '0';
  1905. $params['order'] = 'null';
  1906. $params['phone_no'] = '18500608333';
  1907. $params['amount'] = '30.00';
  1908. $params['op_no'] = '800663597981819221';
  1909. $params['sign'] = '2510046895e8e12322c8a32547905ee9';
  1910. $resp = http_request($this->mReqHost . "/mobile/refill_jiec.php", $params, 'POST');
  1911. }
  1912. public function testZFKJ()
  1913. {
  1914. //带签名参数:mchid=1090&act=refill&op=add&cardno=100112121212212133
  1915. //&amount=10&order_sn=PH2012261356569433&
  1916. //notifyurl=https%3A%2F%2Fqzcz.edusahoo.com.cn%2Findex%2Findex%2Fcallback
  1917. //&sign=4a3ac5f9706e64aa70c6cab0fc5839d3
  1918. $params = ['mchid' => 1090,
  1919. 'cardno' => '100112121212212133',
  1920. 'amount' => '10',
  1921. "act" => "refill",
  1922. "op" => "add",
  1923. 'order_sn' => 'PH2012261356569433',
  1924. 'notifyurl' => 'https://qzcz.edusahoo.com.cn/index/index/callback'];
  1925. $resp = $this->send_md5(BASE_SITE_URL . '/mobile/index.php', $params);
  1926. }
  1927. protected function check_empty($value)
  1928. {
  1929. if (!isset($value))
  1930. return true;
  1931. if ($value === null)
  1932. return true;
  1933. if (trim($value) === "")
  1934. return true;
  1935. return false;
  1936. }
  1937. public function testcreateSign()
  1938. {
  1939. $params['act'] = 'refill';
  1940. $params['amount'] = '30';
  1941. $params['cardno'] = '18111516552';
  1942. $params['mchid'] = '10179';
  1943. $params['notifyurl'] = 'http://czapi2.1jinb.net/YeZiHCCallBackOrderServlet';
  1944. $params['op'] = 'add';
  1945. $params['order_sn'] = 'JFNOR10835056877';
  1946. $sign = $this->md5_sign($params);
  1947. }
  1948. public function testCheckphone()
  1949. {
  1950. $check = function ($phone) {
  1951. $url = 'https://mobileempty.shumaidata.com/mobileempty';
  1952. $params['mobile'] = $phone;
  1953. $headers = array();
  1954. array_push($headers, "Authorization:APPCODE " . '8f92d951293f4d2ea48ff86d5a70c537');
  1955. $resp = http_request($url, $params, 'GET', false, $headers);
  1956. $resp = json_decode($resp, true);
  1957. if ($resp['success'] == true && $resp['code'] == 200) {
  1958. Log::record("data phone:{$phone} , status : {$resp['data']['status']}", Log::DEBUG);
  1959. if (in_array($resp['data']['status'], [0, 3, 4, 5])) {
  1960. return false;
  1961. }
  1962. } else {
  1963. Log::record("data phone:{$phone} , 不支持的号段", Log::DEBUG);
  1964. }
  1965. };
  1966. $check(17801048874);
  1967. }
  1968. public function testCtSign()
  1969. {
  1970. $params['act'] = 'refill';
  1971. $params['op'] = 'add';
  1972. $params['mchid'] = 10221;
  1973. $params['cardno'] = '17610802062';
  1974. $params['amount'] = 30;
  1975. $params['order_sn'] = '20210926154819606056656';
  1976. $params['notifyurl'] = 'http://117.186.248.196:88/Asyn/notifyCall/367EA7';
  1977. $sign = $this->md5_sign($params,'E019D21A1E6611ECA4FD00163E179561');
  1978. }
  1979. private function md5_sign($params,$key = '')
  1980. {
  1981. ksort($params);
  1982. $body = "";
  1983. $i = 0;
  1984. foreach ($params as $k => $v) {
  1985. if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
  1986. if ($i == 0) {
  1987. $body .= "{$k}" . "=" . urlencode($v);
  1988. } else {
  1989. $body .= "&" . "{$k}" . "=" . urlencode($v);
  1990. }
  1991. $i++;
  1992. }
  1993. }
  1994. $body .= "&key={$key}";
  1995. return md5($body);
  1996. }
  1997. public function testCallMech()
  1998. {
  1999. $logic = Logic('queue');
  2000. $logic->NotifyMerchantComplete(['order_id' => 18171, 'manual' => true]);
  2001. }
  2002. //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefill::testCallMech)( .*)?$/" --test-suffix TestRefill.php /var/www/html/test
  2003. private function send($url, $params)
  2004. {
  2005. $mchid = $params['mchid'];
  2006. $pri_key = BASE_DATA_PATH . "/api/merchant/key/{$mchid}_pri.pem";
  2007. $key = file_get_contents($pri_key);
  2008. $pri = openssl_get_privatekey($key);
  2009. $body = $this->body($params);
  2010. openssl_sign($body, $signed, $pri);
  2011. $sign = base64_encode($signed);
  2012. $params['sign'] = $sign;
  2013. $resp = http_request($url, $params, 'POST');
  2014. Log::record("resp:{$resp}", Log::DEBUG);
  2015. }
  2016. private function send_md5($url, $params)
  2017. {
  2018. $body = $this->body($params);
  2019. $body .= "&key={$this->mKey}";
  2020. $params['sign'] = md5($body);
  2021. $resp = http_request($url, $params, 'POST');
  2022. Log::record("resp:{$resp}", Log::DEBUG);
  2023. return $resp;
  2024. }
  2025. public function testCardType()
  2026. {
  2027. $cardno = '1000111100021211884';
  2028. $ret = preg_match('/^1[0-9]{18}$/', $cardno, $matches);
  2029. }
  2030. public function testMtrand()
  2031. {
  2032. }
  2033. public function testHttpRefill()
  2034. {
  2035. $mchid = '000001';
  2036. $pri_key = BASE_DATA_PATH . "/api/merchant/key/{$mchid}_pri.pem";
  2037. $key = file_get_contents($pri_key);
  2038. $pri = openssl_get_privatekey($key);
  2039. $params = ['MCHID' => $mchid, 'cardno' => '1000111100021211884', 'amt' => "100", "act" => "refill", "op" => "addoil"];
  2040. $body = $this->body($params);
  2041. openssl_sign($body, $signed, $pri);
  2042. $sign = base64_encode($signed);
  2043. $params['sign'] = $sign;
  2044. $resp = http_request(BASE_SITE_URL . "/mobile/index.php", $params, 'POST');
  2045. }
  2046. private function body($params)
  2047. {
  2048. ksort($params);
  2049. $body = "";
  2050. $i = 0;
  2051. foreach ($params as $k => $v) {
  2052. if (false === $this->checkEmpty($v) && "@" != substr($v, 0, 1)) {
  2053. if ($i == 0) {
  2054. $body .= "{$k}" . "=" . urlencode($v);
  2055. } else {
  2056. $body .= "&" . "{$k}" . "=" . urlencode($v);
  2057. }
  2058. $i++;
  2059. }
  2060. }
  2061. return $body;
  2062. }
  2063. private function checkEmpty($value)
  2064. {
  2065. if (!isset($value))
  2066. return true;
  2067. if ($value === null)
  2068. return true;
  2069. if (trim($value) === "")
  2070. return true;
  2071. return false;
  2072. }
  2073. public function testKsort()
  2074. {
  2075. $age = ["Peter" => "35", "Ben" => "37", "Joe" => "43"];
  2076. ksort($age);
  2077. foreach ($age as $x => $x_value) {
  2078. echo "Key=" . $x . ", Value=" . $x_value;
  2079. echo "<br>";
  2080. }
  2081. }
  2082. public function testip()
  2083. {
  2084. $model_merchant = Model('merchant');
  2085. $merchant_info = $model_merchant->getMerchantInfo(['mchid' => 1]);
  2086. $ipwhitelist = unserialize($merchant_info['ip_white_list']);
  2087. $res = json_encode($ipwhitelist);
  2088. }
  2089. //测试向内部店提交订单,可先屏蔽其它充值通道
  2090. public function testAddoilToInnerStore()
  2091. {
  2092. $url = $this->mReqHost . "/mobile/index.php";
  2093. $notifyurl = BASE_SITE_URL . '/mobile/signature.php';
  2094. $params = ['mchid' => 1,
  2095. 'cardno' => '1000111100020445281',
  2096. 'amount' => "1000",
  2097. "act" => "refill",
  2098. "op" => "add",
  2099. 'order_sn' => $this->make_sn(),
  2100. 'notifyurl' => $notifyurl];
  2101. $resp = $this->send_md5($url, $params);
  2102. Log::record($resp, Log::DEBUG);
  2103. }
  2104. public function testRefillInnerCB()
  2105. {
  2106. $params = ['state_type' => 'order_cancel', 'order_id' => 311, 'channel_name' => 'lx'];
  2107. $resp = http_request(BASE_SITE_URL . '/mobile/refill_inner.php', $params, 'POST');
  2108. }
  2109. public function testArgs()
  2110. {
  2111. Log::record($_SERVER['argv'], Log::DEBUG);
  2112. }
  2113. public function testCall()
  2114. {
  2115. $order_id = 14974;
  2116. QueueClient::async_push("NotifyMerchantComplete", ['order_id' => $order_id, 'manual' => true], 10);
  2117. }
  2118. public function testSyncconfig()
  2119. {
  2120. $name_val_cfg = function ($items) {
  2121. $result = [];
  2122. foreach ($items as $item) {
  2123. $name = $item->name();
  2124. $result[$name] = $item;
  2125. }
  2126. return $result;
  2127. };
  2128. $name_val_row = function ($items) {
  2129. $result = [];
  2130. foreach ($items as $item) {
  2131. $name = $item['name'];
  2132. $result[$name] = $item;
  2133. }
  2134. return $result;
  2135. };
  2136. $match = function ($all, $cur) {
  2137. $insert = [];
  2138. foreach ($all as $key => $value) {
  2139. if (!array_key_exists($key, $cur)) {
  2140. $insert[] = $key;
  2141. }
  2142. }
  2143. return $insert;
  2144. };
  2145. $inserter = function ($mod, $type, $names) {
  2146. foreach ($names as $name) {
  2147. $data = ['name' => $name, 'type' => $type];
  2148. $mod->insert($data);
  2149. }
  2150. };
  2151. $providers = refill\RefillFactory::instance()->providers();
  2152. $oils = $name_val_cfg($providers['oil']);
  2153. $phones = $name_val_cfg($providers['phone']);
  2154. $mod_prov = Model('refill_provider');
  2155. $oil_items = $mod_prov->getProviderList(['type' => 1]);
  2156. $oil_items = $name_val_row($oil_items);
  2157. $oil_inserts = $match($oils, $oil_items);
  2158. $phone_items = $mod_prov->getProviderList(['type' => 2]);
  2159. $phone_items = $name_val_row($phone_items);
  2160. $phone_inserts = $match($phones, $phone_items);
  2161. $inserter($mod_prov, 1, $oil_inserts);
  2162. $inserter($mod_prov, 2, $phone_inserts);
  2163. }
  2164. public function testStat()
  2165. {
  2166. $model_refill_order = Model('refill_order');
  2167. $stat = Model('')->table('refill_order,vr_order')->join('inner')
  2168. ->on('refill_order.order_id=vr_order.order_id')
  2169. ->field('sum(refill_amount) as refill_amounts , sum(channel_amount) as channel_amounts , sum(mch_amount) as mch_amounts')
  2170. ->where([])->select();
  2171. }
  2172. public function testRefillGoods()
  2173. {
  2174. $goods = refill\RefillFactory::instance()->goods();
  2175. }
  2176. private function make_mobile()
  2177. {
  2178. $no = "1" . mt_rand(3000000000, 3999999999);
  2179. return $no;
  2180. }
  2181. private function refill_info($card_no, $card_type)
  2182. {
  2183. $data = rcache($card_no, 'cardrefill-');
  2184. if (empty($data)) {
  2185. $mod_topcard = Model('topcard');
  2186. $ret = $mod_topcard->get_card($card_no);
  2187. if (empty($ret)) {
  2188. $bind_phone = $this->make_mobile();
  2189. $mod_topcard->add($card_no, $card_type, time(), $bind_phone);
  2190. $data['bind_phone'] = $bind_phone;
  2191. $data['refill_time'] = time();
  2192. $data['times'] = 0;
  2193. wcache($card_no, $data, 'cardrefill-');
  2194. } else {
  2195. $val = $ret[0];
  2196. $data['bind_phone'] = $val['bind_phone'];
  2197. $data['refill_time'] = time();
  2198. $data['times'] = 0;
  2199. }
  2200. }
  2201. return $data;
  2202. }
  2203. public function testGetMobile()
  2204. {
  2205. $card_no = '1000119000001679247';
  2206. $card_type = 1;
  2207. $info = $this->refill_info($card_no, $card_type);
  2208. }
  2209. private function check_mchorder($mchid, $mch_order)
  2210. {
  2211. if (empty($mch_order)) {
  2212. return true;
  2213. } else {
  2214. $refill_order = Model('refill_order');
  2215. $ret = $refill_order->getOrderInfo(['mchid' => $mchid, 'mch_order' => $mch_order]);
  2216. return empty($ret);
  2217. }
  2218. }
  2219. public function testCheckMchorder()
  2220. {
  2221. $ret = $this->check_mchorder(1, '13281475');
  2222. }
  2223. public function testMakemobile()
  2224. {
  2225. $mobile = refill\util::make_mobile();
  2226. $ret = refill\util::set_black('1000111100020445281');
  2227. }
  2228. public function testLoadBlack()
  2229. {
  2230. $path = BASE_DATA_PATH . "/log";
  2231. $names = ['20210119-mobile.log',
  2232. '20210120-mobile.log', '20210121-mobile.log', '20210122-mobile.log', '20210123-mobile.log',
  2233. '20210124-mobile.log', '20210125-mobile.log'];
  2234. foreach ($names as $name) {
  2235. $file_name = $path . "/" . $name;
  2236. refill\util::black_from_log($file_name);
  2237. }
  2238. }
  2239. public function testStats()
  2240. {
  2241. $date = date('Y-m-d', time());
  2242. $today = strtotime("{$date}");
  2243. $times_begin = function ($start) {
  2244. $times = [];
  2245. $begin = $start;
  2246. for ($i = 0; $i < 7; $i++) {
  2247. $times[] = $begin;
  2248. $begin -= 86400;
  2249. }
  2250. return $times;
  2251. };
  2252. $reader = function ($mchid, $time) {
  2253. $cond['mchid'] = $mchid;
  2254. $cond['inner_status'] = 0;
  2255. $cond['refill_order.order_time'] = ['between', [$time, $time + 86400 - 1]];
  2256. $items = Model('')->table('refill_order,vr_order')->join('inner')
  2257. ->on('refill_order.order_id=vr_order.order_id')
  2258. ->field('count(*) as order_count, vr_order.order_state, sum(mch_amount) as mch_amounts')
  2259. ->group('vr_order.order_state')
  2260. ->where($cond)->select();
  2261. return $items;
  2262. };
  2263. $begins = $times_begin($today);
  2264. $mchid = 10096;
  2265. // $states = rcache($this->mchid() , 'refillstat-');
  2266. $states = unserialize($states ?? "");
  2267. if (empty($states)) $states = [];
  2268. $result = [];
  2269. $cache = [];
  2270. foreach ($begins as $begin) {
  2271. if (array_key_exists($begin, $states)) {
  2272. $item = $states[$begin];
  2273. } else {
  2274. $item = $reader($mchid, $begin);
  2275. }
  2276. $result[$begin] = $item;
  2277. //判断item 中充值中的状态是否为0,为0的情况下放进cache
  2278. $cache = $item;
  2279. }
  2280. wcache($this->mchid(), $cache, 'refillstat-');
  2281. return $result;
  2282. }
  2283. public function testNotifyx()
  2284. {
  2285. $mch_cache = rcache("merchant-notify", 'refill-');
  2286. $caches = empty($mch_cache['data']) ? [] : unserialize($mch_cache['data']);
  2287. $new_caches = [];
  2288. $merchants = Model('merchant')->getMerchantList([], '', '', 'merchant.*,member.available_predeposit', "0,1000");
  2289. foreach ($merchants as $merchant) {
  2290. $mchid = $merchant['mchid'];
  2291. $phone = $merchant['contact_phone'] ?? "";
  2292. $available_pd = intval($merchant['available_predeposit']);
  2293. $alarm_pd = intval($merchant['alarm_amount']) < 10000 ? 10000 : intval($merchant['alarm_amount']);
  2294. if (array_key_exists($mchid, $caches)) {
  2295. $mch_cache = $caches[$mchid];
  2296. } else {
  2297. $mch_cache = ['last_time' => 0, 'send_count' => 0];
  2298. }
  2299. if (!empty($phone) && ($available_pd < $alarm_pd)) {
  2300. $counts = $mch_cache['send_count'];
  2301. if (($mch_cache['last_time'] + 300 < time()) && $counts < 5) {
  2302. $mch_cache = ['last_time' => time(), 'send_count' => $counts + 1];
  2303. QueueClient::push('sendSMS', ['mobile' => $merchant['contact_phone'],
  2304. 'type' => 'balance_warning', 'datas' => [date("m月d日H时"), $merchant['available_predeposit']]]);
  2305. }
  2306. } else {
  2307. $mch_cache = ['last_time' => 0, 'send_count' => 0];
  2308. }
  2309. $new_caches[$mchid] = $mch_cache;
  2310. }
  2311. wcache("merchant-notify", ['data' => serialize($new_caches)], 'refill-');
  2312. }
  2313. public function testReadChannel()
  2314. {
  2315. refill\RefillFactory::instance()->read_channel();
  2316. }
  2317. public function testAllow()
  2318. {
  2319. $allow = refill\RefillFactory::instance()->allow(10096, 1, 100);
  2320. }
  2321. public function testCheckData()
  2322. {
  2323. $str = '|2|110667993758599771-充值失败|';
  2324. // $str = '0|提交成功|-36557.7400';
  2325. // if(preg_match( '/^-*[0-9]{1,3}\|[\x{4e00}-\x{9fa5}]+\|-*[0-9]+\.*[0-9]+$/u',$str,$matches)) {
  2326. // return true;
  2327. // }
  2328. // if(preg_match('/^[0-3]\|[0-9]+-*[\x{4e00}-\x{9fa5}]+\|[0-9]*$/u',$str,$matches)){
  2329. // return true;
  2330. // }
  2331. // return false;
  2332. $resp = ltrim($str, '|');
  2333. $resp = explode('|', $resp);
  2334. if (count($resp) != 3) {
  2335. return [false, '返回值错误'];
  2336. }
  2337. }
  2338. public function testErrre()
  2339. {
  2340. $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}';
  2341. $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);
  2342. }
  2343. public function testExpolode()
  2344. {
  2345. $x = "HTTP-504";
  2346. [$type,$code] = explode('-',$x);
  2347. }
  2348. public function testMchctl()
  2349. {
  2350. $ctl = new refill\mchctl();
  2351. }
  2352. public function testAsyncadd()
  2353. {
  2354. $x = \refill\util::async_add(['xxxx' => 1],4);
  2355. }
  2356. private function getProvider($name,$type = 'RefillPhone')
  2357. {
  2358. $file = BASE_HELPER_RAPI_PATH . "/$name/{$type}.php";
  2359. if(!file_exists($file)){
  2360. Log::record("provider api file={$file} not exist.",Log::DEBUG);
  2361. return false;
  2362. } else {
  2363. require_once($file);
  2364. Log::record("file={$file} load success.",Log::DEBUG);
  2365. }
  2366. $class_name = "refill\\{$name}\\{$type}";
  2367. if (class_exists($class_name, false)) {
  2368. $caller = new $class_name([]);
  2369. return $caller;
  2370. } else {
  2371. $error = "Base Error: class {$class_name} isn't exists!";
  2372. Log::record($error, Log::ERR);
  2373. return false;
  2374. }
  2375. }
  2376. public function testOrderExist()
  2377. {
  2378. $refill_order = Model('refill_order');
  2379. $ret = $refill_order->exist(10116,'Yzb20210825111251415');
  2380. }
  2381. public function testRGoods()
  2382. {
  2383. $goods_list = refill\RefillFactory::instance()->goods();
  2384. }
  2385. public function testCanbu()
  2386. {
  2387. $notify = function ($resp)
  2388. {
  2389. if (empty($resp)) {
  2390. return [false, '网络错误'];
  2391. }
  2392. else
  2393. {
  2394. Log::record($resp, Log::DEBUG);
  2395. $resp = json_decode($resp, true);
  2396. if (empty($resp)) {
  2397. return [false, '网络错误'];
  2398. }
  2399. if($resp['code'] == 1)
  2400. {
  2401. $status = $resp['data']['status'];
  2402. if ($status == 'success') {
  2403. $order_state = ORDER_STATE_SUCCESS;
  2404. } elseif ($status == 'failed') {
  2405. $order_state = ORDER_STATE_CANCEL;
  2406. } elseif ($status == 'wait') {
  2407. $order_state = ORDER_STATE_SEND;
  2408. } else {
  2409. return [false, $status];
  2410. }
  2411. return [true, $order_state];
  2412. }
  2413. elseif($resp['code'] == -1 && $resp['msg'] == '订单不存在')
  2414. {
  2415. return [true, ORDER_STATE_NOEXIST];
  2416. }
  2417. else
  2418. {
  2419. return [false, $resp['msg']];
  2420. }
  2421. }
  2422. };
  2423. $resp = '{"code":1,"msg":"查询成功","data":{"systemOrderNo":"2049420687473912283808","agentOrderNo":"s16341299122819479569112","phone":"18571522718","itemName":"UNICOM","itemFacePrice":"50","status":0,"description":"待处理","amount":"47.2500","officialOrderNo":""}}';
  2424. $ret = $notify($resp);
  2425. }
  2426. }
  2427. //docker-compose run phpcli php /var/www/html/phpunit-9.2.5.phar --filter "/(TestRefill::testLoadBlack)( .*)?$/" --test-suffix TestRefill.php /var/www/html/test
  2428. //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