TestRefill.php 94 KB

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