示例#1
0
def test_base_card_bridge_provided_card_details():
    transaction = bridge_oscar.BaseCardTransactionBridge('1',
                                                         card=MockCreditCard())

    assert 'cc_name' in transaction.transaction_details
    assert 'cc_number' in transaction.transaction_details
    assert 'cc_expiry' in transaction.transaction_details
    assert 'cc_cvv' in transaction.transaction_details
示例#2
0
def test_base_card_bridge_formats_details_without_billing_address():
    transaction = bridge_oscar.BaseCardTransactionBridge('1',
                                                         card=MockCreditCard())

    assert len(transaction.transaction_details) == 5
    assert 'amount' in transaction.transaction_details
    assert transaction.transaction_details['amount'] == '1'
    assert 'cc_name' in transaction.transaction_details
    assert 'cc_number' in transaction.transaction_details
    assert 'cc_expiry' in transaction.transaction_details
    assert 'cc_cvv' in transaction.transaction_details
示例#3
0
def test_base_card_bridge_formats_details():
    transaction = bridge_oscar.BaseCardTransactionBridge(
        '1', card=MockCreditCard(), billing_address={'first_name': '3'})

    assert 'amount' in transaction.transaction_details
    assert transaction.transaction_details['amount'] == '1'
    assert 'cc_name' in transaction.transaction_details
    assert 'cc_number' in transaction.transaction_details
    assert 'cc_expiry' in transaction.transaction_details
    assert 'cc_cvv' in transaction.transaction_details
    assert 'billing_contact_name' in transaction.transaction_details
    assert transaction.transaction_details['billing_contact_name'] == '3'
    assert 'billing_street_1' in transaction.transaction_details
    assert 'billing_street_2' in transaction.transaction_details
    assert 'billing_city' in transaction.transaction_details
    assert 'billing_province' in transaction.transaction_details
    assert 'billing_postal_code' in transaction.transaction_details
    assert 'billing_country' in transaction.transaction_details
    assert 'billing_phone' in transaction.transaction_details
示例#4
0
def test_base_card_bridge_provided_token_details_and_customer_code():
    transaction = bridge_oscar.BaseCardTransactionBridge('1',
                                                         token_id='2',
                                                         customer_code='3')
    assert transaction.transaction_details['token_id'] == '2'
    assert transaction.transaction_details['customer_code'] == '3'
示例#5
0
def test_base_card_bridge_provided_token_details_and_django_user():
    transaction = bridge_oscar.BaseCardTransactionBridge('1',
                                                         token_id='2',
                                                         django_user='******')
    assert transaction.transaction_details['token_id'] == '2'
    assert transaction.transaction_details['django_user'] == '3'