mirror of
https://gitee.com/yansongda/pay.git
synced 2024-12-01 19:58:24 +08:00
fix: 修复商家转账参数缺失的问题 (#977)
--------- Co-authored-by: yansongda <me@yansongda.cn>
This commit is contained in:
parent
722ffdcd5c
commit
747806ee09
2
.github/workflows/coverage.yml
vendored
2
.github/workflows/coverage.yml
vendored
@ -23,6 +23,6 @@ jobs:
|
||||
- name: Run Coverage
|
||||
run: vendor/bin/phpunit --coverage-clover coverage.xml
|
||||
- name: Upload Coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
@ -1,3 +1,9 @@
|
||||
## v3.7.3
|
||||
|
||||
### fixed
|
||||
|
||||
- fix: 修复商家转账参数缺失的问题(#977)
|
||||
|
||||
## v3.7.2
|
||||
|
||||
### added
|
||||
|
@ -90,10 +90,11 @@ class CreatePlugin implements PluginInterface
|
||||
*/
|
||||
protected function encryptSensitiveData(array $params, array $config, Collection $payload): array
|
||||
{
|
||||
$data['transfer_detail_list'] = $payload->get('transfer_detail_list', []);
|
||||
$data['_serial_no'] = get_wechat_serial_no($params);
|
||||
$publicKey = get_wechat_public_key($config, $data['_serial_no']);
|
||||
|
||||
foreach ($payload->get('transfer_detail_list', []) as $key => $list) {
|
||||
foreach ($data['transfer_detail_list'] as $key => $list) {
|
||||
if (!empty($list['user_name'])) {
|
||||
$data['transfer_detail_list'][$key]['user_name'] = encrypt_wechat_contents($list['user_name'], $publicKey);
|
||||
}
|
||||
|
@ -85,7 +85,8 @@ class CreatePluginTest extends TestCase
|
||||
"test" => "111",
|
||||
'transfer_detail_list' => [
|
||||
[
|
||||
'user_name' => 'yansongda'
|
||||
'user_name' => 'yansongda',
|
||||
'foo' => 'bar',
|
||||
]
|
||||
]
|
||||
]));
|
||||
@ -102,5 +103,6 @@ class CreatePluginTest extends TestCase
|
||||
self::assertArrayHasKey('_serial_no', $payload);
|
||||
self::assertArrayHasKey('user_name', $payload['transfer_detail_list'][0]);
|
||||
self::assertNotEquals('yansongda', $payload['transfer_detail_list'][0]['user_name']);
|
||||
self::assertEquals('bar', $payload['transfer_detail_list'][0]['foo']);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user