src/Gateways/Alipay.php
public function cancel($order): Collection
    {
        $this->payload['method'] = 'alipay.trade.cancel';
        $this->payload['biz_content'] = json_encode(is_array($order) ? $order : ['out_trade_no' => $order]);
        $this->payload['sign'] = Support::generateSign($this->payload);

        Events::dispatch(Events::METHOD_CALLED, new Events\MethodCalled('Alipay', 'Cancel', $this->gateway, $this->payload));

        return Support::requestApi($this->payload);
    }
public function cancel($order): Collection
    {
        $this->payload['method'] = 'alipay.trade.cancel';
        $this->payload['biz_content'] = json_encode(is_array($order) ? $order : ['out_trade_no' => $order]);
        $this->payload['sign'] = Support::generateSign($this->payload);

        Events::dispatch(Events::METHOD_CALLED, new Events\MethodCalled('Alipay', 'Cancel', $this->gateway, $this->payload));

        return Support::requestApi($this->payload);
    }
public function cancel ( $ order ) : Collection { $ this -> payload [ 'method' ] = 'alipay.trade.cancel' ; $ this -> payload [ 'biz_content' ] = json_encode ( is_array ( $ order ) ? $ order : [ 'out_trade_no' => $ order ] ) ; $ this -> payload [ 'sign' ] = Support :: generateSign ( $ this -> payload ) ; Events :: dispatch ( Events :: METHOD_CALLED , new Events \ MethodCalled ( 'Alipay' , 'Cancel' , $ this -> gateway , $ this -> payload ) ) ; return Support :: requestApi ( $ this -> payload ) ; }
Cancel an order.

@author yansongda <me@yansongda.cn>

@param array $order

@throws GatewayException
@throws InvalidConfigException
@throws InvalidSignException

@return Collection
Cancel an order .