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

Invalid signature #109

Closed
matheusczi opened this issue Aug 3, 2023 · 1 comment
Closed

Invalid signature #109

matheusczi opened this issue Aug 3, 2023 · 1 comment

Comments

@matheusczi
Copy link

I'm trying to create a payment URL following the examples but the API call always return the following error:

  code: '40002',
  msg: 'Invalid Arguments',
  subCode: 'isv.invalid-signature',
  subMsg: '验签出错,建议检查签名字符串或签名私钥与应用公钥是否匹配,网关生成的验签字符串为:app_id=9021000123609320&biz_content={"out_trade_no":"商家的交易码,需保持唯一性","total_amount":"0.1","subject":"测试订单"}&charset=utf-8&method=alipay.trade.pay&notify_url=http://www.notify.com/notify&sign_type=RSA2&timestamp=2023-08-03 17:42:46&version=1.0'

The request:

const result = await alipaySdk.exec('alipay.trade.pay', {
    notify_url: 'http://www.notify.com/notify', 
    bizContent: {
      out_trade_no: '商家的交易码,需保持唯一性',
      total_amount: '0.1',
      subject: '测试订单',
    }
  });

What I'm missing?

@troyeagle
Copy link
Contributor

It seems to be the privateKey / alipayPublicKey configured when alipaySdk initialized is not valid.
You could log in the Alipay site, following this guide https://opendocs.alipay.com/common/02kdnf or ask for technical support.

@fengmk2 fengmk2 closed this as completed Jun 2, 2024
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

3 participants