@link https://www.securepay.com.au/_uploads/files/SecurePay_Response_Codes.pdf

@return string Gateway failure code or transaction code if available.
772908
public function getCode()
    {
        return $this->hasTransaction()
            ? (string) $this->data->Payment->TxnList->Txn->responseCode
            : (string) $this->data->Status->statusCode;
    }
237389
public function validatePayment()
    {
        $oSession = $this->_getContainer()->getSession();
        $oConfig = $this->_getContainer()->getConfig();

        //Don't do anything with order remark if we not under Amazon Pay
        if ((string)$oSession->getVariable('amazonOrderReferenceId') === ''
            || (string)$oConfig->getRequestParameter('paymentid') !== 'bestitamazon'
        ) {
            return parent::validatePayment();
        }

        // order remark
        $sOrderRemark = (string)$oConfig->getRequestParameter('order_remark', true);

        if ($sOrderRemark !== '') {
            $oSession->setVariable('ordrem', $sOrderRemark);
        } else {
            $oSession->deleteVariable('ordrem');
        }

        return parent::validatePayment();
    }
1340883
public function getPayload()
    {
        $payload = array();
        if ($this->incomingAllow == true) {
            $incoming = array();
            $incoming['allow'] = true;
            $payload['incoming'] = $incoming;
        }

        if ($this->outgoingApplicationSid) {
            $outgoing = array();
            $outgoing['application_sid'] = $this->outgoingApplicationSid;

            if ($this->outgoingApplicationParams) {
                $outgoing['params'] = $this->outgoingApplicationParams;
            }

            $payload['outgoing'] = $outgoing;
        }

        if ($this->pushCredentialSid) {
            $payload['push_credential_sid'] = $this->pushCredentialSid;
        }

        if ($this->endpointId) {
            $payload['endpoint_id'] = $this->endpointId;
        }

        return $payload;
    }
297012
protected function getOrderPaymentStatusPaymentValid()
    {
        $status = null;
        $orderPayment = $this->getOrderPayment();
        if (isset($orderPayment) && !$orderPayment->getIsValid()) {
            $status = 'failed';
        }

        return $status;
    }
954622
public function getPassword()
    {
        $password = array_get($this->manifest, 'password', $this->password);
        if ($this->isSecured()) {
            if (empty($password)) {
                throw new BadRequestException('Password is required for secured package.');
            } elseif (strlen($password) < static::PASSWORD_LENGTH) {
                throw new BadRequestException(
                    'Password must be at least ' . static::PASSWORD_LENGTH . ' characters long for secured package.'
                );
            }
        }

        return $password;
    }
1317789
public function getAVSCode()
    {
        if (isset($this->data->transactionResponse)) {
            return (string)$this->data->transactionResponse->avsResultCode;
        } else {
            return '';
        }
    }
945070
public function getSignatureLite(): string
	{
		$data = [
			'merchantId'   => $this->getMerchantConfig()->merchantId,
			'accountId'    => $this->getMerchantConfig()->accountId,
			'merchantData' => $this->getMerchantData(),
			'password'     => $this->getMerchantConfig()->password,
		];

		return md5(
			http_build_query(
				array_filter($data)
			)
		);
	}
869241
public function getPaymentId()
    {
        if ($this->_sPaymentId == null) {
            $this->_sPaymentId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxpaymentid");
            if (!$this->_sPaymentId || $this->_blDelete) {
                if ($oUser = $this->getUser()) {
                    $oUserPayments = $oUser->getUserPayments();
                    if (isset($oUserPayments[0])) {
                        $this->_sPaymentId = $oUserPayments[0]->oxuserpayments__oxid->value;
                    }
                }
            }
            if (!$this->_sPaymentId) {
                $this->_sPaymentId = "-1";
            }
        }

        return $this->_sPaymentId;
    }
1093446
protected function verifyPayment()
	{
		if (!Input::has('au') && !Input::has('rs'))
			throw new ParsianErrorException('درخواست غیر معتبر', -1);

		$authority = Input::get('au');
		$status = Input::get('rs');

		if ($status != 0) {
			$errorMessage = ParsianResult::errorMessage($status);
			$this->newLog($status, $errorMessage);
			throw new ParsianErrorException($errorMessage, $status);
		}

		if ($this->refId != $authority)
			throw new ParsianErrorException('تراکنشی یافت نشد', -1);

		$params = array(
			'pin' => $this->config->get('gateway.parsian.pin'),
			'authority' => $authority,
			'status' => 1
		);

		try {
			$soap = new SoapClient($this->serverUrl);
			$result = $soap->PinPaymentEnquiry($params);

		} catch (\SoapFault $e) {
			throw new ParsianErrorException($e->getMessage(), -1);
		}

		if ($result === false || !isset($result->status))
			throw new ParsianErrorException('پاسخ دریافتی از بانک نامعتبر است.', -1);

		if ($result->status != 0) {
			$errorMessage = ParsianResult::errorMessage($result->status);
			$this->transactionFailed();
			$this->newLog($result->status, $errorMessage);
			throw new ParsianErrorException($errorMessage, $result->status);
		}

		$this->trackingCode = $authority;
		$this->transactionSucceed();
		$this->newLog($result->status, ParsianResult::errorMessage($result->status));
	}
27431
protected function getTransactionCode()
    {
        $transactionCode = $this->transactionCode;
        if($this->getRequireAvsCheck()) {
            $transactionCode += 1;
        }
        if($this->getCreateCard()) {
            $transactionCode += 128;
        }
        return $transactionCode;
    }
1138993
public function getErrors()
    {
        $oError = new WirecardCEE_QPay_Error($this->_returnData[self::$ERROR_MESSAGE]);

        if (isset( $this->_returnData[self::$ERROR_CONSUMER_MESSAGE] )) {
            $oError->setConsumerMessage($this->_returnData[self::$ERROR_CONSUMER_MESSAGE]);
        }

        return $oError;
    }
1137282
public function getValidationFailureMessage()
    {
        $payPalRequest = $this->getPayPalRequest();
        $payPalResponse = $this->getPayPalResponse();
        $shopOwnerUserName = $this->getShopOwnerUserName();
        $receiverEmailPayPal = $payPalRequest[self::RECEIVER_EMAIL];

        $validationMessage = array(
            'Shop owner'           => (string) $shopOwnerUserName,
            'PayPal ID'            => (string) $receiverEmailPayPal,
            'PayPal ACK'           => ($payPalResponse->isPayPalAck() ? 'VERIFIED' : 'NOT VERIFIED'),
            'PayPal Full Request'  => print_r($payPalRequest, true),
            'PayPal Full Response' => print_r($payPalResponse->getData(), true),
        );

        return $validationMessage;
    }
328495
protected function verifyPayment()
	{
		$processor = new RSAProcessor($this->config->get('gateway.pasargad.certificate-path'),RSAKeyType::XMLFile);
		$fields = array('invoiceUID' => Input::get('tref'));
		$result = Parser::post2https($fields,$this->checkTransactionUrl);
		$check_array = Parser::makeXMLTree($result);

		if ($check_array['resultObj']['result'] != "True") {
		    $this->newLog(-1, Enum::TRANSACTION_FAILED_TEXT);
		    $this->transactionFailed();
		    throw new PasargadErrorException(Enum::TRANSACTION_FAILED_TEXT, -1);
		}
		
		$fields = array(
			'MerchantCode' => $this->config->get('gateway.pasargad.merchantId'),
			'TerminalCode' => $this->config->get('gateway.pasargad.terminalId'),
			'InvoiceNumber' => $check_array['resultObj']['invoiceNumber'],
			'InvoiceDate' => Input::get('iD'),
			'amount' => $check_array['resultObj']['amount'],
			'TimeStamp' => date("Y/m/d H:i:s"),
			'sign' => '',
		);

		$data = "#" . $fields['MerchantCode'] . "#" . $fields['TerminalCode'] . "#" . $fields['InvoiceNumber'] ."#" . $fields['InvoiceDate'] . "#" . $fields['amount'] . "#" . $fields['TimeStamp'] ."#";
		$data = sha1($data, true);
		$data = $processor->sign($data);
		$fields['sign'] = base64_encode($data);
		$result = Parser::post2https($fields,$this->verifyUrl);
		$array = Parser::makeXMLTree($result);
		if ($array['actionResult']['result'] != "True") {
			$this->newLog(-1, Enum::TRANSACTION_FAILED_TEXT);
			$this->transactionFailed();
			throw new PasargadErrorException(Enum::TRANSACTION_FAILED_TEXT, -1);
		}
		$this->refId = $check_array['resultObj']['referenceNumber'];
		$this->transactionSetRefId();
		$this->trackingCode = Input::get('tref');
		$this->transactionSucceed();
		$this->newLog(0, Enum::TRANSACTION_SUCCEED_TEXT);
	}
415780
private function getAuthCode()
    {
        $amount = intval($this->parameters['amount']);
        if (!$this->sandbox) {
            $url = $this->endpoint . "/Auth/{$this->parameters['custom']}/{$this->parameters['transactionId']}/{$amount}";
            $url_redirect = $this->endpoint_redirect;
        } else {
            $url = $this->sandbox_endpoint . "/Auth/{$this->options['app_key']}/{$this->parameters['transactionId']}/{$amount}";
            $url_redirect = $this->sandbox_endpoint_redirect;
        }
        $response = $this->xml2array($this->curl_request($url));
        $output = explode('|', $response['0']);
        if ($output['0'] != 1) {
            throw new \Exception($output['1']);
        }

        $this->transactionReference = $output['2'];
        $this->auth_code = $output['3'];
        $this->redirect = $url_redirect . '?AuthCode=' . $this->auth_code;
    }
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;
    }
1131071
public function failError()
    {
        if (
            ($packet = $this->getPacket()) and
            $packet['status'] !== Job::STATUS_FAILED and
            ($e = json_decode($packet['exception'], true))
        ) {
            return $e['error'];
        }

        return 'Unknown exception';
    }
291332
public function getPaymentStatus()
    {
        if ($this->Status) {
            return _t('SilverStripe\Omnipay\Model\Payment.STATUS_' . strtoupper($this->Status), $this->Status);
        }
        return null;
    }