Handle the callback done by the payment page application after
a transaction processing.
This will populate the status field that can be retrieved by calling
getStatus().

@return true on success or false on error
772627
public function handleCallbackStatus() {
    // Read the body of the request
    $body = @file_get_contents('php://input');

    if ($body != null && strlen(trim($body)) > 0) {
      $status = json_decode(trim($body), false);

      if ($status != null && is_object($status)) {
        $this->initStatus($status);

        return true;
      }
    }

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

        return $status;
    }
1180191
@Transient
    public String getStatus()
    {
        if(hasFailed()) return FAILED; 
        if(hasSucceeded()) return SUCCESS; 
        if(ignored != 0) return IGNORED; 
        return NOT_RUNNED; 
    }
680089
@Override
	public int getStatus() throws TransactionManagementException {
		logger.entering(CLASSNAME, "getStatus");
		logger.exiting(CLASSNAME, "getStatus", status);
		return status;
	}
319589
public function successAction()
    {
        // get the response data
        $response = $this->getRequest()->getParams();

        // process
        try {
            $result = $this->validateResultUrl($response);

            if ($result) {
                $session = $this->_getCheckout();
                $session->unsAdyenRealOrderId();
                $session->setQuoteId($session->getAdyenQuoteId(true));
                $session->getQuote()->setIsActive(false)->save();
                $this->_redirect('checkout/onepage/success', array('utm_nooverride' => '1'));
            } else {
                $this->cancel();
            }
        } catch (Exception $e) {
            Mage::logException($e);
            throw $e;
        }
    }
1196347
public function getStatus()
    {
        if (   !strlen($this->getValue('status'))
            && !in_array($this->getType(), array('validation-error', 'error')))
        {
            $this->offsetSet('status', 'processing');
        }

        return strtolower($this->getValue('status'));
    }
445809
private void handlePostAuthReturn() {
        final Uri intentUri = getIntent().getData();
        if (intentUri != null) {
            if ("stripe".equals(intentUri.getScheme()) &&
                    "payment-auth-return".equals(intentUri.getHost())) {
                final String paymentIntentClientSecret =
                        intentUri.getQueryParameter("payment_intent_client_secret");
                if (paymentIntentClientSecret != null) {
                    final Stripe stripe = new Stripe(getApplicationContext(),
                            PaymentConfiguration.getInstance().getPublishableKey());
                    final PaymentIntentParams paymentIntentParams = PaymentIntentParams
                            .createRetrievePaymentIntentParams(paymentIntentClientSecret);
                    mCompositeDisposable.add(Observable
                            .fromCallable(() ->
                                    stripe.retrievePaymentIntentSynchronous(paymentIntentParams,
                                            PaymentConfiguration.getInstance().getPublishableKey()))
                            .subscribeOn(Schedulers.io())
                            .observeOn(AndroidSchedulers.mainThread())
                            .subscribe((paymentIntent -> {
                                if (paymentIntent != null) {
                                    handleRetrievedPaymentIntent(paymentIntent);
                                }
                            }))
                    );
                }
            }
        }
    }
164907
def process_callback(payment_transaction, callback_response)
      payment_transaction.processor_type = PaymentTransaction::PROCESSOR_CALLBACK
      payment_transaction.processor_name = @callback_type

      super payment_transaction, callback_response
    end
348586
public function PostProcessExternalPaymentHandlerHook()
    {
        $bPaymentTransmitOk = parent::PostProcessExternalPaymentHandlerHook();
        if ($bPaymentTransmitOk) {
            $oGlobal = TGlobal::instance();
            $aUserData = $oGlobal->GetUserData();

            // check if return data is ok...
            $aReqFields = array('merchid', 'orderid', 'amount', 'currency', 'result', 'timestamp', 'psphash');
            foreach ($aReqFields as $sFieldName) {
                $bPaymentTransmitOk = ($bPaymentTransmitOk && array_key_exists($sFieldName, $aUserData));
            }
            if ($bPaymentTransmitOk && 'success' == $aUserData['result'] && (0 == strcmp($this->GetMontradaResponseHash($aUserData), $aUserData['psphash']))) {
                // all good... we can continue to our order confirm page
                // need to fetch the transaction id
                $aResult = $this->ExecuteRequestCall('txnresult', array('orderid' => $aUserData['orderid']));
                $this->sMontradaTransactionId = $aResult['trefnum'];
                $this->aCheckoutDetails = $aUserData;
            }
        }

        return $bPaymentTransmitOk;
    }
385349
def handleStatus(self, version, status, message):
        """"""

        self.status = status
        self.message = message
1362138
public int getStatus() {
        if (ptm == null) {
            return TransactionManager.STATUS_NO_TRANSACTION;
        }

        logger.debug("Current TX name (According to TransactionSynchronizationManager) : " + TransactionSynchronizationManager.getCurrentTransactionName());
        if (TransactionSynchronizationManager.isActualTransactionActive()) {
            TransactionStatus transaction = null;
            try {
                if (currentTransaction == null) {
                    transaction = ptm.getTransaction(td);
                    if (transaction.isNewTransaction()) {
                        return TransactionManager.STATUS_COMMITTED;
                    }
                } else {
                    transaction = currentTransaction;
                }
                logger.debug("Current TX: " + transaction);
                // If SynchronizationManager thinks it has an active transaction but
                // our transaction is a new one
                // then we must be in the middle of committing
                if (transaction.isCompleted()) {
                    if (transaction.isRollbackOnly()) {
                        return TransactionManager.STATUS_ROLLEDBACK;
                    }
                    return TransactionManager.STATUS_COMMITTED;
                } else {
                    // Using the commented-out code in means that if rollback with this manager,
                    //  I always have to catch and check the exception 
                    //  because ROLLEDBACK can mean both "rolled back" and "rollback only".
                    // if ( transaction.isRollbackOnly() ) {
                    //     return TransactionManager.STATUS_ROLLEDBACK;
                    // }

                    return TransactionManager.STATUS_ACTIVE;
                }
            } finally {
                if (currentTransaction == null) {
                    ptm.commit(transaction);
                }
            }
        }
        return TransactionManager.STATUS_NO_TRANSACTION;
    }
421388
@Override
    public void afterCompletion(int status) {

        if (tc.isEntryEnabled()) {
            Tr.entry(this, tc, "afterCompletion");
        }

        if (tc.isDebugEnabled()) {
            Tr.debug(
                     tc,
                     "Using transaction wrapper@" + Integer.toHexString(this.hashCode()));
        }

        if (mcWrapper.isMCAborted()) {
            Tr.exit(tc, "Connection was aborted. Exiting afterCompletion.");
            return;
        }

        // When afterCompletionCode is called we need to reset the registeredForSync flag.
        registeredForSync = false;
        this.hasRollbackOccured = false;
        /*
         * Mark the transaction complete in the wrapper
         */
        // Do NOT catch runtime exections here.  Let them flow out of the component.
        mcWrapper.transactionComplete();

        if (tc.isDebugEnabled()) {
            if (mcWrapper.getHandleCount() != 0) {
                // Issue warning that Connections have not been closed by the end of the current UOW
                //  scope and will be closed by the CM.
                //            Tr.warning(this, tc,"HANDLE_NOT_CLOSED_J2CA0055");
                Tr.debug(this, tc, "Information:  handle not closed at end of UOW. Connection from pool " + mcWrapper.gConfigProps.getXpathId());
            }
        }

        // Do NOT catch the runtime exception which getConnectionManager might throw.
        // If this is thrown it is an internal bug and needs to be fixed.
        // Allow the rte to flow up to the container.
        boolean shareable = mcWrapper.getConnectionManager().shareable();

        //  - Simplified the following if/else construct taking advantage of the
        //             new releaseToPoolManger call on mcWrapper.
        //
        // If the connection is shareable, or it is non-shareable and the handleCount is
        // zero, then release it back to the poolManger, otherwise simply reset the
        // transaction related variables.
        //
        // Note: shareable connections are released at the end of transactions regardless of
        //  outstanding handles because we don't supports handled being associated to an active
        //  managedConnection outside of a sharing boundary.
        //
        //  if the MCWrapper is stale we will release the connection to the pool.
        //
        if ((shareable) || (!shareable && mcWrapper.getHandleCount() == 0) || mcWrapper.isStale()) {

            if (tc.isDebugEnabled()) {
                Tr.debug(this, tc,
                         "Releasing the connection to the pool. shareable = " + shareable + "  handleCount = " + mcWrapper.getHandleCount() + "  isStale = " + mcWrapper.isStale());
            }

            try {
                mcWrapper.releaseToPoolManager();
            } catch (Exception e) {
                // No need to rethrow this exception since nothing can be done about it,
                //  and the application has successfully finished its use of the connection.
                com.ibm.ws.ffdc.FFDCFilter.processException(
                                                            e,
                                                            "com.ibm.ejs.j2c.LocalTransactionWrapper.afterCompletion",
                                                            "711",
                                                            this);
                if (tc.isDebugEnabled()) {
                    Tr.debug(this, tc, "afterCompletionCode for datasource " + mcWrapper.gConfigProps.cfName + ":  caught Exception", e);
                }
            }

        } // end ((shareable) || (!shareable && mcWrapper.getHandleCount() == 0))
        else {
            /*
             * The cleanup of the coordinator enlisted flag should only be done for non sharable connections, in
             * other cases, the coord is set to null in mcWrapper.releaseToPoolManager(). We only need to worry about this
             * if the handleCount is greater than 0 (in which case the cleanup will be done by the poolManager). Same
             * thing for the tranFailed flag in the MCWrapper.
             */
            mcWrapper.setUOWCoordinator(null);
            // Reset the serialReuseCount since it is only valid for the duration of
            // the LTC. Note that the release path above will also reset it via mcWrapper.cleanup().
            enlisted = false;
        }

        if (tc.isEntryEnabled()) {
            Tr.exit(this, tc, "afterCompletion");
        }
    }
97534
protected function status()
	{
		if ($len = strspn($this->data, '0123456789', $this->position))
		{
			$this->status_code = (int) substr($this->data, $this->position, $len);
			$this->position += $len;
			$this->state = 'reason';
		}
		else
		{
			$this->state = false;
		}
	}
534418
protected function getStatus()
    {
        if ($this->detail instanceof \Throwable) {
            $this->status = $this->createStatusFromException();
        }

        return $this->status;
    }
247497
public function callbackSubmit()
    {
        $this->AddOutput("<p>DoSubmit(): Form was submitted.<p>");
        $this->AddOutput("<p>Do stuff (save to database) and return true (success) or false (failed processing)</p>");
        $this->AddOutput("<p><b>Name: " . $this->Value('name') . "</b></p>");
        $this->AddOutput("<p><b>Email: " . $this->Value('email') . "</b></p>");
        $this->AddOutput("<p><b>Phone: " . $this->Value('phone') . "</b></p>");
        $this->saveInSession = true;
        return true;
    }
1118535
protected function userPayment()
    {
        $status = Input::get('status');
        $transId = Input::get('transId');
        $this->cardNumber = Input::get('cardNumber');
        $message = Input::get('message');
        if (is_numeric($status) && $status > 0) {
            $this->trackingCode = $transId;
            return true;
        }
        $this->transactionFailed();
        $this->newLog(-5, $message);
        throw new PayirReceiveException(-5);
    }
420322
def check_payment_transaction_status(payment_transaction)
      unless payment_transaction.finished?
        raise ValidationError, 'Only finished payment transaction can be used for create-card-ref-id'
      end

      unless payment_transaction.payment.paid?
        raise ValidationError, "Can not use new payment for create-card-ref-id. Execute 'sale' or 'preauth' query first"
      end
    end