コード例 #1
0
def test_check_transaction_rejected_by_eway(eway_gw, transactional_db):
    transaction = Transaction.objects.create(
        access_code='valid-access-code', order_number='12345678')
    RequestLog.objects.create(transaction=transaction, response_code='99')
    assert is_transaction_suspicious(transaction) is False
コード例 #2
0
def test_check_transaction_without_valid_order(eway_gw, transactional_db):
    transaction = Transaction.objects.create(
        access_code='valid-access-code', order_number='12345678')
    RequestLog.objects.create(transaction=transaction, response_code='00')
    assert is_transaction_suspicious(transaction) is True
コード例 #3
0
def test_check_transaction_without_order_number(eway_gw, transactional_db):
    transaction = Transaction(
        access_code='valid-access-code', order_number='')
    assert is_transaction_suspicious(transaction) is False
コード例 #4
0
def test_check_transaction_with_valid_order(eway_gw, transactional_db):
    order = create_order()
    transaction = Transaction.objects.create(
        access_code='valid-access-code', order_number=order.number)
    RequestLog.objects.create(transaction=transaction, response_code='00')
    assert is_transaction_suspicious(transaction) is False
コード例 #5
0
def test_check_transaction_without_access_code(transactional_db):
    transaction = Transaction(access_code='')
    assert is_transaction_suspicious(transaction) is True