@@ 273-286 (lines=14) @@ | ||
270 | * |
|
271 | * @return Collection |
|
272 | */ |
|
273 | public function cancel($order): Collection |
|
274 | { |
|
275 | unset($this->payload['spbill_create_ip']); |
|
276 | ||
277 | $this->payload = Support::filterPayload($this->payload, $order, true); |
|
278 | ||
279 | Events::dispatch(new Events\MethodCalled('Wechat', 'Cancel', $this->gateway, $this->payload)); |
|
280 | ||
281 | return Support::requestApi( |
|
282 | 'secapi/pay/reverse', |
|
283 | $this->payload, |
|
284 | true |
|
285 | ); |
|
286 | } |
|
287 | ||
288 | /** |
|
289 | * Close an order. |
|
@@ 301-310 (lines=10) @@ | ||
298 | * |
|
299 | * @return Collection |
|
300 | */ |
|
301 | public function close($order): Collection |
|
302 | { |
|
303 | unset($this->payload['spbill_create_ip']); |
|
304 | ||
305 | $this->payload = Support::filterPayload($this->payload, $order); |
|
306 | ||
307 | Events::dispatch(new Events\MethodCalled('Wechat', 'Close', $this->gateway, $this->payload)); |
|
308 | ||
309 | return Support::requestApi('pay/closeorder', $this->payload); |
|
310 | } |
|
311 | ||
312 | /** |
|
313 | * Echo success to server. |