Ity icon indicating copy to clipboard operation
Ity copied to clipboard

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

Open TheNorthMemory opened this issue 1 year ago • 0 comments

https://github.com/pleaseyang/Ity/blob/b626989e45a02f5cb220514702d57564a076d249/app/Http/Controllers/Controller.php#L107-L108

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

->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])

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

TheNorthMemory avatar Feb 19 '23 02:02 TheNorthMemory