Ipaymu::checkTransaction

Gets ipaymu transaction status.

@param string $trxId Transaction ID.

@return array|bool Returns FALSE if failed.
436279
public function checkTransaction($trxId)
    {
        $statusCodes = [
            -1 => 'PROCESSED',
            0  => 'PENDING',
            1  => 'SUCCESS',
            2  => 'CANCELED',
            3  => 'REFUND',
        ];

        if (false !== ($response = $this->request('api/CekTransaksi.php', ['id' => $trxId]))) {

            $response = [
                'id'          => $trxId,
                'status'      => $statusCodes[ $response[ 'Status' ] ],
                'description' => $response[ 'Keterangan' ],
                'sender'      => $response[ 'Pengirim' ],
                'receiver'    => $response[ 'Penerima' ],
                'amount'      => $response[ 'Nominal' ],
                'time'        => date('r', strtotime($response[ 'Waktu' ])),
                'type'        => strtoupper($response[ 'Tipe' ]),
            ];

            return $response;
        }

        return false;
    }
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;
    }
1230364
public function rollBack($xid)
    {
        if ($this->activeTransaction != $xid || $this->activeTransaction === false) {
            return;
        }

        $this->activeTransaction = false;

        if (!$this->connection->rollback()) {
            throw new DbException("Rollback failed");
        }

        $this->connection->autocommit(true);
    }
758801
public synchronized boolean isSettlementTransaction(Transaction tx) {
        try {
            tx.verify();
            tx.getInput(0).verify(getContractInternal().getOutput(0));
            return true;
        } catch (VerificationException e) {
            return false;
        }
    }
341994
public function status($transactionId)
    {
        $xml = new DOMDocument();
        $transaction = $xml->createElement('hps:Transaction');
        $status = $xml->createElement('hps:GetTransactionStatus');

        $status->appendChild($xml->createElement('hps:GatewayTxnId', $transactionId));

        $transaction->appendChild($status);
        return $this->_submitTransaction($transaction, 'GetTransactionStatus');
    }
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;
        }
    }
1128167
public function getTransaction($transactionId): QueryInterface
    {
        $uri = $this->getUri('query', $this->getParameters(['transactionId' => $transactionId]));
        /** @var QueryInterface $response */
        $response = $this->performRequest((string) $uri);

        Assert::isInstanceOf($response, QueryInterface::class, 'Invalid response');
        Assert::isInstanceOf($response, ErrorInterface::class, 'Invalid response');

        return $response;
    }
1373030
public function paymentHistory($mpayTid)
    {
        $this->integrityCheck();

        $response = $this->mpay24Sdk->transactionHistory($mpayTid);

        $this->recordedLastMessageExchange('TransactionHistory');

        return $response;
    }
1288792
public function isRequestValid(TransactionInterface $transaction)
    {
        $checkUrl = $transaction->get('check');

        $checkPrivate = $this->generateUrlCheck($transaction->getOrder());

        return $checkUrl === $checkPrivate;
    }
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;
    }
389771
public function commitTransaction()
    {
        $this->connect();
        if (!$this->_connection->inTransaction()) {
            return false;
        }

        return $this->_connection->commit();
    }
546102
public function check($key = '', $postData)
    {
        if (!isset($postData)) {
            throw new TpvException("Add data return of bank");
        }

        $parameters = $postData["Ds_MerchantParameters"];
        $signatureReceived = $postData["Ds_Signature"];
        $signature = $this->generateMerchantSignatureNotification($key, $parameters);

        return ($signature === $signatureReceived);
    }
664684
public function commitTransaction(): bool
	{
		if($this->transactionNestingLevel > 0 && --$this->transactionNestingLevel === 0)
		{
			return $this->pdo->commit();
		}

		return false;
	}
1186611
protected function _checkOrderExist($sOxId = null)
    {
        if (!$sOxId) {
            return false;
        }

        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        $masterDb = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster();
        if ($masterDb->getOne('select oxid from oxorder where oxid = ' . $masterDb->quote($sOxId))) {
            return true;
        }

        return false;
    }
357772
public function transactionStatus($mpay24tid = null, $tid = null)
    {
        $request = new TransactionStatus($this->config->getMerchantId());

        $request->setMpayTid($mpay24tid);
        $request->setTid($tid);

        $this->request = $request->getXml();

        $this->send();

        $result = new TransactionStatusResponse($this->response);

        return $result;
    }
533964
public function statusUpdateAction(PayoneTransactionStatusUpdateTransfer $transactionStatusUpdateTransfer)
    {
        $transactionStatusUpdateTransfer = $this
            ->getFacade()
            ->processTransactionStatusUpdate($transactionStatusUpdateTransfer);

        $this->triggerEventsOnSuccess($transactionStatusUpdateTransfer);

        return $transactionStatusUpdateTransfer;
    }
116738
public function PostProcessExternalPaymentHandlerHook()
    {
        $bPaymentTransmitOk = parent::PostProcessExternalPaymentHandlerHook();
        if ($bPaymentTransmitOk) {
            $oGlobal = TGlobal::instance();
            $aUserData = $oGlobal->GetUserData();
            $bPaymentTransmitOk = $this->GetTransactionStatus($aUserData['PAYID']);
        }

        return $bPaymentTransmitOk;
    }