Ejemplo n.º 1
0
def section_g():
    """
    Customer Profiles
    """
    results = collections.OrderedDict()
    results['section'] = 'g'

    profile = Profile(name="Alice Testerson",
                      address1="100 N Broad St.",
                      address2="",
                      city="Philadelphia",
                      zip_code="19107",
                      email="*****@*****.**",
                      cc_num="4788250000028291",
                      cc_expiry="1116")
    results['1a'] = result = profile.create()
    customer_num = result['CustomerRefNum']
    profile = Profile(ident=customer_num, cc_num="371449635398431")
    results['1b'] = profile.update()
    profile = Profile(ident=customer_num)
    results['1c'] = profile.read()
    order = Order(message_type='AC',
                  order_id='711',
                  customer_num=customer_num,
                  amount='45.00')
    results['1d'] = order.charge()
    order_id = order.order_id
    order = Order(message_type='R',
                  customer_num=customer_num,
                  order_id=order_id,
                  amount='45.00')
    results['1e'] = order.charge()
    profile = Profile(ident=customer_num)
    results['1f'] = profile.destroy()

    profile = Profile(name="Bob Testerson",
                      zip_code="19107",
                      cc_num="5454545454545454",
                      cc_expiry="1116")
    results['2a'] = result = profile.create()
    customer_num = result['CustomerRefNum']
    profile = Profile(ident=customer_num,
                      cc_num="6011000995500000",
                      address1="200 N Broad St",
                      address2="",
                      city="Philadelphia",
                      phone="12156862840")
    results['2b'] = profile.update()
    order = Order(message_type="A",
                  order_id="721",
                  customer_num=customer_num,
                  address1="2200 Market St",
                  address2="Apt 4",
                  zip_code="19103",
                  amount="25.00")
    results['2c'] = result = order.charge()
    tx_ref_num = result['TxRefNum']
    tx_ref_idx = result['TxRefIdx']
    reversal = Reversal(tx_ref_num=tx_ref_num,
                        tx_ref_idx='0',
                        amount="25.00",
                        order_id=order.order_id)
    results['2d'] = reversal.void()
    profile = Profile(ident=customer_num)
    results['2e'] = profile.destroy()

    order = Order(message_type="A",
                  order_id="751",
                  new_customer=True,
                  name="George Exampleton",
                  address1="500 Market St",
                  zip_code="19103",
                  cc_num="6011000995500000",
                  cc_expiry="1116",
                  amount="65.00")
    results['5a'] = result = order.charge()
    customer_num = result['CustomerRefNum']
    order = Order(message_type="A",
                  order_id="752",
                  customer_num=customer_num,
                  amount="65.00")
    results['5b'] = result = order.charge()
    tx_ref_num = result['TxRefNum']
    tx_ref_idx = result['TxRefIdx']
    reversal = Reversal(tx_ref_num=tx_ref_num,
                        tx_ref_idx='0',
                        order_id=order.order_id)
    results['5c'] = reversal.void()

    order = Order(message_type="AC",
                  order_id="761",
                  new_customer=True,
                  name="Wimla Exampleton",
                  address1="600 Market St",
                  zip_code="19103",
                  cc_num="5454545454545454",
                  cc_expiry="1116",
                  amount="40.00")
    results['7a'] = result = order.charge()
    customer_num = result['CustomerRefNum']
    order = Order(message_type="AC",
                  order_id="762",
                  customer_num=customer_num,
                  amount="40.00")
    results['7b'] = order.charge()
    order = Order(message_type="R",
                  order_id="762",
                  customer_num=customer_num,
                  amount="40.00")
    results['7c'] = order.charge()

    return results
Ejemplo n.º 2
0
def section_g():
    """
    Customer Profiles
    """
    results = collections.OrderedDict()
    results['section'] = 'g'

    profile = Profile(name="Alice Testerson",
                      address1="100 N Broad St.",
                      address2="",
                      city="Philadelphia",
                      zip_code="19107",
                      email="*****@*****.**",
                      cc_num="4788250000028291",
                      cc_expiry="1116")
    results['1a'] = result = profile.create()
    customer_num = result['CustomerRefNum']
    profile = Profile(ident=customer_num,
                      cc_num = "371449635398431")
    results['1b'] = profile.update()
    profile = Profile(ident=customer_num)
    results['1c'] = profile.read()
    order = Order(message_type='AC',
                  order_id='711',
                  customer_num=customer_num,
                  amount='45.00')
    results['1d'] = order.charge()
    order_id = order.order_id
    order = Order(message_type='R',
                  customer_num=customer_num,
                  order_id=order_id,
                  amount='45.00')
    results['1e'] = order.charge()
    profile = Profile(ident=customer_num)
    results['1f'] = profile.destroy()

    profile = Profile(name="Bob Testerson",
                      zip_code="19107",
                      cc_num="5454545454545454",
                      cc_expiry="1116")
    results['2a'] = result = profile.create()
    customer_num = result['CustomerRefNum']
    profile = Profile(ident=customer_num,
                      cc_num="6011000995500000",
                      address1="200 N Broad St",
                      address2="",
                      city="Philadelphia",
                      phone="12156862840")
    results['2b'] = profile.update()
    order = Order(message_type="A",
                  order_id="721",
                  customer_num=customer_num,
                  address1="2200 Market St",
                  address2="Apt 4",
                  zip_code="19103",
                  amount="25.00")
    results['2c'] = result = order.charge()
    tx_ref_num = result['TxRefNum']
    tx_ref_idx = result['TxRefIdx']
    reversal = Reversal(tx_ref_num=tx_ref_num,
                        tx_ref_idx='0',
                        amount="25.00",
                        order_id=order.order_id)
    results['2d'] = reversal.void()
    profile = Profile(ident=customer_num)
    results['2e'] = profile.destroy()

    order = Order(message_type="A",
                  order_id="751",
                  new_customer=True,
                  name="George Exampleton",
                  address1="500 Market St",
                  zip_code="19103",
                  cc_num="6011000995500000",
                  cc_expiry="1116",
                  amount="65.00")
    results['5a'] = result = order.charge()
    customer_num = result['CustomerRefNum']
    order = Order(message_type="A",
                  order_id="752",
                  customer_num=customer_num,
                  amount="65.00")
    results['5b'] = result = order.charge()
    tx_ref_num = result['TxRefNum']
    tx_ref_idx = result['TxRefIdx']
    reversal = Reversal(tx_ref_num=tx_ref_num,
                        tx_ref_idx='0',
                        order_id=order.order_id)
    results['5c'] = reversal.void()

    order = Order(message_type="AC",
                  order_id="761",
                  new_customer=True,
                  name="Wimla Exampleton",
                  address1="600 Market St",
                  zip_code="19103",
                  cc_num="5454545454545454",
                  cc_expiry="1116",
                  amount="40.00")
    results['7a'] = result = order.charge()
    customer_num = result['CustomerRefNum']
    order = Order(message_type="AC",
                  order_id="762",
                  customer_num=customer_num,
                  amount="40.00")
    results['7b'] = order.charge()
    order = Order(message_type="R",
                  order_id="762",
                  customer_num=customer_num,
                  amount="40.00")
    results['7c'] = order.charge()

    return results