1 | <?php |
||
31 | class Payment |
||
32 | { |
||
33 | /** |
||
34 | * Scheme base path. |
||
35 | */ |
||
36 | const SCHEME_PATH = 'weixin://wxpay/bizpayurl'; |
||
37 | |||
38 | /** |
||
39 | * @var API |
||
40 | */ |
||
41 | protected $api; |
||
42 | |||
43 | /** |
||
44 | * Merchant instance. |
||
45 | * |
||
46 | * @var \EasyWeChat\Payment\Merchant |
||
47 | */ |
||
48 | protected $merchant; |
||
49 | |||
50 | /** |
||
51 | * Constructor. |
||
52 | * |
||
53 | * @param Merchant $merchant |
||
54 | 4 | */ |
|
55 | public function __construct(Merchant $merchant) |
||
59 | |||
60 | /** |
||
61 | * Build payment scheme for product. |
||
62 | * |
||
63 | * @param string $productId |
||
64 | * |
||
65 | * @return string |
||
66 | 1 | */ |
|
67 | public function scheme($productId) |
||
81 | |||
82 | /** |
||
83 | * Handle payment notify. |
||
84 | * |
||
85 | * @param callable $callback |
||
86 | * |
||
87 | * @return Response |
||
88 | 2 | */ |
|
89 | public function handleNotify(callable $callback) |
||
116 | |||
117 | /** |
||
118 | * Gernerate js config for payment. |
||
119 | * |
||
120 | * @param string $prepayId |
||
121 | 1 | * @param bool $json |
|
122 | * |
||
123 | 1 | * @return string|array |
|
124 | 1 | */ |
|
125 | public function configForPayment($prepayId, $json = true) |
||
139 | |||
140 | /** |
||
141 | * Generate js config for share user address. |
||
142 | * |
||
143 | * @param string $accessToken |
||
144 | * @param bool $json |
||
145 | * |
||
146 | * @return string|array |
||
147 | */ |
||
148 | public function configForShareAddress($accessToken, $json = true) |
||
171 | |||
172 | /** |
||
173 | * Merchant setter. |
||
174 | * |
||
175 | * @param Merchant $merchant |
||
176 | */ |
||
177 | public function setMerchant(Merchant $merchant) |
||
181 | |||
182 | /** |
||
183 | * Merchant getter. |
||
184 | * |
||
185 | * @return Merchant |
||
186 | */ |
||
187 | public function getMerchant() |
||
191 | |||
192 | /** |
||
193 | * Return Notify instance. |
||
194 | * |
||
195 | * @return \EasyWeChat\Payment\Notify |
||
196 | */ |
||
197 | public function getNotify() |
||
201 | |||
202 | /** |
||
203 | * API setter. |
||
204 | * |
||
205 | * @param API $api |
||
206 | */ |
||
207 | public function setAPI(API $api) |
||
211 | |||
212 | /** |
||
213 | * Return API instance. |
||
214 | * |
||
215 | * @return API |
||
216 | */ |
||
217 | public function getAPI() |
||
221 | |||
222 | /** |
||
223 | * Magic call. |
||
224 | * |
||
225 | * @param string $method |
||
226 | * @param array $args |
||
227 | * |
||
228 | * @return mixed |
||
229 | * |
||
230 | * @codeCoverageIgnore |
||
231 | */ |
||
232 | public function __call($method, $args) |
||
238 | } |
||
239 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.