Check whether the transaction was partially approved

@see Genesis_API_Documentation for more information

@return bool | null (if inapplicable)
546388
public function isPartiallyApproved()
    {
        if (isset($this->responseObj->partial_approval)) {
            return \Genesis\Utils\Common::stringToBoolean($this->responseObj->partial_approval);
        }

        return null;
    }
598211
protected function isAllowed()
    {
        /** @var  \Arcanesoft\Contracts\Auth\Models\User  $user */
        if (is_null($user = auth()->user()))
            return false;

        return $user->isAdmin() || $user->isModerator();
    }
1343182
public function isConfirmAGBActive()
    {
        if ($this->_blConfirmAGB === null) {
            $this->_blConfirmAGB = false;
            $this->_blConfirmAGB = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blConfirmAGB');
        }

        return $this->_blConfirmAGB;
    }
159149
public function isSuccessful()
    {
        // As per appendix F, 000 means the message was processed correctly
        if ((string) $this->data->Status->statusCode !== '000'
            || ($this->hasTransaction()
                && (string) $this->data->Payment->TxnList->Txn->approved !== 'Yes')) {
            return false;
        }

        return true;
    }
875091
public function is_valid() {
        $ret = false;

        if (is_null($this->maxRecipients) === false && is_null($this->priority) === false &&
            is_null($this->compileBeforeDeliveryStart) === false && is_null($this->allowMultipleDeliveries) === false &&
            is_null($this->deliverImmediately) === false && is_null($this->obeyDeliveryLimits) === false
        ) {
            if ($this->deliverImmediately === true || is_null($this->deliveryStartDateTime) === false) {
                if ($this->compileBeforeDeliveryStart === false ||
                    (is_null($this->compileStartDateTime) === false && is_null($this->deliveryStartDateTime) === false &&
                        $this->compileStartDateTime <= $this->deliveryStartDateTime)
                ) {
                    // TODO: deliveryFrequency
                    $ret = true;
                }
            }
        }

        return $ret;
    }
1101341
protected function _isAllowed()
    {
        $result = parent::_isAllowed();
        $result = $result && $this->_authorization->isAllowed($this->_aclResource);
        return $result;
    }
803332
public function isDone()
    {
        return (is_null($this->lastProtoResponse) || is_null($this->lastProtoResponse->getDone()))
            ? false
            : $this->lastProtoResponse->getDone();
    }
975337
public function isSuccessful()
    {
        if (isset($this->data['object']) && 'transaction' === $this->data['object']) {
            return !($this->data['status'] == 'refused');
        }
        return !isset($this->data['errors']);
    }
728558
protected function validateMajorUnitCurrency()
    {
        $field = 'major_unit';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && !isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        if (empty($value) || mb_strlen($value) > 50) {
            $this->setErrorLengthRange($field, $this->translation->text('Major unit'), 1, 50);
            return false;
        }

        return true;
    }
961064
public function approve()
	{

		$id = Input::get('id');
		$terminal = Terminal::whereUserId($this->userId())->first();
		$payment = Payment::find($id);
		if ($payment->term == $terminal->id) {

			$status = $payment->getPossibleStatus();

			if ($status) {
				$payment->status = $status;
				$payment->save();

				if ($payment->getPossibleStatus()) {
					return array(
						'next'  => true,
						'value' => 'Move to [' . $payment->getPossibleStatus() . ']',
						'status' => $payment->status,
					);
				}

			}

		}

		return array(
			'next' => false,
			'status' => $payment? $payment->status: null,
		);

	}
148487
protected function verifyPayment()
    {
        try {

            /** Get the payment ID before session clear **/
            $payment_id = \Session::get('paypal_payment_id');
            /** clear the session payment ID **/
            \Session::forget('paypal_payment_id');
            if (!$this->refId() || !$this->trackingCode()) {
                return false;
            }
            $payment = Payment::get($payment_id, $this->_api_context);
            /** PaymentExecution object includes information necessary **/
            /** to execute a PayPal account payment. **/
            /** The payer_id is added to the request query parameters **/
            /** when the user is redirected from paypal back to your site **/
            $execution = new PaymentExecution();
            $execution->setPayerId($this->refId);
            /**Execute the payment **/
            $result = $payment->execute($execution, $this->_api_context);
            /** dd($result);exit; /** DEBUG RESULT, remove it later **/
            if ($result->getState() == 'approved') {

                /** it's all right **/
                /** Here Write your database logic like that insert record or value in database if you want **/

//            \Session::put('success','Payment success');
                return true;
            }

            return false;
        } catch (\Exception $e) {
            $this->transactionFailed();
            $this->newLog('PaypalException', $e->getMessage());
            throw $e;
        }
    }
1299617
protected function validateCreatedReview()
    {
        $field = 'created';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $timestamp = strtotime($value);

        if (empty($timestamp)) {
            $this->setErrorInvalid($field, $this->translation->text('Created'));
            return false;
        }

        $this->setSubmitted('created', $timestamp);
        return true;
    }
873182
protected function verifyPayment()
	{
		try {
			$soap = new SoapClient($this->serverUrl);

			$result = $soap->CheckRequestStatusResult(
				$this->transactionId(),
				$this->config->get('gateway.sadad.merchant'),
				$this->config->get('gateway.sadad.terminalId'),
				$this->config->get('gateway.sadad.transactionKey'),
				$this->refId(),
				$this->amount
			);

		} catch (\SoapFault $e) {
			$this->transactionFailed();
			$this->newLog('SoapFault', $e->getMessage());
			throw $e;
		}

		if (empty($result) || !isset($result->AppStatusCode))
			throw new SadadException('در دریافت اطلاعات از بانک خطایی رخ داده است.');

		$statusResult = strval($result->AppStatusCode);
		$appStatus = strtolower($result->AppStatusDescription);

		$message = $this->getMessage($statusResult, $appStatus);

		$this->newLog($statusResult, $message['fa']);

		if ($statusResult != 0 || $appStatus !== 'commit') {
			$this->transactionFailed();
			throw new SadadException($message['fa'], $statusResult);
		}
		$this->trackingCode = $result->TraceNo;
		$this->cardNumber = $result->CustomerCardNumber;
		$this->transactionSucceed();
	}
915406
protected function validateTransactionOrder()
    {
        $field = 'transaction_id';
        $value = $this->getSubmitted($field);

        if (!isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Transaction');

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        if (empty($value)) {
            return true;
        }

        $transaction = $this->transaction->get($value);

        if (empty($transaction)) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        return true;
    }
839635
protected function transactionSucceed()
	{
		return $this->getTable()->whereId($this->transactionId)->update([
			'status' => Enum::TRANSACTION_SUCCEED,
			'tracking_code' => $this->trackingCode,
			'card_number' => $this->cardNumber,
			'payment_date' => Carbon::now(),
			'updated_at' => Carbon::now(),
		]);
	}
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;
    }
295006
public function isTransactionVerificationValid()
    {
        $this->verifyTransactionAtGateway();

        $result = $this->getResponse()['message'];

        switch ($result) {
            case self::VS:
                $validate = true;
                break;
            case self::ITF:
                $validate = false;
                break;
            default:
                $validate = false;
                break;
        }

        return $validate;
    }