gchecky

Package gchecky |
[hide private]
[frames] | no frames]

# Package gchecky

source code

Gchecky provides an abstraction layer between google checkout API and user code.

It wraps-up the clumsy Level 2 integration API into a human-friendly form.

All the interaction between Checkout API and user code is handled by the library, which includes the following topics:

- generating/validating/parsing XML messages for/from Google Checkout API
- transforming the xml DOM trees into a human-friendly structures almost word-by-word following the official specification from google.
- does the technical low-level tasks such as generating authentication token from user vendor_id and merchant_key etc.
- parses Google Checkout API notification messages and runs the corresponding hook methods.

Intergration of the library consists of four phases:

1. gather your account settings such as your vendor_id, merchant_key, your local currency symbol (ATM either 'USD' or 'GBP')
2. create a unique instance of `gchecky.ControllerLevel_2` class by subclassing it. Provide custom implementation to the abstract methods. Basically all you need is to define your reaction to various API notifications (see step 5 for details).
3. set up a separate background thread for sending requests to Google Checkout API.
4. set up a web-handler at a publicly accessible url. Refer to the Google Checkout Notification API. But instead of processing incoming XML messages yourself, it should pass the incoming request text to your customized instance of `gchecky.ControllerLevel_2` (to `gchecky.ControllerLevel_2.recieve`).
5. Provide your local order-processing system integration by overriding abstract methods of your custom instance of `gchecky.ControllerLevel_2` (see steps 2 and 3). Basically you will need to store Orders in your custom order-processing system, update it state every time you receive a notification from Google Checkout Notification API (notifications correspond to abstract Controller.on_XXX methods). Plus in the step 3 you will need to scan your Order list and perform actions on those orders which are ready for the further processing (charging, refunding, delivering etc.)

Author: etarassov

Version: $Revision $

Contact: gchecky at gmail

Submodules | [hide private]
gchecky.controller gchecky.data gchecky.gxml: Gchecky.gxml module provides an abstraction layer when dealing with Google Checkout API services (GC API). gchecky.model: gchecky.model module describes the mapping between Google Checkout API (GC API) XML messages (GC API XML Schema) and data classes. gchecky.test gchecky.test.controller gchecky.test.gxml' gchecky.test.model gchecky.tools: The module provides two classes encoder and decoder that allow to serialize and deserialize python-ish PODs into/from XML.

Functions | [hide private]
version(version=`(`0`,` 2`,` 1`)`) Return version string. | source code
human_version(version=`(`0`,` 2`,` 1`)`) Return human-friendly version string. | source code

Variables | [hide private]
| VERSION = ``(`0`,` 2`,` 1`)``

Function Details | [hide private]

### version(version=`(`0`,` 2`,` 1`)`) | source code
Return version string. >>> version((0,1,1)) '0.1.1' >>> version((0,1,0)) '0.1.0' >>> version(VERSION) == version() True

### human_version(version=`(`0`,` 2`,` 1`)`) | source code
Return human-friendly version string. >>> human_version((0,1,0)) '0.1' >>> human_version(VERSION) == human_version() True