From 757058e815da5942a21add207e565617f9836ee3 Mon Sep 17 00:00:00 2001 From: yansongda Date: Thu, 13 Sep 2018 21:16:31 +0800 Subject: [PATCH] update docs --- README.md | 10 ++++++++++ docs/alipay/README.md | 7 ++++++- docs/others/others.md | 25 +++++++++++++++++++++++++ docs/wechat/README.md | 6 ++++++ 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 944882d4e..831d25229 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,11 @@ class PayController extends Controller 'type' => 'single', // optional, 可选 daily. 'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 ], + 'http' => [ // optional + 'timeout' => 5.0, + 'connect_timeout' => 5.0, + // 更多配置项请参考 [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html) + ], 'mode' => 'dev', // optional,设置此参数,将进入沙箱模式 ]; @@ -226,6 +231,11 @@ class PayController extends Controller 'type' => 'single', // optional, 可选 daily. 'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 ], + 'http' => [ // optional + 'timeout' => 5.0, + 'connect_timeout' => 5.0, + // 更多配置项请参考 [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html) + ], 'mode' => 'dev', // optional, dev/hk;当为 `hk` 时,为香港 gateway。 ]; diff --git a/docs/alipay/README.md b/docs/alipay/README.md index 6bef2930b..b5c9738c9 100644 --- a/docs/alipay/README.md +++ b/docs/alipay/README.md @@ -21,7 +21,12 @@ $config = [ 'type' => 'single', // optional, 可选 daily. 'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 ], - 'mode' => 'dev', // optional,设置此参数,将进入沙箱模式 + 'http' => [ // optional + 'timeout' => 5.0, + 'connect_timeout' => 5.0, + // 更多配置项请参考 [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html) + ], + // 'mode' => 'dev', // optional,设置此参数,将进入沙箱模式 ]; // 支付 diff --git a/docs/others/others.md b/docs/others/others.md index b91bf06c1..a0c2442dc 100644 --- a/docs/others/others.md +++ b/docs/others/others.md @@ -21,6 +21,31 @@ use Yansongda\Pay\Log; Log::debug('Paying...', $order->all()); ``` +# guzzle 自定义配置 + +> v2.5.0-beta 及以上支持 + +SDK 依赖 guzzle 作 http 的请求客户端。所以如果有特殊配置需求,可直接在 config 中传入一下配置项来启用自定义配置。 + +```php +'http' => [ + 'timeout' => 5.0, + 'connect_timeout' => 5.0, + // ... +], +``` + +更多配置项请参考 [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html) + +如果不传入任何配置项,SDK 默认的配置规则为: + +```php +'http' => [ + 'timeout' => 5.0, + 'connect_timeout' => 5.0, +], +``` + # 支持的模式 | 支付 | 模式 | 说明 | diff --git a/docs/wechat/README.md b/docs/wechat/README.md index 8658ccefd..ab9af3e29 100644 --- a/docs/wechat/README.md +++ b/docs/wechat/README.md @@ -22,6 +22,12 @@ $config = [ 'type' => 'single', // optional, 可选 daily. 'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 ], + 'http' => [ // optional + 'timeout' => 5.0, + 'connect_timeout' => 5.0, + // 更多配置项请参考 [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html) + ], + // 'mode' => 'dev', ]; // 支付