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

订单支付的时候提示201商户订单号重复 #126

Closed
XxyGitHub opened this issue Mar 22, 2024 · 4 comments
Closed

订单支付的时候提示201商户订单号重复 #126

XxyGitHub opened this issue Mar 22, 2024 · 4 comments
Labels

Comments

@XxyGitHub
Copy link

本地订单状态是待支付 ,然后调用 ExecuteCreatePayTransactionNativeAsync 方法提示201商户订单号重复

@XxyGitHub XxyGitHub added the question Q & A label Mar 22, 2024
@fudiwei
Copy link
Owner

fudiwei commented Mar 22, 2024

同一商户订单号(out_trade_no)只能调用一次下单接口。

@fudiwei fudiwei closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2024
@XxyGitHub
Copy link
Author

同一商户订单号(out_trade_no)只能调用一次下单接口。

如果第一次没有支付 下一次我的那个订单需要再次支付 是把本地的订单号重新赋值吗

@fudiwei
Copy link
Owner

fudiwei commented Mar 22, 2024

如果第一次没有支付 下一次我的那个订单需要再次支付 是把本地的订单号重新赋值吗

你应该自行持久化下单时渠道返回的支付参数(例如 prepay_idpackagecode_url 等)。客户端短时间内重复唤起支付时使用之前的支付参数即可;长时间再次唤起使用新的商户订单号重新调用微信支付下单接口。

另外建议把你自己业务系统里的“订单号”,跟微信支付接口里的“订单号”区分开。前者是“业务订单号”,标识的是你自己业务系统里的一笔交易;后者是“渠道订单号”,标识的是支付渠道系统里的一笔交易。1 个“业务订单号”可以关联 N 个“渠道订单号” —— 例如你自己业务系统里同一笔订单,可以在小程序里唤起微信支付但不付款、又在 App 里唤起微信支付但也不付款、最后在网页端唤起支付宝支付完成付款,这个过程中你自己的业务订单号始终不变,渠道订单号每次都是新的。

@XxyGitHub
Copy link
Author

好的 明白了 非常感谢!

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

No branches or pull requests

2 participants