Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
微信支付扫码模式一:商户必须在公众平台后台设置支付回调URL。URL实现的功能:接收用户扫码后微信支付系统回调的productid和openid;调用微信支付统一下单API请求下单,获取交易会话标识(prepay_id),再将prepay_id返回给微信支付系统。
https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_4
现有的支付回调只能返回成功/失败,而这个流程要求在成功时返回签名的prepay_id。
这个PR增加了一个回调,方法签名为:
function(string $productId, string $openId, Collection $collection): string; (throws \Exception)
$collection
为未来扩展保留,若成功返回,则构建响应XML。若抛出异常,则返回错误结果。