1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the overtrue/wechat. |
5
|
|
|
* |
6
|
|
|
* (c) overtrue <[email protected]> |
7
|
|
|
* |
8
|
|
|
* This source file is subject to the MIT license that is bundled |
9
|
|
|
* with this source code in the file LICENSE. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace EasyWeChat\Payment\Contract; |
13
|
|
|
|
14
|
|
|
use EasyWeChat\Payment\Kernel\BaseClient; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* Class Client. |
18
|
|
|
* |
19
|
|
|
* @author tianyong90 <[email protected]> |
20
|
|
|
*/ |
21
|
|
|
class Client extends BaseClient |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* entrust official account |
25
|
|
|
* |
26
|
|
|
* @param array $params |
27
|
|
|
* |
28
|
|
|
* @return \Psr\Http\Message\ResponseInterface|\EasyWeChat\Kernel\Support\Collection|array|object|string |
29
|
|
|
* |
30
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
31
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
32
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
33
|
|
|
*/ |
34
|
|
|
public function web(array $params) |
35
|
|
|
{ |
36
|
|
|
$params['appid'] = $this->app['config']->app_id; |
37
|
|
|
|
38
|
|
|
return $this->safeRequest('papay/entrustweb', $params); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* entrust app |
43
|
|
|
* |
44
|
|
|
* @param array $params |
45
|
|
|
* |
46
|
|
|
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
47
|
|
|
* |
48
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
49
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
50
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
51
|
|
|
*/ |
52
|
|
|
public function app(array $params) |
53
|
|
|
{ |
54
|
|
|
$params['appid'] = $this->app['config']->app_id; |
55
|
|
|
|
56
|
|
|
return $this->safeRequest('papay/preentrustweb', $params); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* entrust html 5 |
61
|
|
|
* |
62
|
|
|
* @param array $params |
63
|
|
|
* |
64
|
|
|
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
65
|
|
|
* |
66
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
67
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
68
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
69
|
|
|
*/ |
70
|
|
|
public function h5(array $params) |
71
|
|
|
{ |
72
|
|
|
$params['appid'] = $this->app['config']->app_id; |
73
|
|
|
|
74
|
|
|
return $this->safeRequest('papay/h5entrustweb', $params); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* apply papay |
79
|
|
|
* |
80
|
|
|
* @param array $params |
81
|
|
|
* |
82
|
|
|
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
83
|
|
|
* |
84
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
85
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
86
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
87
|
|
|
*/ |
88
|
|
|
public function apply(array $params) |
89
|
|
|
{ |
90
|
|
|
$params['appid'] = $this->app['config']->app_id; |
91
|
|
|
|
92
|
|
|
return $this->safeRequest('papay/pappayapply', $params); |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
/** |
96
|
|
|
* delete papay contrace |
97
|
|
|
* |
98
|
|
|
* @param array $params |
99
|
|
|
* |
100
|
|
|
* @return array|\EasyWeChat\Kernel\Support\Collection|object|\Psr\Http\Message\ResponseInterface|string |
101
|
|
|
* |
102
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException |
103
|
|
|
* @throws \EasyWeChat\Kernel\Exceptions\InvalidConfigException |
104
|
|
|
* @throws \GuzzleHttp\Exception\GuzzleException |
105
|
|
|
*/ |
106
|
|
|
public function delete(array $params) |
107
|
|
|
{ |
108
|
|
|
$params['appid'] = $this->app['config']->app_id; |
109
|
|
|
|
110
|
|
|
return $this->safeRequest('papay/deletecontract', $params); |
111
|
|
|
} |
112
|
|
|
} |
113
|
|
|
|