mirror of
https://gitee.com/liuxioabin/fengketrade.git
synced 2026-04-17 12:57:32 +08:00
1
This commit is contained in:
parent
ec201fe0f4
commit
adda69de16
@ -477,7 +477,15 @@ class CcbPaymentService
|
||||
|
||||
// 使用服务方公钥加密这30位十六进制字符串
|
||||
// CcbRSA::encrypt 会自动进行base64编码
|
||||
return CcbRSA::encrypt($last30Chars, $servicePublicKey);
|
||||
$encpub = CcbRSA::encrypt($last30Chars, $servicePublicKey);
|
||||
|
||||
// ⚠️ 关键修复:转换为URL-safe BASE64格式
|
||||
// 根据文档和示例:"若密文中带有"+"、"/"符号,说明少了BASE64这一步骤"
|
||||
// 实际上需要将标准BASE64的 + 和 / 替换为 - 和 _
|
||||
// 这样在URL传输时不会被误解析,也符合建行的格式要求
|
||||
$encpub = str_replace(['+', '/'], ['-', '_'], $encpub);
|
||||
|
||||
return $encpub;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error('[建行支付] ENCPUB生成失败: ' . $e->getMessage());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user