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

建议chain用法以标准的uri_template方式传参 #17

Open
TheNorthMemory opened this issue Feb 19, 2023 · 0 comments
Open

建议chain用法以标准的uri_template方式传参 #17

TheNorthMemory opened this issue Feb 19, 2023 · 0 comments

Comments

@TheNorthMemory
Copy link

->chain('v3/pay/transactions/id/' . $transactionId)
->get(['query' => ['mchid' => $merchantId]]);

当然这里的拼接方式是可以工作的,不过仍然建议用标准用法来构造请求,形如:

->chain('v3/pay/transactions/id/{transaction_id}')
->get(['query' => ['mchid' => $merchantId], 'transaction_id' => $transactionId])

另外建议增加依赖 iwechatpay/openapi dev包,上述代码即可以在JB IDE上书写成

->v3->pay->transactions->id->_transaction_id_
->get(['query' => ['mchid' => $merchantId], 'transaction_id' => $transactionId])

即带请求数据结构基础语法提示。

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

1 participant