Ejemplo n.º 1
0
 def get(payment_identifier, transaction_identifier):
     """Get the Transaction record."""
     current_app.logger.info(
         f'<Transaction.get for payment : {payment_identifier}, and transaction {transaction_identifier}')
     try:
         response, status = TransactionService.find_by_id(payment_identifier,
                                                          transaction_identifier).asdict(), HTTPStatus.OK
     except BusinessException as exception:
         response, status = {'code': exception.code, 'message': exception.message}, exception.status
     current_app.logger.debug('>Transaction.get')
     return jsonify(response), status
Ejemplo n.º 2
0
 def get(payment_id, transaction_id):
     """Get the Transaction record."""
     current_app.logger.info(
         f'<Transaction.get for payment : {payment_id}, and transaction {transaction_id}'
     )
     try:
         response, status = TransactionService.find_by_id(
             payment_id, transaction_id).asdict(), HTTPStatus.OK
     except BusinessException as exception:
         return exception.response()
     current_app.logger.debug('>Transaction.get')
     return jsonify(response), status
Ejemplo n.º 3
0
    def get(invoice_id: int = None,
            payment_id: int = None,
            transaction_id=None):
        """Get the Transaction record."""
        current_app.logger.info(
            '<Transaction.get for invoice : %s, payment : %s, transaction %s',
            invoice_id, payment_id, transaction_id)
        try:
            response, status = TransactionService.find_by_id(
                transaction_id).asdict(), HTTPStatus.OK

        except BusinessException as exception:
            return exception.response()
        current_app.logger.debug('>Transaction.get')
        return jsonify(response), status