Is the trade paid?

@return boolean
178213
public function isPaid()
    {
        $response = array_get($this->data, 'response');
        if ($response) {
            $trade = array_get($response, 'trade');
            if (array_get($trade, 'trade_status')) {
                if (array_get($trade, 'trade_status') == 'TRADE_SUCCESS') {
                    return true;
                } elseif (array_get($trade, 'trade_status') == 'TRADE_FINISHED') {
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
936802
public function beginTransaction(): bool
    {
        if(!$this->inTransaction())
        {
            $result = $this->instance->beginTransaction();
            if(!$result)
            {
                return $result;
            }
        }
        $this->exec('SAVEPOINT P' . $this->getTransactionLevels());
        $this->__tBeginTransaction();
        return true;
    }
12486
public function isSuccessful()
    {
        // get response code
        $code = $this->getHttpResponseCode();

        if ($code === 200) {  // OK
            return true;
        }

        if ($code === 201) {   // Created
            if ($this->getTransactionType() === 'payment') {
                return $this->isApproved();
            }
            return true;
        }

        if ($code === 202 && $this->isPending()) {   // Accepted
            return true;
        }

        return false;
    }
1309166
public function isPending()
    {
        $app = App::getInstance();

        if ($this->getActive()
            && $this->getPending()
            && $this->getIp() == $app['env']['RemoteIP']
        ) { // if comment is pending for this ip address
            return true;
        } else {
            return false;
        }
    }
941382
private function merchantPayload()
    {
        $partial = $this->partialPayments();
        if ($this->publicId() !== false && is_array($partial) === true) {
            $payload = array(
                "storeDomain" => getenv('SERVER_NAME')
            );
            return $this->payload($payload);
        }
        return false;
    }
1013564
public function hasAmountPrice()
    {
        if (self::$_blHasAmountPrice === null) {
            self::$_blHasAmountPrice = false;

            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
            $sQ = "SELECT 1 FROM `oxprice2article` LIMIT 1";

            if ($oDb->getOne($sQ)) {
                self::$_blHasAmountPrice = true;
            }
        }

        return self::$_blHasAmountPrice;
    }
675264
public function isSuccessful()
    {
        $data = $this->getData();

        return
            (isset($data['status']) && $data['status'] !== 'KO') &&
            (isset($data['duplicate']) && $data['duplicate'] !== 'true');
    }
930731
public function isValid()
    {
        $requestPayment = $this->getRequestOrderPayment();
        $orderPayment = $this->getOrderPayment();

        $currencyPayPal = $requestPayment->getCurrency();
        $pricePayPal = $requestPayment->getAmount();

        $currencyPayment = $orderPayment->getCurrency();
        $amountPayment = $orderPayment->getAmount();

        return ($currencyPayPal == $currencyPayment && $pricePayPal == $amountPayment);
    }
412548
public function isBoletoPayment()
    {
        $this->order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());

        if ($this->order->getPayment() && $this->order->getPayment()->getMethod() == "adyen_boleto") {
            return true;
        }

        return false;
    }
348355
public function getTransactionTotals()
    {
        $request = $this->paystackHttpClient->get(
            Resource::GET_TRANSACTION_TOTALS
        );

        return $this->processResourceRequestResponse($request);
    }
180918
protected function userPayment()
	{
		$this->authority = Input::get('Authority');
		$status = Input::get('Status');

		if ($status == 'OK') {
			return true;
		}

		$this->transactionFailed();
		$this->newLog(-22, ZarinpalException::$errors[-22]);
		throw new ZarinpalException(-22);
	}
630050
protected function userPayment()
	{
		$this->refId = Input::get('RefId');
		$this->trackingCode = Input::get('SaleReferenceId');
		$this->cardNumber = Input::get('CardHolderPan');
		$payRequestResCode = Input::get('ResCode');

		if ($payRequestResCode == '0') {
			return true;
		}

		$this->transactionFailed();
		$this->newLog($payRequestResCode, @MellatException::$errors[$payRequestResCode]);
		throw new MellatException($payRequestResCode);
	}
723322
public function beginTransaction()
    {
        $return = true;
        if (!$this->nestedTransactionCount) {
            $return = $this->connection->beginTransaction();
            if ($this->useDebug) {
                $this->log('Begin transaction');
            }
            $this->isUncommitable = false;
        }
        $this->nestedTransactionCount++;

        return $return;
    }
760387
public function onCharge($order)
    {
        $this->statusCode = 'pending';

        // Begin paypal
        try {

            if ($order->total <= 0) {
            
                $this->statusCode = 'completed';

                $this->detail = 'Order total is 0; no PayPal transaction required.';

                $this->transactionId = uniqid();

                return true;
            }

            $this->setContext();

            $payer = new Payer();
        
            $payer->setPaymentMethod('paypal');

            $list = new ItemList();
            
            $list->setItems($this->toPayPalItems($order));
            
            $details = new Details();
            
            $details->setShipping($order->totalShipping)
                ->setTax($order->totalTax)
                ->setSubtotal($order->totalPrice);

            $amount = new Amount();

            $amount->setCurrency(Config::get('shop.currency'))
                ->setTotal($order->total)
                ->setDetails($details);

            $transaction = new Transaction();

            $transaction->setAmount($amount)
                ->setItemList($list)
                ->setDescription(sprintf(
                    '%s payment, Order #%d',
                    Config::get('shop.name'),
                    $order->id
                ))
                ->setInvoiceNumber($order->id);

            $redirectUrls = new RedirectUrls();
            
            $redirectUrls->setReturnUrl($this->callbackSuccess)
                ->setCancelUrl($this->callbackFail);

            $payment = new Payment();

            $payment->setIntent('sale')
                ->setPayer($payer)
                ->setRedirectUrls($redirectUrls)
                ->setTransactions([$transaction]);

            //$request = clone $payment;

            $payment->create($this->apiContext);

            $this->approvalUrl = $payment->getApprovalLink();

            $this->detail = sprintf('Pending approval: %s', $this->approvalUrl);

            return true;

        } catch (PayPalConnectionException $e) {

            $response = json_decode($e->getData());

            throw new GatewayException(
                sprintf(
                    '%s: %s',
                    $response->name,
                    isset($response->message) ? $response->message : 'Paypal payment Failed.'
                ),
                1001,
                $e
            );

        } catch (\Exception $e) {

            throw new GatewayException(
                $e->getMessage(),
                1000,
                $e
            );

        }

        return false;
    }
476019
public function isOnReturn()
	{
		if ($this->idLastReturn != null) {
			$currentStatusReturn = $this->PayReturn()->find($this->idLastReturn)->status;

			return $currentStatusReturn == 'onReturn';
		}

		return false;
	}
464564
public function isStored()
    {
        foreach ($this->getKeys() as $key) {
            if (!$this->cookieBag->has($key)) {
                return false;
            }
        }

        // Now start checking the signature
        if (!$this->isValidSignature(
            $this->cookieBag->get(self::CLIENT_LOGIN_KEY), 
            $this->cookieBag->get(self::CLIENT_LOGIN_PASSWORD_HASH_KEY),
            $this->cookieBag->get(self::CLIENT_TOKEN_KEY)
        )) {
            return false;
        }

        return true;
    }
582080
public function isCaptureOnShipment()
    {
        $isPaymentOnShipmentStored = $this->GetUserPaymentDataItem(self::PARAMETER_IS_PAYMENT_ON_SHIPMENT);
        if (false !== $isPaymentOnShipmentStored) {
            return '1' === $isPaymentOnShipmentStored;
        }

        $config = $this->getAmazonPaymentGroupConfig($this->getActivePortalId());

        return $config->isCaptureOnShipment();
    }