-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
微信支付分 #606
base: master
Are you sure you want to change the base?
微信支付分 #606
Conversation
测试需要修复,另外看下能不能增加些测试用例?比方说加解密的部分。 |
感觉最好整合到 |
@@ -0,0 +1,96 @@ | |||
# payscore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 REAMDE.md 可以删掉,API 文档放到 docs/ 里面用 Sphinx 自动生成。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
:param wechatpay_cert: 必填,微信支付平台证书路径(若不存在会自动创建并下载证书) | ||
:param mch_cert: 必填,商户证书路径 | ||
:param mch_key: 必填,商户证书私钥路径 | ||
:param service_id: 必填,支付分服务 id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 service_id 是所有的 V3 接口都是一样的还是都不一样?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不一样,每个应用有一个。要向微信申请后由工作人员配置。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不好意思啊,最近在忙项目,还没来得及处理这个 MR
是 v3 的密钥 |
突然发现微信支付的加解密部分重合了,我上周又重复写另一遍【捂脸哭】 |
这个分支我还没写测试用例, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以等我把pr提上来我们再整理一下,因为接口有点多所以进度还没那么快
''' | ||
if self._wechatpay_cert_pem is None: | ||
'''export cert''' | ||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个自动逻辑不是很自动
wechatpay_headers_serial = headers.get('Wechatpay-Serial') | ||
if wechatpay_serial != wechatpay_headers_serial: | ||
logger.error('serial 验证失败,收到假冒消息或证书错误,多次异常可尝试手动更新证书') | ||
raise TypeError('Invalid certificate') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invalid certificate这个,wechatpy有这个异常可以直接抛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
收到
微信支付分 SDK,包含签名校验、加解密、平台证书自动更新等内容。完成了所有公共 API。
Closes #578