Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复商家转账参数缺失的问题 #977

Merged
merged 3 commits into from
May 8, 2024

Conversation

AExiaoliou
Copy link
Contributor

@AExiaoliou AExiaoliou commented May 8, 2024

之前会丢失所有除了user_name之外的所有参数....
很好奇为什么之前没人发现

Copy link

netlify bot commented May 8, 2024

Deploy Preview for pay-yansongda canceled.

Name Link
🔨 Latest commit 088215e
🔍 Latest deploy log https://app.netlify.com/sites/pay-yansongda/deploys/663b95c6ab8f9800086d93fe

@AExiaoliou AExiaoliou changed the title 修复商家转账参数缺失的问题 fix: 修复商家转账参数缺失的问题 May 8, 2024
@yansongda
Copy link
Owner

是有这个问题,单测方便一起补一下么?

@@ -90,15 +90,15 @@ protected function normal(array $params, array $config, Collection $payload): ar
*/
protected function encryptSensitiveData(array $params, array $config, Collection $payload): array
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改为以下代码吧

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 ($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);
        }
    }

    return $data;
}

然后帮忙把单测补充一下

Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.50%. Comparing base (722ffdc) to head (088215e).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #977      +/-   ##
============================================
- Coverage     97.51%   97.50%   -0.02%     
  Complexity      907      907              
============================================
  Files           347      347              
  Lines          6268     6201      -67     
============================================
- Hits           6112     6046      -66     
+ Misses          156      155       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yansongda yansongda merged commit 747806e into yansongda:master May 8, 2024
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants