@param    payment_transaction   [PaymentTransaction]    Payment transaction for update
 @param    callback_response     [CallbackResponse]      PaynetEasy callback

 @return                         [CallbackResponse]      PaynetEasy callback
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
1368118
private function _submitTransaction($transaction, $txnType, $clientTxnId = null, $cardData = null)
    {
        $options = array();
        if ($clientTxnId !== null) {
            $options['clientTransactionId'] = $clientTxnId;
        }

        try {
            $response = $this->doRequest($transaction, $options);
        } catch (HpsException $e) {
            if ($e->innerException != null && $e->innerException->getMessage() == 'gateway_time-out') {
                if ($txnType == 'DebitSale') {
                    try {
                        $this->reverse($cardData, $this->_amount, $this->_currency);
                    } catch (Exception $e) {
                        throw new HpsGatewayException('0', HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR);
                    }
                }
                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
            }
            throw $e;
        }

        $this->_processChargeGatewayResponse($response, $txnType);
        $this->_processChargeIssuerResponse($response, $txnType);

        $rvalue = null;
        switch ($txnType) {
            case 'DebitSale':
                $rvalue = HpsDebitSale::fromDict($response, $txnType);
                break;
            case 'DebitAddValue':
                $rvalue = HpsDebitAddValue::fromDict($response, $txnType);
                break;
            case 'DebitReturn':
                $rvalue = HpsDebitReturn::fromDict($response, $txnType);
                break;
            case 'DebitReversal':
                $rvalue = HpsDebitReversal::fromDict($response, $txnType);
                break;
            default:
                break;
        }

        return $rvalue;
    }
1352987
public Result processPayment(Payment payment) throws PaytrailException {
		try {
			String data = marshaller.objectToString(payment);
			String url = serviceUrl + "/api-payment/create";
			
			IOHandlerResult requestResult = postJsonRequest(url, data);
			
			if (requestResult.getCode() != 201) {
				JsonError jsonError = marshaller.stringToObject(JsonError.class, requestResult.getResponse());
				throw new PaytrailException(jsonError.getErrorMessage());
	  	}
			
			return marshaller.stringToObject(Result.class, requestResult.getResponse());
		} catch (IOException e) {
			throw new PaytrailException(e);
		}
	}
1151203
function (callback) {
        var conn = this.connection(),
            id = this._id; // use the raw ID object

        // prevent new transactions from using this connection.
        this.disconnect();

        // if commit was called with no active conn, it implies, no transact action
        // was called. as such it is an error.
        if (!conn) {
            // allow one pseudo commit even without connection, so that programmatic call of repeated commits or
            // rollbacks can be trapped.
            // note that the absence of `_id` indicates that a `.disconnect` was called.
            return callback && callback(id ? null : new AdapterError(AdapterError.TRANSACTION_UNINITIATED_COMM));
        }

        // we commit the connection and then release from hash
        conn.commit(function (error) {
            // try releasing the connection.
            // if that fails then treat it as a major error.
            try {
                conn.release();
            }
            // if there was an error during release, set that as the main error.
            catch (err) {
                !error && (error = err);
            }

            // if failure to issue commit or release, then rollback
            if (error && conn.transactionConfig.rollbackOnError) {
                return conn.rollback(function () {
                    // disassociate the connection from transaction and execute callback
                    Transaction.disassociateConnection(conn);
                    callback && callback(error);
                });
            }

            // disassociate the connection from transaction and execute callback
            Transaction.disassociateConnection(conn);
            callback && callback(error);
        });
    }
1087239
public function _submitTransaction($transaction, $txnType, $clientTxnId = null)
    {
        $response = $this->doRequest($transaction, $clientTxnId);

        HpsGatewayResponseValidation::checkResponse($response, $txnType);
        HpsIssuerResponseValidation::checkResponse(
            $response->Header->GatewayTxnId,
            $response->Transaction->$txnType->RspCode,
            $response->Transaction->$txnType->RspText,
            'gift'
        );

        $rvalue = '';
        switch ($txnType) {
            case 'GiftCardActivate':
                $rvalue = HpsGiftCardActivate::fromDict($response, $txnType, 'HpsGiftCardActivate');
                break;
            case 'GiftCardAddValue':
                $rvalue = HpsGiftCardAddValue::fromDict($response, $txnType, 'HpsGiftCardAddValue');
                break;
            case 'GiftCardAlias':
                $rvalue = HpsGiftCardAlias::fromDict($response, $txnType, 'HpsGiftCardAlias');
                break;
            case 'GiftCardBalance':
                $rvalue = HpsGiftCardBalance::fromDict($response, $txnType, 'HpsGiftCardBalance');
                break;
            case 'GiftCardDeactivate':
                $rvalue = HpsGiftCardDeactivate::fromDict($response, $txnType, 'HpsGiftCardDeactivate');
                break;
            case 'GiftCardReplace':
                $rvalue = HpsGiftCardReplace::fromDict($response, $txnType, 'HpsGiftCardReplace');
                break;
            case 'GiftCardReward':
                $rvalue = HpsGiftCardReward::fromDict($response, $txnType, 'HpsGiftCardReward');
                break;
            case 'GiftCardSale':
                $rvalue = HpsGiftCardSale::fromDict($response, $txnType, 'HpsGiftCardSale');
                break;
            case 'GiftCardVoid':
                $rvalue = HpsGiftCardVoid::fromDict($response, $txnType, 'HpsGiftCardVoid');
                break;
            case 'GiftCardReversal':
                $rvalue = HpsGiftCardReversal::fromDict($response, $txnType, 'HpsGiftCardReversal');
                break;
            default:
                break;
        }

        return $rvalue;
    }
400638
private function _submitTransaction($transaction, $txnType, $clientTxnId = null, $cardData = null)
    {
        $options = array();
        if ($clientTxnId != null) {
            $options['clientTransactionId'] = $clientTxnId;
        }

        try {
            $response = $this->doRequest($transaction, $options);
        } catch (HpsException $e) {
            if ($e->innerException != null && $e->innerException->getMessage() == 'gateway_time-out') {
                if (in_array($txnType, array('CreditSale', 'CreditAuth'))) {
                    try {
                        $this->reverse($cardData, $this->_amount, $this->_currency);
                    } catch (Exception $e) {
                        throw new HpsGatewayException('0', HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR);
                    }
                }
                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
            }
            throw $e;
        }

        $this->_processChargeGatewayResponse($response, $txnType);
        $this->_processChargeIssuerResponse($response, $txnType);

        $rvalue = null;
        switch ($txnType) {
            case 'ReportTxnDetail':
                $rvalue = HpsReportTransactionDetails::fromDict($response, $txnType);
                break;
            case 'ReportActivity':
                $rvalue = HpsReportTransactionSummary::fromDict($response, $txnType, $this->_filterBy);
                break;
            case 'CreditSale':
                $rvalue = HpsCharge::fromDict($response, $txnType);
                break;
            case 'CreditAccountVerify':
                $rvalue = HpsAccountVerify::fromDict($response, $txnType);
                break;
            case 'CreditAuth':
                $rvalue = HpsAuthorization::fromDict($response, $txnType);
                break;
            case 'CreditReturn':
                $rvalue = HpsRefund::fromDict($response, $txnType);
                break;
            case 'CreditReversal':
                $rvalue = HpsReversal::fromDict($response, $txnType);
                break;
            case 'CreditVoid':
                $rvalue = HpsVoid::fromDict($response, $txnType);
                break;
            case 'CreditCPCEdit':
                $rvalue = HpsCPCEdit::fromDict($response, $txnType);
                break;
            case 'CreditTxnEdit':
                $rvalue = HpsTransaction::fromDict($response, $txnType);
                break;
            case 'RecurringBilling':
                $rvalue = HpsRecurringBilling::fromDict($response, $txnType);
                break;
            case 'ManageTokens':
                $rvalue = HpsManageTokensResponse::fromDict($response);
                break;
            default:
                break;
        }

        return $rvalue;
    }
447992
protected function updatePaymentTransaction(PaymentTransaction $paymentTransaction, CallbackResponse $callbackResponse)
    {
        $paymentTransaction->setStatus($callbackResponse->getStatus());
        $paymentTransaction->getPayment()->setPaynetId($callbackResponse->getPaymentPaynetId());

        if ($callbackResponse->isError() || $callbackResponse->isDeclined())
        {
            $paymentTransaction->addError($callbackResponse->getError());
        }
    }
1117981
@Override
    public OrderableTransaction poll() {
        OrderableTransaction retval = null;
        updateQueueState();
        if (m_state == QueueState.UNBLOCKED) {
            retval = super.peek();
            super.poll();
            // not BLOCKED_EMPTY
            assert(retval != null);
        }
        return retval;
    }
748925
def commit(self, callback=None):
        ''''''
        if self.executed:
            raise InvalidTransaction('Invalid operation. '
                                     'Transaction already executed.')
        session = self.session
        self.session = None
        self.on_result = self._commit(session, callback)
        return self.on_result
415411
@Override
    public Transaction makeTransaction(byte[] payloadBytes, int offset, int length, byte[] hashFromHeader)
            throws ProtocolException {
        return new Transaction(params, payloadBytes, offset, null, this, length, hashFromHeader);
    }
244712
def request_payment(options = {})
      response = JSON.parse(@client.patch("items/#{send(:id)}/request_payment", options).body)
      @attributes = response['items']
      true
    end
1259367
def add_transaction(self,
                        block_header: BlockHeader,
                        index_key: int,
                        transaction: 'BaseTransaction') -> Hash32:
        
        transaction_db = HexaryTrie(self.db, root_hash=block_header.transaction_root)
        transaction_db[index_key] = rlp.encode(transaction)
        return transaction_db.root_hash
203725
public <T> T withTransaction(@NotNull TransactionCallback<T> callback) {
        return withTransaction(Propagation.REQUIRED, Isolation.DEFAULT, callback);
    }
220067
function createPayment(data, callback) {
    var client = new this.clients.Payments();
    client.create(data, callback);
  }
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
1206713
def receive_response(self, transaction):
        
        host, port = transaction.response.source
        key_token = hash(str(host) + str(port) + str(transaction.response.token))
        if key_token in self._relations and transaction.response.type == defines.Types["CON"]:
            transaction.notification = True
        return transaction
561410
private TransactionStatus computeNewTransactionStatusFromPaymentTransactionInfoPlugin(final PaymentTransactionInfoPlugin input, final TransactionStatus currentTransactionStatus) {
        final TransactionStatus newTransactionStatus = PaymentTransactionInfoPluginConverter.toTransactionStatus(input);
        return (newTransactionStatus != TransactionStatus.UNKNOWN) ? newTransactionStatus : currentTransactionStatus;
    }