You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
3.0 KiB

  1. <?php
  2. namespace HyperfTest\Cases;
  3. use App\Service\v3\CcbPaymentService;
  4. use Hyperf\Utils\ApplicationContext;
  5. use HyperfTest\HttpTestCase;
  6. class CCBTest extends HttpTestCase
  7. {
  8. // public function testSign()
  9. // {
  10. // $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class);
  11. //
  12. // $data = "Write Once, Run Anywhere";
  13. //
  14. // $result = $ccb->sign($data);
  15. //
  16. // $s = 'odUeD1V6obC/j8lUvmFwn6LSQ2DrvaDEin5DKs0FiB/HttboPJncmLisH22Y1grPezE0a+Ij6cdd5Taof8e4A76pKdXA+hDGz0nPMlCRgSF5tHQ6uVXktL/3lqpVTX6ECjRoHmzmo6cAMqVXYQKEl56r4gJcBPW4X4ghRtTgw9AK8+8b8O5EAqxuPxMyhSOYrCsUYRXapezV3uioEReYjvhg/u+kRf662P2nL0ab3szGMXMAoE+JjgMAHR9WCL3Can/5ADgoFff/7kMSxrA7/r94EfkDN50IvRVAx9WBLx3+WWcRRfM6JcqZ91B+g00wYN/OSZHTJDPgV6Ofd5cBpA==';
  17. //
  18. // $this->assertTrue($result == $s);
  19. // }
  20. //
  21. // public function testCreateSign()
  22. // {
  23. // $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class);
  24. //
  25. // $params = json_decode('{"Blank3":" ","Blank2":"","Sign_Inf":"signInf","Rsp_Inf":"rspInf","Svc_Rsp_St":"svcRspSt","Svc_Rsp_Cd":"svcRspCd","Amt":"amt","Pymd_Cd":"pymdCd","Parlist":[{"Seq_No":"seqNo","Mkt_Mrch_Id":"mktMrchIdFj"},{"Seq_No":"seqNo","Xbb":[{"sdc":"1131","xyz":"xxxx"}],"Mkt_Mrch_Id":"mktMrchIdFj2"},{"Seq_No":"seqNo3","Mkt_Mrch_Id":"mktMrchIdFj3"}]}', true);
  26. //
  27. // $str = $ccb->createSign($params);
  28. //
  29. // $s = 'Amt=amt&Mkt_Mrch_Id=mktMrchIdFj&Seq_No=seqNo&Mkt_Mrch_Id=mktMrchIdFj2&Seq_No=seqNo&sdc=1131&xyz=xxxx&Mkt_Mrch_Id=mktMrchIdFj3&Seq_No=seqNo3&Pymd_Cd=pymdCd';
  30. //
  31. // $this->assertTrue($str == $s);
  32. // }
  33. // public function testOrder()
  34. // {
  35. // $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class);
  36. //
  37. // $subOrderList[] = $ccb->subOrderListItem(
  38. // '41060860800469000000',
  39. // '151201',
  40. // '0.50',
  41. // '0.50'
  42. // );
  43. //
  44. // $subOrderList[] = $ccb->subOrderListItem(
  45. // '41060860800469061877',
  46. // '151202',
  47. // '1.02',
  48. // '1.02'
  49. // );
  50. //
  51. // $subOrderList[] = $ccb->subOrderListItem(
  52. // '41060860800469061878',
  53. // '151203',
  54. // '2.30',
  55. // '2.30'
  56. // );
  57. //
  58. // $result = $ccb->gatherPlaceorder(
  59. // '202208212237008561189348', //$ccb->genSerialNumber(),
  60. // 'm2020060915410278993',
  61. // '3.82',
  62. // '3.82',
  63. // '03',
  64. // '',
  65. // '',
  66. // $subOrderList
  67. // );
  68. //
  69. // var_export($result);
  70. // }
  71. public function testQuery()
  72. {
  73. $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class);
  74. $result = $ccb->gatherEnquireOrder('m2020060915410278990');
  75. var_export($result);
  76. }
  77. public function testOrderInfQuery()
  78. {
  79. $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class);
  80. $result = $ccb->orderInfQuery('m2020060915410278990', '10500000780012708212236595958H');
  81. var_export($result);
  82. }
  83. }