Beispiel #1
0
def test_find_all_postbacks(retry):
    _transaction = transaction.create(transaction_dictionary.BOLETO_TRANSACTION)
    transaction.pay_boleto(_transaction['id'], transaction_dictionary.PAY_BOLETO)
    search_params = {'id': _transaction['id']}
    _transaction_paid = retry(lambda: transaction.find_by(search_params))
    _postbacks = transaction.postbacks(_transaction_paid[0]['id'])
    assert _postbacks[0]['model_id'] == str(_transaction_paid[0]['id'])
Beispiel #2
0
def test_specific_postback(retry):
    _transaction = transaction.create(transaction_dictionary.BOLETO_TRANSACTION)
    transaction.pay_boleto(_transaction['id'], transaction_dictionary.PAY_BOLETO)
    search_params = {'id': _transaction['id']}
    transaction_paid = retry(lambda: transaction.find_by(search_params))
    postbacks = transaction.postbacks(transaction_paid[0]['id'])
    specific_postback = transaction.specific_postback(transaction_paid[0]['id'], postbacks[0]['id'])
    assert specific_postback['id'] == postbacks[0]['id']
Beispiel #3
0
def test_postbacks_redeliver(retry):
    _transaction = transaction.create(transaction_dictionary.BOLETO_TRANSACTION)
    transaction.pay_boleto(_transaction['id'], transaction_dictionary.PAY_BOLETO)
    search_params = {'id': _transaction['id']}
    _transaction_paid = retry(lambda: transaction.find_by(search_params))
    _postbacks = transaction.postbacks(_transaction_paid[0]['id'])
    redeliver = transaction.postback_redeliver(_transaction_paid[0]['id'], _postbacks[0]['id'])
    assert redeliver['status'] == 'pending_retry'