Browse Source

CCBPayment服务类重命名

ccb_pay2
yangrz 3 years ago
parent
commit
cf59562ba3
  1. 8
      app/Service/v3/CcbPaymentService.php
  2. 92
      test/Cases/CCBTest.php

8
app/Service/v3/CCBPayment.php → 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
{
/**
* 是否测试环境

92
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);
// }
}
Loading…
Cancel
Save