Was the payment cancelled?

@return bool
764052
public function isCancelled()
    {
        if (!$this->testMdSignatures()) {
            return false;
        }

        return in_array($this->getStatus(), [self::STATUS_CHARGEBACK, self::STATUS_FAILED, self::STATUS_CANCELLED]);
    }
665777
public function isValid()
    {
        //validate directPayment values
        $checkEmpty = array($this->ipAddress, $this->acct, $this->firstName, $this->lastName);

        if(!$this->checkEmpty($checkEmpty) || is_null($this->_address)) {
            return false;
        }

        //address fields
        $address = $this->_address;

        $test = array(
            $address->getStreet(),
            $address->getCity(),
            $address->getState(),
            $address->getCountryCode(),
            $address->getZip()
        );

        if(!$this->checkEmpty($test) || is_null($this->_paymentDetails)) {
            return false;
        }

        $amt = $this->_paymentDetails->getAmt();
        if(empty($amt)) {
            return false;
        }

        //payment details payment action cannot be order
        if($this->_paymentDetails->getPaymentAction() == "Order") {
            return false;
        }

        return true;
    }
475636
function is_cancelled(){
        $mform =& $this->_form;
        if ($mform->isSubmitted()){
            foreach ($mform->_cancelButtons as $cancelbutton){
                if (optional_param($cancelbutton, 0, PARAM_RAW)){
                    return true;
                }
            }
        }
        return false;
    }
518051
public function isSuccessful()
    {
        $isHttpSuccess = parent::isSuccessful();
        $isPurchaseSuccess = false;

        if (isset($this->data['paymentStatus']) && $this->data['paymentStatus'] == $this->successfulPaymentStatus) {
            $isPurchaseSuccess = true;
        }

        return ($isHttpSuccess && $isPurchaseSuccess);
    }
146940
public function IsSponsored()
    {
        $bIsSponsored = $this->GetFromInternalCache('bVoucherIsSponsored');
        if (is_null($bIsSponsored)) {
            $bIsSponsored = false;
            $oVoucherSeries = $this->GetFieldShopVoucherSeries();
            if ($oVoucherSeries && !empty($oVoucherSeries->fieldShopVoucherSeriesSponsorId)) {
                $bIsSponsored = true;
            }
            $this->SetInternalCache('bVoucherIsSponsored', $bIsSponsored);
        }

        return $bIsSponsored;
    }
204151
protected function getOrderPaymentStatusFinal()
    {
        $status = null;
        if ($this->isOrderPaymentStatusFinal()) {
            $status = $this->getOrder()->getPaymentStatus();
        }

        return $status;
    }
37579
public function wasAccepted()
    {
        if ( $this->hasErrors() ) {
            return false;
        }

        $aResponse = $this->getResponse();

        if ( !empty( $aResponse['pm_order_status'] ) && $aResponse['pm_order_status'] === 'ACCEPTED' ) {
            return true;
        }

        return false;
    }
71163
public function getTransactionStatus(): string
    {
        // If the user cancelled in the terminal window, then we need to detect that.
        if ($this->hasError()) {
            $error = $this->getError();
            if (
                !empty($error['operation']) && $error['operation'] === 'Terminal' &&
                !empty($error['responseCode']) && $error['responseCode'] === '17' &&
                !empty($error['responseSource']) && ($error['responseSource'] === 'Terminal' || $error['responseSource'] === '05') &&
                !empty($error['responseText']) && $error['responseText'] === 'Cancelled by customer.'
            ) {
                return QueryInterface::STATUS_CANCELLED;
            }

            return QueryInterface::STATUS_FAILED;
        }

        $summary = $this->getSummary();

        // If the cancelled flag is set, then it can no longer be considered to be authed, captured or credited.
        if ($summary['cancelled']) {
            return QueryInterface::STATUS_CANCELLED;
        }

        // If there's an amount present in the amountCredited field, it's because it's not a request for payment.
        if ($summary['amountCredited']) {
            return QueryInterface::STATUS_CREDITED;
        }

        // If it's not cancelled, not credited, but is authed and not captured, then it must just be authed.
        if ($summary['authorized'] && !$summary['amountCaptured']) {
            return QueryInterface::STATUS_AUTHORIZED;
        }

        // If it's not cancelled, not credited, not authed, and not captured, then it's either pending, (Netaxept's
        // 'registered' state) or rejected.
        if (!$summary['authorized'] && !$summary['amountCaptured']) {
            return QueryInterface::STATUS_PENDING;
        }

        // The only other option is that it's been captured.
        return QueryInterface::STATUS_CAPTURED;
    }
421742
protected function getOrderPaymentStatusPayments()
    {
        $status = 'completed';
        $paymentList = $this->getOrder()->getPaymentList();

        if ($paymentList->hasPendingPayment()) {
            $status = 'pending';
        } elseif ($paymentList->hasFailedPayment()) {
            $status = 'failed';
        }

        return $status;
    }
1324089
public function isNewPayPalOrder()
    {
        $active = false;

        $order = $this->getEditObject();
        $orderPayPal = $order->getPayPalOrder();
        if ($this->isPayPalOrder() && $orderPayPal->isLoaded()) {
            $active = true;
        }

        return $active;
    }
553899
public function isRefunded()
    {
        if ($this->parent) {
            return $this->parent->isRefunded();
        }

        return $this->children->exists(function($key, Transaction $child) {
            return $child->getType() == Transaction\TransactionType::REFUND && $child->getStatus() == Result\ResultStatus::APPROVED;
        });
    }
866259
def _is_billing_complete(self):
        
        if self.is_one_off():
            return self.get_billed_amount() >= Balance(self.fixed_amount, self.currency)
        else:
            return False
308985
public function inTransaction(): bool
    {
        $status = pg_transaction_status($this->getResource());

        return PGSQL_TRANSACTION_INTRANS === $status || PGSQL_TRANSACTION_INERROR === $status;
    }
494233
public function getStatus()
    {
        if (is_null($this->getOrder())) {
            return;
        }

        $status = $this->getOrderPaymentStatusFinal();

        if (is_null($status)) {
            $status = $this->getOrderPaymentStatusPaymentValid();
        }
        if (is_null($status)) {
            $status = $this->getOrderPaymentStatusPayments();
        }

        return $status;
    }
91737
public function isValid()
    {
        if(empty($this->token) || empty($this->payerId) || is_null($this->_paymentDetails)) {
            return false;
        }

        $valid = true;
        foreach($this->_paymentDetails as $detail) {
            if(empty($detail)) {
                $valid = false;
                break;
            }

            $amt = $detail->getAmt();

            if(empty($amt)) {
                $valid = false;
                break;
            }
        }

        return $valid;
    }
500244
public function isPaid()
    {
        $statuses = $this->config()->get("paid_statuses");

        if (!is_array($statuses)) {
            return $this->Status == $statuses;
        } else {
            return in_array($this->Status, $statuses);
        }
    }
1278571
public function getIsConfirmed()
    {
        $cAttribute = $this->confirmationAttribute;
        return (is_string($cAttribute) && !empty($cAttribute)) ? $this->$cAttribute > static::$confirmFalse : true;
    }