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

feat: 新增支付宝APP同步回调验签 #1061

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

suyar
Copy link

@suyar suyar commented Feb 7, 2025

支付宝同步通知验证

补充了下支付宝同步回调通知验证插件 AppCallbackPlugin

// 服务端接收的APP同步回调参数结构
$appCallbackParams = [
    'alipay_trade_app_pay_response' => [
        'code' => '10000',
        'msg' => 'Success',
        'order_id' => '20231220110070000002150000657610',
        'out_biz_no' => '2023122022560000',
        'pay_date' => '2023-12-20 22:56:33',
        'pay_fund_order_id' => '20231220110070001502150000660902',
        'status' => 'SUCCESS',
        'trans_amount' => '0.01',
    ],
    'sign' => 'eITxP5fZiJPB2+vZb90IRkv2iARxeNx/6Omxk7FStqflhG5lMoCvGjo2FZ6Szo1bGBMBReazZuqLaqsgomWAUO9onMVurB3enLbRvwUlpE7XEZaxk/sJYjgc2Y7pIAenvnLL9PEAiXmvUvuinUlvS9J2r1XysC0p/2wu7kEJ/GgZpFDIIYY9mdM6U1rGbi+RvirQXtQHmaEuuJWLA75NR1bvfG3L8znzW9xz1kOQqOWsQmD/bF1CDWbozNLwLCUmClRJz0Fj4mUYRF0zbW2VP8ZgHu1YvVKJ2+dWC9b+0o94URk7psIpc5NjiOM9Jsn6aoC2CfrJ/sqFMRCkYWzw6A==',
    'sign_type' => 'RSA2',
];

// 如需指定租户,可以手动对结构增加以下项目
// $appCallbackParams['_config'] = 'default';

$result = Pay::alipay()->appCallback($appCallbackParams);

// or

$result = Pay::alipay()->pay([AppCallbackPlugin::class], $appCallbackParams);

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for pay-yansongda ready!

Name Link
🔨 Latest commit 8977432
🔍 Latest deploy log https://app.netlify.com/sites/pay-yansongda/deploys/67a8c3edb667340008d652f8
😎 Deploy Preview https://deploy-preview-1061--pay-yansongda.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/Provider/Alipay.php Outdated Show resolved Hide resolved
src/Plugin/Alipay/V2/AppCallbackPlugin.php Outdated Show resolved Hide resolved
@yansongda
Copy link
Owner

然后,麻烦单测帮忙改一下

@suyar
Copy link
Author

suyar commented Feb 9, 2025

然后,麻烦单测帮忙改一下

单测修复了。

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.49%. Comparing base (522f6cb) to head (8977432).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1061   +/-   ##
=========================================
  Coverage     97.49%   97.49%           
- Complexity     1066     1068    +2     
=========================================
  Files           382      383    +1     
  Lines          7026     7039   +13     
=========================================
+ Hits           6850     6863   +13     
  Misses          176      176           

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

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.

2 participants