Skip to main content

Python interface to the Securepay credit card gateway.

Project description

SecurePay in an Australian payment gateway provider. This library can be used to request and refund payment on demand.

Quickstart

This package can be used as follows:

import securepay

MERCHANT_ID = '...'
PASSWORD = '...'

# Take a credit card payment.
try:
    pay_response = securepay.pay_by_cc(
        200, 'PO-1234', '4444333322221111', '11/18',
        securepay.TEST_API_URL, MERCHANT_ID, PASSWORD, 'J. Citizen')
except securepay.GatewayError as err:
    # Service unavailable. Log err and give customers a generic error.
except securepay.PaymentError as err:
    # Payment declined. Error message is in err.
else:
    # Payment successful! Details in pay_response.


# Refund the payment.
try:
    refund_response = securepay.refund(
        200, 'PO-1234', pay_response['transaction_id'],
        securepay.TEST_API_URL, MERCHANT_ID, PASSWORD)
except securepay.GatewayError as err:
    # Service unavailable. Log err and give customers a generic error.
except securepay.PaymentError as err:
    # Refund declined. Error message is in err.
else:
    # Refund successful! Details in refund_response.

To run the tests:

$ tox

This module doesn’t yet provide credit card authorisation transactions (ie. putting some money on hold for an upcoming payment). If you’re interesting in funding some work to add these features, please get in touch.

Release History

0.5.7 (2015-08-03)

Improvements

  • Add securepay.LIVE_API_URL and securepay.TEST_API_URL so you don’t have to define them yourself.

0.5.6 (2015-08-03)

Bug fixes

  • Fixed support for Python 2.7

  • Enabled tests for Python 2.7, 3.3 and 3.4 with Tox

https://piwik.sturm.com.au/piwik.php?idsite=20&rec=1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

securepay-0.5.7.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

securepay-0.5.7-py2.py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page