예제 #1
0
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)
예제 #2
0
class merchant_calculation_callback_t(gxml.Document):
    tag_name = 'merchant-calculation-callback'
    serial_number = gxml.ID('@serial-number')
    buyer_id = gxml.Long('buyer-id', required=False)
    buyer_language = gxml.LanguageCode('buyer-language')
    calculate = gxml.Complex('calculate', calculate_t)
    shopping_cart = gxml.Complex('shopping-cart', shopping_cart_t)
예제 #3
0
class checkout_redirect_t(gxml.Document):
    """
    Try doctests:
    >>> a = checkout_redirect_t(serial_number='blabla12345',
    ...                         redirect_url='http://www.somewhere.com')
    >>> b = gxml.Document.fromxml(a.toxml())
    >>> a == b
    True
    """
    tag_name = 'checkout-redirect'
    serial_number = gxml.ID('@serial-number')
    redirect_url = gxml.Url('redirect-url')
예제 #4
0
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')
예제 #5
0
class bye_t(gxml.Document):
    """
    Represents a response that indicates that Google correctly received
    a <hello> request.

    >>> test_document(
    ...     bye_t(serial_number="7315dacf-3a2e-80d5-aa36-8345cb54c143")
    ... ,
    ...     '''
    ...     <bye xmlns="http://checkout.google.com/schema/2"
    ...           serial-number="7315dacf-3a2e-80d5-aa36-8345cb54c143" />
    ...     '''
    ... )
    """
    tag_name = 'bye'
    serial_number = gxml.ID('@serial-number')
예제 #6
0
class abstract_order_t(gxml.Document):
    tag_name = '-order'
    google_order_number = gxml.ID('@google-order-number')
예제 #7
0
class notification_acknowledgment_t(gxml.Document):
    tag_name = 'notification-acknowledgment'
    serial_number = gxml.ID('@serial-number')
예제 #8
0
class abstract_notification_t(gxml.Document):
    tag_name = '-notification'
    serial_number = gxml.ID('@serial-number')
    google_order_number = gxml.ID('google-order-number')
    timestamp = gxml.Timestamp('timestamp')
예제 #9
0
class request_received_t(gxml.Document):
    tag_name = 'request-received'
    serial_number = gxml.ID('@serial-number')