Skip to content

Commit

Permalink
修复自动获取微信平台公钥证书相关接口提示 参数异常: 微信公钥序列号为找到 错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Wsmallnews committed Sep 9, 2024
1 parent 2ea20b7 commit c0c6678
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ protected function service(Collection $payload, array $params, array $config): a
protected function encryptSensitiveData(array $params, array $config, Collection $payload): array
{
$data['_serial_no'] = get_wechat_serial_no($params);

$config = get_provider_config('wechat', $params);
$publicKey = get_wechat_public_key($config, $data['_serial_no']);

$data['name'] = encrypt_wechat_contents($payload->get('name'), $publicKey);
Expand Down
2 changes: 2 additions & 0 deletions src/Plugin/Wechat/V3/Extend/ProfitSharing/CreatePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ protected function service(Collection $payload, array $params, array $config): a
protected function encryptSensitiveData(array $params, array $config, Collection $payload): array
{
$data['_serial_no'] = get_wechat_serial_no($params);

$config = get_provider_config('wechat', $params);
$publicKey = get_wechat_public_key($config, $data['_serial_no']);

foreach ($payload->get('receivers', []) as $key => $list) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function assembly(Rocket $rocket, Closure $next): Rocket
protected function encryptSensitiveData(?Collection $payload, array $params, array $config): array
{
$data['_serial_no'] = get_wechat_serial_no($params);

$config = get_provider_config('wechat', $params);
$publicKey = get_wechat_public_key($config, $data['_serial_no']);

$phone = $payload?->get('buyer_information.phone') ?? null;
Expand Down
2 changes: 2 additions & 0 deletions src/Plugin/Wechat/V3/Marketing/Transfer/CreatePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ protected function encryptSensitiveData(array $params, array $config, Collection
{
$data['transfer_detail_list'] = $payload->get('transfer_detail_list', []);
$data['_serial_no'] = get_wechat_serial_no($params);

$config = get_provider_config('wechat', $params);
$publicKey = get_wechat_public_key($config, $data['_serial_no']);

foreach ($data['transfer_detail_list'] as $key => $list) {
Expand Down
2 changes: 2 additions & 0 deletions src/Plugin/Wechat/V3/Pay/Refund/RefundAbnormalPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ protected function encryptSensitiveData(array $params, array $config, Collection
{
if ($payload->has('bank_account') && $payload->has('real_name')) {
$data['_serial_no'] = get_wechat_serial_no($params);

$config = get_provider_config('wechat', $params);
$publicKey = get_wechat_public_key($config, $data['_serial_no']);

$data['real_name'] = encrypt_wechat_contents($payload->get('real_name'), $publicKey);
Expand Down

0 comments on commit c0c6678

Please sign in to comment.