Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yansongda committed Sep 13, 2018
1 parent 819dda9 commit 757058e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -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,设置此参数,将进入沙箱模式
];

Expand Down Expand Up @@ -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。
];

Expand Down
7 changes: 6 additions & 1 deletion docs/alipay/README.md
Expand Up @@ -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,设置此参数,将进入沙箱模式
];

// 支付
Expand Down
25 changes: 25 additions & 0 deletions docs/others/others.md
Expand Up @@ -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,
],
```

# 支持的模式

| 支付 | 模式 | 说明 |
Expand Down
6 changes: 6 additions & 0 deletions docs/wechat/README.md
Expand Up @@ -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',
];

// 支付
Expand Down

0 comments on commit 757058e

Please sign in to comment.