Cancel settlement.

@param \Paysafe\CardPayments\Settlement $settlement
@return \Paysafe\CardPayments\Settlement
@throws PaysafeException
761170
public function cancelSettlement(CardPayments\Settlement $settlement)
    {
        $settlement->setRequiredFields(array('id'));
        $settlement->checkRequiredFields();

        $tmpSettlement = new CardPayments\Settlement(array(
             'status' => 'CANCELLED'
        ));
        $request = new Request(array(
             'method' => Request::PUT,
             'uri' => $this->prepareURI("/settlements/" . $settlement->id),
             'body' => $tmpSettlement
        ));
        $response = $this->client->processRequest($request);

        return new CardPayments\Settlement($response);
    }
889506
public static function cancel()
  {
    if (is_null(self::$_transaction)) {
      $result = false;
    } else {
      $result = true;

      $aTran = self::$_transaction;
      $aCurr = $aTran->_stored;

      if (!is_null($aCurr)) {
        $names = array_keys($aTran->_data);
        foreach ($names as $name) {
          Config::clearInstance($name);
        }
      }
      
      self::_stop();
      self::$_transaction = null;
    }
    
    return $result;
  }
465152
public function cancel($transferIDs)
    {
        if (is_array($transferIDs)) {
            $transferIDs = implode(',', $transferIDs);
        }

        $data = [
            'transfer_ids' => $transferIDs
        ];

        return $this->post('transfers/cancel', $data, \true);
    }
892014
public function cancel()
    {
        $subscription = $this->asBraintreeSubscription();

        if ($this->onTrial()) {
            BraintreeSubscription::cancel($subscription->id);

            $this->markAsCancelled();
        } else {
            BraintreeSubscription::update($subscription->id, [
                'numberOfBillingCycles' => $subscription->currentBillingCycle,
            ]);

            $this->ends_at = $subscription->billingPeriodEndDate;

            $this->save();
        }

        return $this;
    }
413709
public function refund(array $params)
    {
        // transaction identifier must be set
        if(!isset($params['identifier']))
        {
            throw new MonetivoException('$transaction["identifier"] is not set');
        }
        // other parameters like 'amount' and 'description' are optional

        return $this->merchantApi->call('post', 'transactions/' . $params['identifier'] . '/refund', [
            'form_params' => $params
        ])->toArray();
    }
255719
public function setPayment(Payment $payment)
    {
        $this->payment = $payment;

        if (!$payment->hasPaymentTransaction($this))
        {
            $payment->addPaymentTransaction($this);
        }

        return $this;
    }
1206855
public function cancelPreApproval($preApprovalCode)
    {
        return $this->sendTransaction([
            'email' => $this->email,
            'token' => $this->token,
        ], $this->url['preApprovalCancel'].$preApprovalCode, false);
    }
757676
public function closeDispute($options = null)
    {
        $url = $this->instanceUrl() . '/dispute/close';
        list($response, $opts) = $this->_request('post', $url, null, $options);
        $this->refreshFrom($response, $opts);
        return $this;
    }
702714
public function cancel()
    {
        $data = $this->twisto->requestJson('POST', 'invoice/' . urlencode($this->invoice_id) . '/cancel/');
        $this->deserialize($data);
    }
699134
public function abort($transactionId = null)
    {
        return $this->client->sendFrame($this->getProtocol()->getAbortFrame($transactionId));
    }
61513
public function delete($paymentMethod, $forceDelete = false)
    {
        $id = null;
        if ($paymentMethod instanceof HpsPayPlanPaymentMethod) {
            $id = $paymentMethod->paymentMethodKey;
        } else {
            $id = $paymentMethod;
        }

        $data = array(
            'forceDelete' => $forceDelete,
        );
        return $this->doRequest($data, array(
            'verb'     => 'DELETE',
            'endpoint' => 'paymentMethods/'.$id,
        ));
    }
485437
public function cancelTrade(TradeOffer $tradeOffer)
    {
        if ($tradeOffer->isOurOffer()) {
            return $this->cancelTradeById($tradeOffer->getTradeOfferId());
        }
        return false;
    }
135726
public function cancelRecurringPayment($orderId)
    {
        $service = $this->getService();

        $recurringPaymentAction = new Request\Action\RecurringPayment\Cancel($service, $orderId);

        return $recurringPaymentAction->cancel();
    }
259390
public function refund($order): Collection
    {
        $this->payload = Support::filterPayload($this->payload, $order, true);

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

        return Support::requestApi(
            'secapi/pay/refund',
            $this->payload,
            true
        );
    }
1217726
public function refund($params = null, $opts = null)
    {
        $this->refunds->create($params, $opts);
        $this->refresh();
        return $this;
    }
102450
public function cancel(string $id)
    {
        // Log Debug
        $this->flow->getLogger()->debug("Cancelling Invoice $id");

        return $this->make(
            $this->flow->send(
                'post',
                $this->endpoint . '/cancel',
                [
                    $this->id => $id,
                ]
            )
        );
    }
1215758
public static function create(&$resolve = null, &$reject = null, callable $canceller = null)
    {
        $deferred = new Deferred($canceller);

        $reject = [$deferred, 'reject'];
        $resolve = [$deferred, 'resolve'];

        return $deferred->promise();
    }