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.
93 lines
3.0 KiB
93 lines
3.0 KiB
<?php
|
|
|
|
namespace HyperfTest\Cases;
|
|
|
|
use App\Service\v3\CcbPaymentService;
|
|
use Hyperf\Utils\ApplicationContext;
|
|
use HyperfTest\HttpTestCase;
|
|
|
|
class CCBTest extends HttpTestCase
|
|
{
|
|
// public function testSign()
|
|
// {
|
|
// $ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class);
|
|
//
|
|
// $data = "Write Once, Run Anywhere";
|
|
//
|
|
// $result = $ccb->sign($data);
|
|
//
|
|
// $s = 'odUeD1V6obC/j8lUvmFwn6LSQ2DrvaDEin5DKs0FiB/HttboPJncmLisH22Y1grPezE0a+Ij6cdd5Taof8e4A76pKdXA+hDGz0nPMlCRgSF5tHQ6uVXktL/3lqpVTX6ECjRoHmzmo6cAMqVXYQKEl56r4gJcBPW4X4ghRtTgw9AK8+8b8O5EAqxuPxMyhSOYrCsUYRXapezV3uioEReYjvhg/u+kRf662P2nL0ab3szGMXMAoE+JjgMAHR9WCL3Can/5ADgoFff/7kMSxrA7/r94EfkDN50IvRVAx9WBLx3+WWcRRfM6JcqZ91B+g00wYN/OSZHTJDPgV6Ofd5cBpA==';
|
|
//
|
|
// $this->assertTrue($result == $s);
|
|
// }
|
|
//
|
|
// public function testCreateSign()
|
|
// {
|
|
// $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);
|
|
//
|
|
// $str = $ccb->createSign($params);
|
|
//
|
|
// $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';
|
|
//
|
|
// $this->assertTrue($str == $s);
|
|
// }
|
|
|
|
// 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(CcbPaymentService::class);
|
|
|
|
$result = $ccb->gatherEnquireOrder('m2020060915410278990');
|
|
|
|
var_export($result);
|
|
}
|
|
|
|
public function testOrderInfQuery()
|
|
{
|
|
$ccb = ApplicationContext::getContainer()->get(CcbPaymentService::class);
|
|
|
|
$result = $ccb->orderInfQuery('m2020060915410278990', '10500000780012708212236595958H');
|
|
|
|
var_export($result);
|
|
}
|
|
}
|