|
|
|
@ -7,50 +7,6 @@ use App\Helper\StringHelper;
|
|
|
|
|
|
|
|
|
|
class Api extends AbstractApi
|
|
|
|
|
{
|
|
|
|
|
public static function apply()
|
|
|
|
|
{
|
|
|
|
|
$paper = [
|
|
|
|
|
"certificateName" => "李四",
|
|
|
|
|
"contactPhone" => "13531231222",
|
|
|
|
|
"email" => "test1@test.cn",
|
|
|
|
|
"lawyerCertNo" => "430481198104234557",
|
|
|
|
|
"lawyerCertType" => "0",
|
|
|
|
|
"merchantType" => "3",
|
|
|
|
|
"openBank" => "中国银行",
|
|
|
|
|
"openingLicenseAccountPhoto" => "https://www.epaylinks.cn/www/wimages/epl_logo.png",
|
|
|
|
|
"settleAccount" => "李四",
|
|
|
|
|
"settleAccountNo" => "6214830201234567",
|
|
|
|
|
"settleAccountType" => "2",
|
|
|
|
|
"settleTarget" => "2"
|
|
|
|
|
];
|
|
|
|
|
$business = [
|
|
|
|
|
[
|
|
|
|
|
"businessCode" => "WITHDRAW_TO_SETTMENT_DEBIT",
|
|
|
|
|
"creditcardsEnabled" => 0,
|
|
|
|
|
"refundEnabled" => 1,
|
|
|
|
|
"refundFeePer" => 0,
|
|
|
|
|
"refundFeeRate" => 0,
|
|
|
|
|
"settleCycle" => "D+0",
|
|
|
|
|
"stage" => [
|
|
|
|
|
[
|
|
|
|
|
"amountFrom" => 0,
|
|
|
|
|
"feePer" => 50
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
$params = [
|
|
|
|
|
'acqSpId' => self::getConfig('customerCode'),
|
|
|
|
|
'merchantName' => "测试商户20211202",
|
|
|
|
|
'acceptOrder' => 0,
|
|
|
|
|
'openAccount' => 1,
|
|
|
|
|
'paper' => json_encode($paper, JSON_UNESCAPED_UNICODE),
|
|
|
|
|
'business' => $business
|
|
|
|
|
];
|
|
|
|
|
$sign = Signer::sign(json_encode($params));
|
|
|
|
|
return self::request($uri, $params, $sign);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function register($params)
|
|
|
|
|
{
|
|
|
|
|
$merId = $params['merId'] ?? '';
|
|
|
|
@ -175,6 +131,7 @@ class Api extends AbstractApi
|
|
|
|
|
'payAmount' => $payAmount,
|
|
|
|
|
'payCurrency' => 'CNY',
|
|
|
|
|
'isInstalments' => 0,
|
|
|
|
|
'isSendSmsCode' => 2,
|
|
|
|
|
'notifyUrl' => 'http://146.70.113.165:9501/notify/payment',
|
|
|
|
|
'transactionStartTime' => date('YmdHis'),
|
|
|
|
|
'nonceStr' => StringHelper::getRandomString(32),
|
|
|
|
@ -257,4 +214,27 @@ class Api extends AbstractApi
|
|
|
|
|
$sign = Signer::sign(json_encode($params));
|
|
|
|
|
return self::request($uri, $params, $sign);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function withdrawalToCard($params)
|
|
|
|
|
{
|
|
|
|
|
$bankUserName = $params['bankUserName'] ?? '';
|
|
|
|
|
$bankUserCert = $params['bankUserCert'] ?? '';
|
|
|
|
|
$bankCardNo = $params['bankCardNo'] ?? '';
|
|
|
|
|
$uri = '/api/txs/pay/withdrawalToCard';
|
|
|
|
|
$params = [
|
|
|
|
|
'version' => '3.0',
|
|
|
|
|
'customerCode' => self::getConfig('customerCode'),
|
|
|
|
|
'outTradeNo' => time() . rand(1000, 9999),
|
|
|
|
|
'bankName' => '工商银行',
|
|
|
|
|
'amount' => 1,
|
|
|
|
|
'bankUserName' => Signer::publicEncrypt('饶丽秀'),
|
|
|
|
|
'bankUserCert' => Signer::publicEncrypt('350824199001045864'),
|
|
|
|
|
'bankCardNo' => Signer::publicEncrypt('6212261402022689613'),
|
|
|
|
|
'bankAccountType' => 2,
|
|
|
|
|
'payCurrency' => 'CNY',
|
|
|
|
|
'nonceStr' => StringHelper::getRandomString(32),
|
|
|
|
|
];
|
|
|
|
|
$sign = Signer::sign(json_encode($params));
|
|
|
|
|
return self::request($uri, $params, $sign);
|
|
|
|
|
}
|
|
|
|
|
}
|