@@ 252-261 (lines=10) @@ | ||
249 | * |
|
250 | * @return Collection |
|
251 | */ |
|
252 | public function cancel($order): Collection |
|
253 | { |
|
254 | $this->payload['method'] = 'alipay.trade.cancel'; |
|
255 | $this->payload['biz_content'] = json_encode(is_array($order) ? $order : ['out_trade_no' => $order]); |
|
256 | $this->payload['sign'] = Support::generateSign($this->payload); |
|
257 | ||
258 | Events::dispatch(Events::METHOD_CALLED, new Events\MethodCalled('Alipay', 'Cancel', $this->gateway, $this->payload)); |
|
259 | ||
260 | return Support::requestApi($this->payload); |
|
261 | } |
|
262 | ||
263 | /** |
|
264 | * Close an order. |
|
@@ 276-285 (lines=10) @@ | ||
273 | * |
|
274 | * @return Collection |
|
275 | */ |
|
276 | public function close($order): Collection |
|
277 | { |
|
278 | $this->payload['method'] = 'alipay.trade.close'; |
|
279 | $this->payload['biz_content'] = json_encode(is_array($order) ? $order : ['out_trade_no' => $order]); |
|
280 | $this->payload['sign'] = Support::generateSign($this->payload); |
|
281 | ||
282 | Events::dispatch(Events::METHOD_CALLED, new Events\MethodCalled('Alipay', 'Close', $this->gateway, $this->payload)); |
|
283 | ||
284 | return Support::requestApi($this->payload); |
|
285 | } |
|
286 | ||
287 | /** |
|
288 | * Download bill. |