예제 #1
0
def get_user_by_login(login):
    print '@@calling fuser', login
    profile_id_client = futils.get_client('user', 'getProfileId')
    profile_id = profile_id_client.service.getProfileId(login)

    profile_client = futils.get_client('user', 'getProfile')
    profile_xml = profile_client.service.getProfile(profile_id)

    xml = etree.fromstring(profile_xml)
    ns = {
        'user': '******',
        'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
        'enc': 'http://schemas.xmlsoap.org/soap/encoding/',
    }
    first_name = futils.xpath_s(xml, ns, '/user:user/user:user.firstName', '')
    last_name = futils.xpath_s(xml, ns, '/user:user/user:user.lastName', '')
    mobile = futils.xpath_s(xml, ns, '/user:user/user:user.mobileNumber', '')
    email = futils.xpath_s(xml, ns, '/user:user/user:user.email', '')
    print profile_id, first_name, last_name, mobile, email
    return profile_id
예제 #2
0
def add_shipping_address_to_order(order_id, address):
    shipping_address_client = futils.get_client('commerce','addShippingAddressToOrder')
    contact_info = shipping_address_client.factory.create('ns4:ContactInfo')
    contact_info.state = address['state']
    contact_info.phoneNumber = address['phoneNumber']
    contact_info.postalCode = address['postalCode']
    contact_info.country = address['country']
    contact_info.city = address['city']
    contact_info.address1 = address['address1']
    shipping_group_id = shipping_address_client.service.addShippingAddressToOrder(order_id,contact_info)
    print 'shipping address added', shipping_group_id
예제 #3
0
def get_user_by_login(login):
    print '@@calling fuser', login
    profile_id_client = futils.get_client('user', 'getProfileId')
    profile_id = profile_id_client.service.getProfileId(login)

    profile_client = futils.get_client('user', 'getProfile')
    profile_xml = profile_client.service.getProfile(profile_id)

    xml = etree.fromstring(profile_xml)
    ns = {
            'user': '******',
            'xsi': 'http://www.w3.org/2001/XMLSchema-instance',
            'enc': 'http://schemas.xmlsoap.org/soap/encoding/',
            }
    first_name = futils.xpath_s(xml, ns, '/user:user/user:user.firstName', '')
    last_name = futils.xpath_s(xml, ns, '/user:user/user:user.lastName', '')
    mobile = futils.xpath_s(xml, ns, '/user:user/user:user.mobileNumber', '')
    email = futils.xpath_s(xml, ns, '/user:user/user:user.email', '')
    print profile_id, first_name, last_name, mobile, email
    return profile_id
예제 #4
0
파일: orders.py 프로젝트: daasara/riba
def add_shipping_address_to_order(order_id, address):
    shipping_address_client = futils.get_client('commerce',
                                                'addShippingAddressToOrder')
    contact_info = shipping_address_client.factory.create('ns4:ContactInfo')
    contact_info.state = address['state']
    contact_info.phoneNumber = address['phoneNumber']
    contact_info.postalCode = address['postalCode']
    contact_info.country = address['country']
    contact_info.city = address['city']
    contact_info.address1 = address['address1']
    shipping_group_id = shipping_address_client.service.addShippingAddressToOrder(
        order_id, contact_info)
    print 'shipping address added', shipping_group_id
예제 #5
0
def default_payment_group_id_for_order(order_id):
    payment_group_client = futils.get_client('commerce', 'getDefaultPaymentGroupId')
    pg_id = payment_group_client.service.getDefaultPaymentGroupId(order_id)
    print pg_id
예제 #6
0
def get_order_by_id(order_id):
    get_order_client = futils.get_client('commerce','getOrderAsXML')
    xml = get_order_client.service.getOrderAsXML(order_id)
    print xml
예제 #7
0
def add_item_to_order(product_id, sku_id, qty=1, order_id=None):
    add_item_to_order_client = futils.get_client('commerce','addItemToOrder')
    item_id = add_item_to_order_client.service.addItemToOrder(order_id, product_id, sku_id, qty)
    print 'item added', item_id
예제 #8
0
def create_order_for_user(profile_id):
    create_order_client = futils.get_client('commerce','createOrderForUser')
    order_id = create_order_client.service.createOrderForUser(
            None,profile_id)
    return order_id
예제 #9
0
def get_order_by_user(profile_id):
    get_order_client = futils.get_client('commerce','getCurrentOrderId')
    order_id = get_order_client.service.getCurrentOrderId()
    return order_id
예제 #10
0
파일: orders.py 프로젝트: daasara/riba
def default_payment_group_id_for_order(order_id):
    payment_group_client = futils.get_client('commerce',
                                             'getDefaultPaymentGroupId')
    pg_id = payment_group_client.service.getDefaultPaymentGroupId(order_id)
    print pg_id
예제 #11
0
파일: orders.py 프로젝트: daasara/riba
def get_order_by_id(order_id):
    get_order_client = futils.get_client('commerce', 'getOrderAsXML')
    xml = get_order_client.service.getOrderAsXML(order_id)
    print xml
예제 #12
0
파일: orders.py 프로젝트: daasara/riba
def add_item_to_order(product_id, sku_id, qty=1, order_id=None):
    add_item_to_order_client = futils.get_client('commerce', 'addItemToOrder')
    item_id = add_item_to_order_client.service.addItemToOrder(
        order_id, product_id, sku_id, qty)
    print 'item added', item_id
예제 #13
0
파일: orders.py 프로젝트: daasara/riba
def create_order_for_user(profile_id):
    create_order_client = futils.get_client('commerce', 'createOrderForUser')
    order_id = create_order_client.service.createOrderForUser(None, profile_id)
    return order_id
예제 #14
0
파일: orders.py 프로젝트: daasara/riba
def get_order_by_user(profile_id):
    get_order_client = futils.get_client('commerce', 'getCurrentOrderId')
    order_id = get_order_client.service.getCurrentOrderId()
    return order_id
예제 #15
0
파일: orders.py 프로젝트: daasara/riba
def get_order_status(order_id):
    get_order_status_client = futils.get_client('commerce', 'getOrderStatus')
    obj = get_order_status_client.service.getOrderStatus(order_id)
    print obj
예제 #16
0
def default_shipping_group_id_for_order(order_id):
    shipping_group_client = futils.get_client('commerce', 'getDefaultShippingGroupId')
    shipping_group_id = shipping_group_client.service.getDefaultShippingGroupId(order_id)
    print shipping_group_id
예제 #17
0
def get_order_status(order_id):
    get_order_status_client = futils.get_client('commerce','getOrderStatus')
    obj = get_order_status_client.service.getOrderStatus(order_id)
    print obj
예제 #18
0
파일: orders.py 프로젝트: daasara/riba
def default_shipping_group_id_for_order(order_id):
    shipping_group_client = futils.get_client('commerce',
                                              'getDefaultShippingGroupId')
    shipping_group_id = shipping_group_client.service.getDefaultShippingGroupId(
        order_id)
    print shipping_group_id