Package gchecky :: Module controller :: Class ControllerLevel_2
[hide private]
[frames] | no frames]

Class ControllerLevel_2

source code

       object --+    
                |    
ControllerLevel_1 --+
                    |
                   ControllerLevel_2

Instance Methods [hide private]
 
on_xml_sending(self, context)
This hook is called just before sending xml to GC.
source code
 
on_xml_sent(self, context)
This hook is called right after sending xml to GC.
source code
 
on_message_sending(self, context)
This hook is called just before sending xml to GC.
source code
 
on_message_sent(self, context)
This hook is called right after sending xml to GC.
source code
 
on_xml_receiving(self, context)
This hook is called just before processing the received xml from GC.
source code
 
on_xml_received(self, context)
This hook is called right after processing xml from GC.
source code
 
on_message_receiving(self, context)
This hook is called just before processing the received message from GC.
source code
 
on_message_received(self, context)
This hook is called right after processing message from GC.
source code
 
on_retrieve_order(self, order_id, context=None)
This hook is called from message processing code just before calling the corresponding message handler.
source code
 
handle_new_order(self, message, order_id, context, order=None)
Google sends a new order notification when a buyer places an order through Google Checkout.
source code
 
handle_order_state_change(self, message, order_id, context, order=None) source code
 
handle_authorization_amount(self, message, order_id, context, order=None) source code
 
handle_risk_information(self, message, order_id, context, order=None)
Google Checkout sends a risk information notification to provide financial information that helps you to ensure that an order is not fraudulent.
source code
 
handle_charge_amount(self, message, order_id, context, order=None) source code
 
handle_refund_amount(self, message, order_id, context, order=None) source code
 
handle_chargeback_amount(self, message, order_id, context, order=None) source code
 
handle_notification(self, message, order_id, context, order=None)
This handler is called when a message received from GC and when the more specific message handler was not found or returned None (which means it was not able to process the message).
source code
 
on_exception(self, exception, context)
By default simply rethrow the exception ignoring context.
source code
 
__call_handler(self, handler_name, context, *args, **kwargs) source code
 
_send_xml(self, msg, context, diagnose)
The helper method that submits an xml message to GC.
source code
 
send_message(self, message, context=None, diagnose=False) source code
 
__process_message_result(self, response_xml, context) source code
 
hello(self) source code
 
archive_order(self, order_id) source code
 
unarchive_order(self, order_id) source code
 
send_buyer_message(self, order_id, message) source code
 
add_merchant_order_number(self, order_id, merchant_order_number) source code
 
add_tracking_data(self, order_id, carrier, tracking_number) source code
 
charge_order(self, order_id, amount) source code
 
refund_order(self, order_id, amount, reason, comment=None) source code
 
authorize_order(self, order_id) source code
 
cancel_order(self, order_id, reason, comment=None) source code
 
process_order(self, order_id) source code
 
deliver_order(self, order_id, carrier=None, tracking_number=None, send_email=None) source code
 
receive_xml(self, input_xml, context=None) source code
 
receive_message(self, message, order_id, context) source code

Inherited from ControllerLevel_1: __init__, create_HMAC_SHA_signature, get_cart_post_button, get_checkout_button_url, get_client_donation_url, get_client_post_cart_url, get_donation_button_url, get_order_processing_url, get_server_donation_url, get_server_post_cart_url, prepare_donation, prepare_order

Inherited from ControllerLevel_1 (private): _get_url

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  __MESSAGE_HANDLERS = {<class 'gchecky.model.charge_amount_noti...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

on_xml_sending(self, context)

source code 

This hook is called just before sending xml to GC.

@param context.xml The xml message to be sent to GC. @param context.url The exact URL the message is about to be sent. @return Should return nothing, because the return value is ignored.

on_xml_sent(self, context)

source code 

This hook is called right after sending xml to GC.

@param context.xml The xml message to be sent to GC. @param context.url The exact URL the message is about to be sent. @param context.response_xml The reply xml of GC. @return Should return nothing, because the return value is ignored.

on_message_sending(self, context)

source code 

This hook is called just before sending xml to GC.

@param context.xml The xml message to be sent to GC. @param context.url The exact URL the message is about to be sent. @return Should return nothing, because the return value is ignored.

on_message_sent(self, context)

source code 

This hook is called right after sending xml to GC.

@param context.xml The message to be sent to GC (an instance of one
           of gchecky.model classes).
@param context.response_xml The reply message of GC.
@return Should return nothing, because the return value is ignored.

on_xml_receiving(self, context)

source code 

This hook is called just before processing the received xml from GC.

@param context.xml The xml message received from GC. @return Should return nothing, because the return value is ignored.

on_xml_received(self, context)

source code 

This hook is called right after processing xml from GC.

@param context.xml The xml message received from GC. @param context.response_xml The reply xml to GC. @return Should return nothing, because the return value is ignored.

on_message_receiving(self, context)

source code 

This hook is called just before processing the received message from GC.

@param context.message The message received from GC. @return Should return nothing, because the return value is ignored.

on_message_received(self, context)

source code 

This hook is called right after processing message from GC.

@param context.message The message received from GC. @param context.response_message The reply object to GC (either ok_t or error_t). @return Should return nothing, because the return value is ignored.

on_retrieve_order(self, order_id, context=None)

source code 

This hook is called from message processing code just before calling
the corresponding message handler.
The idea is to allow user code to load order in one place and then
receive the loaded object as parameter in message handler.
This method should not throw if order is not found - instead it should
return None.

@param order_id The google order number corresponding to the message
        received.
@return The order object that will be passed to message handlers.

handle_new_order(self, message, order_id, context, order=None)

source code 
Google sends a new order notification when a buyer places an order through Google Checkout. Before shipping the items in an order, you should wait until you have also received the risk information notification for that order as well as the order state change notification informing you that the order's financial state has been updated to 'CHARGEABLE'.

handle_notification(self, message, order_id, context, order=None)

source code 

This handler is called when a message received from GC and when the more
specific message handler was not found or returned None (which means
it was not able to process the message).

@param message The message from GC to be processed.
@param order_id The google order number for which message is sent.
@param order The object loaded by on_retrieve_order(order_id) or None.
@return If message was processed successfully then return gmodel.ok_t().
        If an error occured when proessing, then the method should
        return any other value (not-None).
        If the message is of unknown type or can't be processed by
        this handler then return None.

on_exception(self, exception, context)

source code 
By default simply rethrow the exception ignoring context. Could be used for loggin all the processing errors. @param exception The exception that was caught, of (sub)type GcheckyError. @param context The request context where the exception occured.

Class Variable Details [hide private]

__MESSAGE_HANDLERS

Value:
{<class 'gchecky.model.charge_amount_notification_t'>: 'handle_charge_\
amount',
 <class 'gchecky.model.order_state_change_notification_t'>: 'handle_or\
der_state_change',
 <class 'gchecky.model.risk_information_notification_t'>: 'handle_risk\
_information',
 <class 'gchecky.model.refund_amount_notification_t'>: 'handle_refund_\
amount',
...