Exemplo n.º 1
0
def post_transaction():
    from transient.services.transactions import create_transaction
    try:
        transaction = create_transaction(**request.json)
        session.add(transaction)
        session.commit()
    except Exception, e:
        session.rollback()
        return jsonify({
            'success': False
        })
Exemplo n.º 2
0
def post_payment():
    from transient.services.payments import create_payment
    try:
        payment = create_payment(**request.json)
        session.add(payment)
        session.commit()
    except:
        session.rollback()
        return jsonify({
            'success': False
        })
    else:
        return jsonify({
            'success': True,
            'payment': payment.to_dict()
        })
    finally:
        session.remove()
Exemplo n.º 3
0
 def tearDown(self):
     Transaction.query.delete()
     Withdrawal.query.delete()
     Payment.query.delete()
     session.commit()
     session.remove()
Exemplo n.º 4
0
 def tearDown(self):
     Transaction.query.delete()
     Withdrawal.query.delete()
     Payment.query.delete()
     session.commit()
     session.remove()