From cf59562ba3e80efb3807468f31d27da628d15bce Mon Sep 17 00:00:00 2001 From: yangrz Date: Mon, 22 Aug 2022 00:53:02 +0800 Subject: [PATCH] =?UTF-8?q?CCBPayment=E6=9C=8D=E5=8A=A1=E7=B1=BB=E9=87=8D?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{CCBPayment.php => CcbPaymentService.php} | 8 +- test/Cases/CCBTest.php | 92 ++++++++++--------- 2 files changed, 58 insertions(+), 42 deletions(-) rename app/Service/v3/{CCBPayment.php => CcbPaymentService.php} (98%) diff --git a/app/Service/v3/CCBPayment.php b/app/Service/v3/CcbPaymentService.php similarity index 98% rename from app/Service/v3/CCBPayment.php rename to app/Service/v3/CcbPaymentService.php index c9cd67a..5bddf33 100644 --- a/app/Service/v3/CCBPayment.php +++ b/app/Service/v3/CcbPaymentService.php @@ -2,11 +2,17 @@ namespace App\Service\v3; +use App\Constants\v3\ErrorCode; +use App\Constants\v3\LogLabel; +use App\Constants\v3\OrderState; use App\Exception\BusinessException; +use App\Exception\ErrorCodeException; +use App\Model\v3\OrderMain; +use App\Model\v3\User; use Hyperf\Guzzle\ClientFactory; use Hyperf\Logger\LoggerFactory; -class CCBPayment +class CcbPaymentService { /** * 是否测试环境 diff --git a/test/Cases/CCBTest.php b/test/Cases/CCBTest.php index 6e283c8..dd9442a 100644 --- a/test/Cases/CCBTest.php +++ b/test/Cases/CCBTest.php @@ -2,7 +2,7 @@ namespace HyperfTest\Cases; -use App\Service\v3\CCBPayment; +use App\Service\v3\CcbPaymentService; use Hyperf\Utils\ApplicationContext; use HyperfTest\HttpTestCase; @@ -10,7 +10,7 @@ class CCBTest extends HttpTestCase { // public function testSign() // { -// $ccb = ApplicationContext::getContainer()->get(CCBPayment::class); +// $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class); // // $data = "Write Once, Run Anywhere"; // @@ -23,7 +23,7 @@ class CCBTest extends HttpTestCase // // public function testCreateSign() // { -// $ccb = ApplicationContext::getContainer()->get(CCBPayment::class); +// $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class); // // $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); // @@ -34,50 +34,60 @@ class CCBTest extends HttpTestCase // $this->assertTrue($str == $s); // } - public function testOrder() +// public function testOrder() +// { +// $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class); +// +// $subOrderList[] = $ccb->subOrderListItem( +// '41060860800469000000', +// '151201', +// '0.50', +// '0.50' +// ); +// +// $subOrderList[] = $ccb->subOrderListItem( +// '41060860800469061877', +// '151202', +// '1.02', +// '1.02' +// ); +// +// $subOrderList[] = $ccb->subOrderListItem( +// '41060860800469061878', +// '151203', +// '2.30', +// '2.30' +// ); +// +// $result = $ccb->gatherPlaceorder( +// '202208212237008561189348', //$ccb->genSerialNumber(), +// 'm2020060915410278993', +// '3.82', +// '3.82', +// '03', +// '', +// '', +// $subOrderList +// ); +// +// var_export($result); +// } + + public function testQuery() { - $ccb = ApplicationContext::getContainer()->get(CCBPayment::class); + $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class); - $subOrderList[] = $ccb->subOrderListItem( - '41060860800469000000', - '151197', - '0.50', - '0.50' - ); + $result = $ccb->gatherEnquireOrder('m2020060915410278990'); - $subOrderList[] = $ccb->subOrderListItem( - '41060860800469061877', - '151197', - '1.02', - '1.02' - ); + var_export($result); + } - $subOrderList[] = $ccb->subOrderListItem( - '41060860800469061878', - '151198', - '2.30', - '2.30' - ); + public function testOrderInfQuery() + { + $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class); - $result = $ccb->gatherPlaceorder( - 'm2020060915410278991', - '3.82', - '3.82', - '03', - '', - '', - $subOrderList - ); + $result = $ccb->orderInfQuery('m2020060915410278990', '10500000780012708212236595958H'); var_export($result); } - -// public function testQuery() -// { -// $ccb = ApplicationContext::getContainer()->get(CCBPayment::class); -// -// $result = $ccb->gatherEnquireOrder('c2020060915410278956'); -// -// var_dump($result); -// } } \ No newline at end of file