Skip to main content

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 $2 AUD 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 above in full.
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

1.0.0 (2021-09-28)

  • Require Python 3.6.

  • Switch to setup.cfg.

0.6.0 (2016-10-29)

Improvements

  • Add the optional recurring field to payment requests (Greg McCoy). Note: This does not automate transaction processing. See the pay_by_cc function docstring and SecurePay docs for details.

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

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-1.0.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

securepay-1.0.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file securepay-1.0.0.tar.gz.

File metadata

  • Download URL: securepay-1.0.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for securepay-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ae24439089bca66b31dbb440f0d540757598670949e61b6f92e2fe1d5f7640e7
MD5 2656b155cf3a260d559c41a3b3288f39
BLAKE2b-256 3225c2dc615252082a5eb20337a14fb5f17120fcea6c07b8293d905093bdd75e

See more details on using hashes here.

File details

Details for the file securepay-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: securepay-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for securepay-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3354ebd679058ce30cdbfe290ad2cfc9cc5bfd9d0b569d77228e77de89a2364
MD5 6c3dc5aecfc6bb15d0db8aef8d3371ce
BLAKE2b-256 d707b25c939d1a486bd5c0b6f7072be1590a64e6d01cc144f83c58bf3cfc19e0

See more details on using hashes here.

Supported by

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