class coupon_gift_adjustment_t(gxml.Node): code = gxml.String('code') calculated_amount = gxml.Complex('calculated-amount', price_t, required=False) applied_amount = gxml.Complex('applied-amount', price_t) message = gxml.String('message', required=False)
class authorization_amount_notification_t(abstract_notification_t): tag_name = 'authorization-amount-notification' authorization_amount = gxml.Complex('authorization-amount', price_t) authorization_expiration_date = gxml.Timestamp( 'authorization-expiration-date') avs_response = gxml.String('avs-response', values=AVS_VALUES) cvn_response = gxml.String('cvn-response', values=CVN_VALUES)
class error_t(gxml.Document): """ Represents a response containing information about an invalid API request. The information is intended to help you debug the problem causing the error. >>> test_document( ... error_t(serial_number = '3c394432-8270-411b-9239-98c2c499f87f', ... error_message='Bad username and/or password for API Access.', ... warning_messages = ['IP address is suspicious.', ... 'MAC address is shadowed.'] ... ) ... , ... ''' ... <error xmlns="http://checkout.google.com/schema/2" serial-number="3c394432-8270-411b-9239-98c2c499f87f"> ... <error-message>Bad username and/or password for API Access.</error-message> ... <warning-messages> ... <string>IP address is suspicious.</string> ... <string>MAC address is shadowed.</string> ... </warning-messages> ... </error> ... ''' ... ) """ tag_name = 'error' serial_number = gxml.ID('@serial-number') error_message = gxml.String('error-message') warning_messages = gxml.List('warning-messages', gxml.String('string'), required=False)
class risk_information_t(gxml.Node): avs_response = gxml.String('avs-response', values=AVS_VALUES) billing_address = gxml.Complex('billing-address', billing_address_t) buyer_account_age = gxml.Integer('buyer-account-age') cvn_response = gxml.String('cvn-response', values=CVN_VALUES) eligible_for_protection = gxml.Boolean('eligible-for-protection') ip_address = gxml.IP('ip-address') partial_cc_number = gxml.String('partial-cc-number') # partial CC Number
class digital_content_t(gxml.Node): description = gxml.Html('description', max_length=1024, required=False) email_delivery = gxml.Boolean('email-delivery', required=False) key = gxml.String('key', required=False) url = gxml.String('url', required=False) display_disposition = gxml.String('display-disposition', required=False, values=DISPLAY_DISPOSITION)
class result_t(gxml.Node): shipping_name = gxml.String('@shipping-name') address_id = gxml.String('@address-id') total_tax = gxml.Complex('total-tax', price_t, required=False) shipping_rate = gxml.Complex('shipping-rate', price_t, required=False) shippable = gxml.Boolean('shippable', required=False) merchant_code_results = gxml.Complex('merchant-code-results', merchant_code_results_t, required=False)
class tax_area_t(gxml.Node): world_area = PresentOrNot('world-area', required=False) postal_area = gxml.Complex('postal-area', postal_area_t, required=False) us_state = gxml.String('us-state-area/state', required=False) us_zip_pattern = gxml.String( 'us-zip-area/zip-pattern', required=False) # regex: [a-zA-Z0-9_]+\*? Note the optional asterisk us_country_area = gxml.String( 'us-country-area/country-area', values=('CONTINENTAL_48', 'FULL_50_STATES', 'ALL'), required=False) # enum('CONTINENTAL_48', 'FULL_50_STATES', 'ALL')
class order_state_change_notification_t(abstract_notification_t): tag_name = 'order-state-change-notification' new_fulfillment_order_state = gxml.String('new-fulfillment-order-state', values=FINANCIAL_ORDER_STATE) new_financial_order_state = gxml.String('new-financial-order-state', values=FULFILLMENT_ORDER_STATE) previous_financial_order_state = gxml.String( 'previous-financial-order-state', values=FINANCIAL_ORDER_STATE) previous_fulfillment_order_state = gxml.String( 'previous-fulfillment-order-state', values=FULFILLMENT_ORDER_STATE) reason = gxml.String('reason', required=False)
class carrier_calculated_shipping_option_t(gxml.Node): price = gxml.Complex('price', price_t) shipping_company = gxml.String('shipping-company', values=('FedEx', 'UPS', 'USPS')) carrier_pickup = gxml.String('carrier-pickup', values=('REGULAR_PICKUP', 'SPECIAL_PICKUP', 'DROP_OFF'), default='DROP_OFF', required=False) shipping_type = gxml.String('shipping-type') additional_fixed_charge = gxml.Complex('additional-fixed-charge', price_t, required=False) additional_variable_charge_percent = gxml.Double( 'additional-variable-charge-percent', required=False)
class shipping_package_t(gxml.Node): delivery_address_category = gxml.String('delivery-address-category', values=('RESIDENTIAL', 'COMMERCIAL'), required=False) height = gxml.Complex('height', measure_t) length = gxml.Complex('length', measure_t) ship_from = gxml.Complex('ship-from', ship_from_t) width = gxml.Complex('width', measure_t)
class postal_area_t(gxml.Node): """ >>> test_node(postal_area_t(country_code = 'VU'), ... ''' ... <node><country-code>VU</country-code></node> ... ''' ... ) """ country_code = CountryCode('country-code') postal_code_pattern = gxml.String('postal-code-pattern', required=False)
class new_order_notification_t(abstract_notification_t): tag_name = 'new-order-notification' buyer_billing_address = gxml.Complex('buyer-billing-address', buyer_billing_address_t) buyer_id = gxml.Long('buyer-id') buyer_marketing_preferences = gxml.Complex('buyer-marketing-preferences', buyer_marketing_preferences_t) buyer_shipping_address = gxml.Complex('buyer-shipping-address', buyer_shipping_address_t) financial_order_state = gxml.String('financial-order-state', values=FINANCIAL_ORDER_STATE) fulfillment_order_state = gxml.String('fulfillment-order-state', values=FULFILLMENT_ORDER_STATE) order_adjustment = gxml.Complex('order-adjustment', order_adjustment_t) order_total = gxml.Complex('order-total', price_t) shopping_cart = gxml.Complex('shopping-cart', shopping_cart_t) promotions = gxml.List('promotions', gxml.Complex('promotion', promotion_t), required=False)
class item_t(gxml.Node): """ >>> test_node(item_t(name='Peter', description='The Great', unit_price=price_t(value=1, currency='GBP'), quantity=1, merchant_item_id='custom_merchant_item_id', ... merchant_private_item_data=['some', {'private':'data', 'to':['test','the'],'thing':None}, '!! Numbers: ', None, False, True, [11, 12., [13.4]]]) ... ) >>> test_node(item_t(name='Name with empty description', description='', unit_price=price_t(value=1, currency='GBP'), quantity=1)) """ name = gxml.String('item-name') description = gxml.String('item-description') unit_price = gxml.Complex('unit-price', price_t) quantity = gxml.Decimal('quantity') item_weight = gxml.Complex('item-weight', item_weight_t, required=False) merchant_item_id = gxml.String('merchant-item-id', required=False) tax_table_selector = gxml.String('tax-table-selector', required=False) digital_content = gxml.Complex('digital-content', digital_content_t, required=False) merchant_private_item_data = gxml.Any('merchant-private-item-data', save_node_and_xml=True, required=False)
class demo_failure_t(gxml.Document): """ >>> test_document( ... demo_failure_t(message='Demo Failure Message') ... , ... '''<demo-failure xmlns="http://checkout.google.com/schema/2" ... message="Demo Failure Message" />''' ... ) """ tag_name = 'demo-failure' message = gxml.String('@message', max_length=25)
class cancel_order_t(abstract_order_t): """ Represents an order that should be canceled. A <cancel-order> command sets the financial-order-state and the fulfillment-order-state to canceled. >>> test_document( ... cancel_order_t(google_order_number = "841171949013218", ... comment = 'Buyer found a better deal.', ... reason = 'Buyer cancelled the order.' ... ) ... , ... ''' ... <cancel-order xmlns="http://checkout.google.com/schema/2" google-order-number="841171949013218"> ... <comment>Buyer found a better deal.</comment> ... <reason>Buyer cancelled the order.</reason> ... </cancel-order> ... ''' ... ) """ tag_name = 'cancel-order' comment = gxml.String('comment', max_length=140, required=False) reason = gxml.String('reason', max_length=140)
class diagnosis_t(gxml.Document): """ Represents a diagnostic response to an API request. The diagnostic response contains the parsed XML in your request as well as any warnings generated by your request. Please see the U{Validating XML Messages to Google Checkout <http://code.google.com/apis/checkout/developer/index.html#validating_xml_messages>} section for more information about diagnostic requests and responses. """ tag_name = 'diagnosis' input_xml = gxml.Any('input-xml') warnings = gxml.List('warnings', gxml.String('string'), required=False) serial_number = gxml.ID('@serial-number')
class areas_t(gxml.Node): """ Represents a list of regions. >>> test_node( ... areas_t( ... states = ['LA', 'NY'], ... country_areas = ['ALL', 'CONTINENTAL_48'] ... ) ... , ... ''' ... <node> ... <us-state-area> ... <state>LA</state> ... </us-state-area> ... <us-state-area> ... <state>NY</state> ... </us-state-area> ... <us-country-area> ... <country-area>ALL</country-area> ... </us-country-area> ... <us-country-area> ... <country-area>CONTINENTAL_48</country-area> ... </us-country-area> ... </node> ... ''' ... ) """ states = gxml.List('', gxml.String('us-state-area/state'), required=False) zip_patterns = gxml.List( '', gxml.String('us-zip-area/zip-pattern'), required=False) # regex: [a-zA-Z0-9_]+\*? Note the optional asterisk country_areas = gxml.List( '', gxml.String('us-country-area/country-area'), values=('CONTINENTAL_48', 'FULL_50_STATES', 'ALL'), required=False) # enum('CONTINENTAL_48', 'FULL_50_STATES', 'ALL')
class shipping_in_order_adjustment_t(gxml.Node): carrier_calculated_shipping_adjustment = gxml.Complex( 'carrier-calculated-shipping-adjustment', carrier_calculated_shipping_adjustment_t, required=False) flat_rate_shipping_adjustment = gxml.Complex( 'flat-rate-shipping-adjustment', shipping_adjustment_t, required=False) merchant_calculated_shipping_adjustment = gxml.Complex( 'merchant-calculated-shipping-adjustment', shipping_adjustment_t, required=False) pickup_shipping_adjustment = gxml.Complex('pickup-shipping-adjustment', shipping_adjustment_t, required=False) methods = gxml.List('', gxml.String('method/@name'))
class address_t(gxml.Node): address1 = gxml.String('address1') address2 = gxml.String('address2', required=False) city = gxml.String('city') company_name = gxml.String('company-name', required=False) contact_name = gxml.String('contact-name', required=False) country_code = gxml.String('country-code') email = gxml.Email('email', required=False) fax = gxml.Phone('fax', required=False, empty=True) phone = gxml.Phone('phone', required=False, empty=True) postal_code = gxml.Zip('postal-code') region = gxml.String('region', empty=True) structured_name = gxml.Complex('structured-name', structured_name_t, required=False)
class shipping_option_t(gxml.Node): """ Represents information about shipping costs. >>> test_node( ... shipping_option_t( ... name = 'Testing', ... price = price_t( ... currency = 'GBP', ... value = 9.99, ... ), ... allowed_areas = allowed_areas_t( ... world_area = True, ... ), ... excluded_areas = excluded_areas_t( ... postal_areas = [postal_area_t( ... country_code = 'US', ... )], ... ), ... ) ... , ''' ... <node name='Testing'> ... <price currency='GBP'>9.990</price> ... <shipping-restrictions> ... <allowed-areas> ... <world-area/> ... </allowed-areas> ... <excluded-areas> ... <postal-area> ... <country-code>US</country-code> ... </postal-area> ... </excluded-areas> ... </shipping-restrictions> ... </node> ... ''') """ name = gxml.String('@name') # Attribute, len <= 255, not-empty price = gxml.Complex('price', price_t) allowed_areas = gxml.Complex('shipping-restrictions/allowed-areas', allowed_areas_t, required=False) excluded_areas = gxml.Complex('shipping-restrictions/excluded-areas', excluded_areas_t, required=False)
class item_weight_t(gxml.Node): value = gxml.Double('@value') # , negative=False unit = gxml.String('@unit', values=('LB', ))
class discount_result_t(gxml.Node): valid = gxml.Boolean('valid') calculated_amount = gxml.Complex('calculated-amount', price_t) code = gxml.String('code') message = gxml.String('message', max_length=255)
class merchant_code_string_t(gxml.Node): code = gxml.String('@code')
class anonymous_address_t(gxml.Node): id = gxml.String('@id') city = gxml.String('city') region = gxml.String('region', empty=True) postal_code = gxml.Zip('postal-code') country_code = gxml.String('country-code')
class send_buyer_message_t(abstract_order_t): tag_name = 'send-buyer-message' send_email = gxml.Boolean('send-email', required=False) message = gxml.String('message')
class tracking_data_t(gxml.Node): carrier = gxml.String('carrier', values=CARRIER_VALUES) tracking_number = gxml.String('tracking-number')
class price_t(gxml.Node): value = gxml.Double('', default=0) currency = gxml.String('@currency', values=CURRENCIES)
class add_merchant_order_number_t(abstract_order_t): tag_name = 'add-merchant-order-number' merchant_order_number = gxml.String('merchant-order-number')
class refund_order_t(abstract_order_t): tag_name = 'refund-order' amount = gxml.Complex('amount', price_t, required=False) comment = gxml.String('comment', max_length=140, required=False) reason = gxml.String('reason', max_length=140)
class promotion_t(gxml.Node): description = gxml.String('description', required=False, max_length=1024) id = gxml.Long('id') name = gxml.String('name') total_amount = gxml.Complex('total-amount', price_t)