TestThirdRefill.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. use PHPUnit\Framework\TestCase;
  3. define('APP_ID', 'test');
  4. define('BASE_ROOT_PATH', str_replace('/test', '', dirname(__FILE__)));
  5. require_once(BASE_ROOT_PATH . '/global.php');
  6. require_once(BASE_CORE_PATH . '/lrlz.php');
  7. require_once(BASE_ROOT_PATH . '/fooder.php');
  8. require_once(BASE_CORE_PATH . '/framework/function/http.php');
  9. require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
  10. require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
  11. class TestThirdRefill extends TestCase
  12. {
  13. public static function setUpBeforeClass() : void
  14. {
  15. Base::run_util();
  16. }
  17. public function testProviderPrice()
  18. {
  19. $thrid_refill = Model('thrid_refill');
  20. $product = $thrid_refill->getProviderProduct(34,1000,'LZPLM100591');
  21. }
  22. public function testMerchantPrice()
  23. {
  24. $thrid_refill = Model('thrid_refill');
  25. $price = $thrid_refill->getMerchantPrice(1,'LZ100465');
  26. }
  27. public function testSctongqian()
  28. {
  29. // $provider = new refill\sctongqian\RefillPhone([]);
  30. // $resp = $providers->CardOrderAdd(18500608333, 5, 50, ['order_sn' => $this->make_sn(), 'product_code' => 'PLM100024']);
  31. // $resp = $providers->query(['order_sn' => '84471620782999495754']);
  32. $data = '{"AppKey":"211394658","TimesTamp":"1620811809019","MOrderID":"84471620782999495754","OrderID":"210512093007747001","State":"2","ChargeAccount":"","Version":"1.0","BuyCount":"1","Attach":"","CardInfo":"HaDGHP8EECrqLl+Jlo1vqGP4Uws4dm9fd1msGnY3FBAPOQuvXcK9bd7Ffg5NKpkXLPH46\/dPGxM\/XR7UOXb4znxs9+7JOlCbw+AqdDJ2cxkzc\/euqHpc8VszvoUD6JpE1bgCaL0DdfCpcYhSzFOND7MnN+WIl+P\/jOn0j8k9I4Lfa2\/Y3\/V3TjKfc4CSnNTU0m+g8cGQ6AGJfSkNDbEg+RlcqW98nLWl\/+YO2wEnkzaMX2B966tjwuPIdsGZHntBXaIIJNwnQ4YWPlx8Hx6ms8s7QPYs8FuFDjdiJzlDEdjJyfyRIzsvY0LZYSZ9WWo8yqMtpulTzLrhVVjvxW7Upg==","Sign":"EEE6F112A14B38EF2BCA6BE37F030266"}';
  33. $params = json_decode($data, true);
  34. refill\RefillFactory::instance()->notify('sctongqian', $params);
  35. }
  36. }