Ity icon indicating copy to clipboard operation
Ity copied to clipboard

基于laravel + vue的基础后台,前后端分离,欢迎fork&start,不合理的地方也欢迎批评指正

Results 4 Ity issues
Sort by recently updated
recently updated
newest added

https://github.com/pleaseyang/Ity/blob/b626989e45a02f5cb220514702d57564a076d249/app/Http/Controllers/Controller.php#L107-L108 当然这里的拼接方式是可以工作的,不过仍然建议用标准用法来构造请求,形如: ```php ->chain('v3/pay/transactions/id/{transaction_id}') ->get(['query' => ['mchid' => $merchantId], 'transaction_id' => $transactionId]) ``` 另外建议增加依赖 [iwechatpay/openapi](https://github.com/TheNorthMemory/wechatpay-openapi) dev包,上述代码即可以在`JB` IDE上书写成 ```php ->v3->pay->transactions->id->_transaction_id_ ->get(['query' => ['mchid' => $merchantId], 'transaction_id' => $transactionId]) ``` 即带请求数据结构基础语法提示。

https://github.com/pleaseyang/Ity/blob/b626989e45a02f5cb220514702d57564a076d249/app/Models/Config.php#L190-L202 `web`的根目录是在`public`,如果没做安全防范,恶意请求可以通过web方式直接下载到商户私钥文件`cert/apiclient_key.pem`,存在安全隐患。 项目用到了`Redis`,建议抛弃文件存储,商户私钥、商户证书、平台证书均可以以`base64-string`形式存储在库中,`\WeChatPay\Rsa::from` 支持无感加载,详情可参考: - https://github.com/wechatpay-apiv3/wechatpay-php/blob/main/tests/Crypto/RsaTest.php#L45-L53 - https://github.com/wechatpay-apiv3/wechatpay-php/blob/main/tests/Crypto/RsaTest.php#L148-L149 从证书中提取`公钥` 详见 PHP [openssl_x509_parse](https://www.php.net/manual/zh/function.openssl-x509-parse.php) 返回值。 加载时仅需增加协议即形如 `Rsa::from('public.spki://' . $i_am_a_base64_string_without_envelope, Rsa::KEY_TYPE_PUBLIC)`。 当然`Rsa::from`也支持原样以文件内容为字符串形式加载私钥及证书,详细用法可参考上述 `RsaTest`测试用例覆盖方法。

see https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/wechatpay5_0.shtml > 由于旧证书过期前的5天内,微信支付会同时使用新旧证书,因此为实现新老证书的平滑切换,商户系统需支持多平台证书。 https://github.com/pleaseyang/Ity/blob/b626989e45a02f5cb220514702d57564a076d249/app/Http/Controllers/Controller.php#L47-L49 建议上述程序逻辑设计,支持多证书加载。