onlinepayment v1.0.0 - a generic Python API for making online payments

This module provides an API wrapper around a variety of payment
providers.  Using this module you can write code that will work the
same regardless of the payment provider in use.

Examples::

   from onlinepayment import OnlinePayment

   # connect to authorize.net, setup auth with login and key
   auth= { 'login': 'YOUR LOGIN HERE',
           'key':   'YOUR KEY HERE' }

   op = OnlinePayment('authnet', test_mode=True, auth=auth)

   # or for paypal, setup auth with user, pass, vendor and product:
   auth= { 'username': 'YOUR USERNAME HERE',
           'password': 'YOUR PASSWORD HERE',
           'vendor':   'YOUR VENDOR HERE',
           'product':  'YOUR PRODUCT HERE' }

   # connect to PayPal
   op = OnlinePayment('paypal', test_mode=True, auth=auth)

   # charge a card
   try:
       result = op.sale(first_name = 'Joe',
                        last_name  = 'Example',
                        address    = '100 Example Ln.',
                        city       = 'Exampleville',
                        state      = 'NY',
                        zip        = '10001',
                        amount     = '2.00',
                        card_num   = '4007000000027',
                        exp_date   = '0530',
                        card_code  = '1234')

   except conn.TransactionDeclined:
      # do something when the transaction fails

   except conn.CardExpired:
      # tell the user their card is expired

   except conn.ProcessorException:
      # handle all other possible processor-generated exceptions generically

   # examine result, the values returned here are processor-specific
   success  = result.success
   code     = result.code
   message  = result.message
   trans_id = result.trans_id

   # you can get the raw data returned by the underlying processor too
   orig = result.orig

Installation
============

Before you can use this module you must install one or more payment
processors.  To install the PayPal payflowpro package::

  # easy_install pytz
  # easy_install python-payflowpro

To install the zc.authorizedotnet package and the authorize package
(for recurring support)::

  # easy_install zc.authorizedotnet
  # easy_install authorize

If you want authorize.net support you'll need to install a patched
version of zc.ssl.  Hopefully someday this will be released by the
Zope devs, but so far I haven't heard anything back.  Download the
zc.ssl source package from http://pypi.python.org/pypi/zc.ssl/, then
unpack::

  # tar zxvf zc.ssl-1.1.tar.gz
  # cd zc.ssl-1.1

Now download and apply my zc-ssl-timeout.patch::

  # wget
http://python-onlinepayment.googlecode.com/svn/trunk/zc-ssl-timeout.patch
  # patch -p1 < /zc-ssl-timeout.patch

And install the patched module::

  # python setup.py install

(You may also need to edit setup.py and remove the
'ssl-for-setuptools' dependecy.  I did, although it may be a quirk of
my Python install rather than a general problem.)

Once you have a payment processor you can install this module::

  # easy_install onlinepayment

For more information see: http://pypi.python.org/pypi/onlinepayment/1.0.0
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

        Support the Python Software Foundation:
        http://www.python.org/psf/donations/

Reply via email to