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

微信支付分 #606

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

微信支付分 #606

wants to merge 1 commit into from

Conversation

kangour
Copy link

@kangour kangour commented Sep 28, 2020

微信支付分 SDK,包含签名校验、加解密、平台证书自动更新等内容。完成了所有公共 API。

Closes #578

@kangour kangour changed the title feat: payscore api feat: payscore api#578 Sep 28, 2020
@messense
Copy link
Member

messense commented Oct 3, 2020

测试需要修复,另外看下能不能增加些测试用例?比方说加解密的部分。

@messense
Copy link
Member

messense commented Oct 3, 2020

感觉最好整合到 wechatpy/pay 下面,让那边支持 v3 的 API 调用方式

@@ -0,0 +1,96 @@
# payscore
Copy link
Member

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 自动生成。

Copy link
Author

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
Copy link
Member

Choose a reason for hiding this comment

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

这个 service_id 是所有的 V3 接口都是一样的还是都不一样?

Copy link
Author

@kangour kangour May 20, 2021

Choose a reason for hiding this comment

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

不一样,每个应用有一个。要向微信申请后由工作人员配置。

Copy link
Author

Choose a reason for hiding this comment

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

不好意思啊,最近在忙项目,还没来得及处理这个 MR

@kangour
Copy link
Author

kangour commented Nov 22, 2021

是 v3 的密钥

@NullYing
Copy link
Contributor

NullYing commented May 9, 2022

突然发现微信支付的加解密部分重合了,我上周又重复写另一遍【捂脸哭】

@kangour kangour changed the title feat: payscore api#578 微信支付分 May 18, 2022
@kangour
Copy link
Author

kangour commented May 18, 2022

突然发现微信支付的加解密部分重合了,我上周又重复写另一遍【捂脸哭】

这个分支我还没写测试用例,

Copy link
Contributor

@NullYing NullYing left a 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
Copy link
Contributor

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')
Copy link
Contributor

Choose a reason for hiding this comment

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

Invalid certificate这个,wechatpy有这个异常可以直接抛

Copy link
Author

Choose a reason for hiding this comment

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

收到

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

微信支付分
3 participants