TestRefill.php 129 KB

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