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

ras2 valid failed #36

Closed
archever opened this issue Jan 20, 2018 · 3 comments
Closed

ras2 valid failed #36

archever opened this issue Jan 20, 2018 · 3 comments

Comments

@archever
Copy link

hi:
i suspect you were Chinese, so i write in Chinese.
当我使用 alipay sdk 创建, alipay_fund_trans_toaccount_transfer 支付的时候
会报 alipay.exceptions.AliPayValidationError 的异常, 但是支付确实成功了. 支付宝同步接口验证签名的问题, 我这边一直没有解决, 你有没有好的解决方案呢?

@archever
Copy link
Author

from alipay import AliPay

alipay = AliPay(
    appid="2016050501364604",
    app_notify_url="",
    app_private_key_path="alipay_private_pkcs8.pem",
    alipay_public_key_path="alipay_ras2_pub.pem",
    sign_type="RSA2",
    debug=False
)

ret = alipay.api_alipay_fund_trans_toaccount_transfer(
    "test2", "ALIPAY_LOGONID", "archever@163.com", 1
)

print(ret)

python2.7.8 and python3.6.4 都会出现支付成功, 但是验证失败的问题

@fzlee
Copy link
Owner

fzlee commented Jan 20, 2018

我看到你创建Alipay对象的时候,传入的alipay_public_key_path 是 “alipay_ras2_pub.pem”我想确认一下,这个应该不是你自己的公钥吧?

@archever
Copy link
Author

是公钥的问题, alipay_public_key_path 传入 支付宝后台的支付宝公钥就可以了, 不能使用自己的公钥.
十分感谢, 你的解答.

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

No branches or pull requests

2 participants