Skip to main content

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.1 (2026-08-24)

Moved repository to GitLab.

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

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

securepay-1.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: securepay-1.0.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for securepay-1.0.1.tar.gz
Algorithm Hash digest
SHA256 19e308adb2eadd919fba229e39467393ae96cb8379808c235ff81617e96edbc8
MD5 d22714f0c0a9c8a66dd4264e6703b233
BLAKE2b-256 79d1912ef0e0d020224dd75c0413d7f24c7e5acdbc576b8b1c335a3b00d7b647

See more details on using hashes here.

File details

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

File metadata

  • Download URL: securepay-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for securepay-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30cf22f75cfbc91201d21fd6611b6ded7cabdf57d2c071b9e1663e32d82c16e5
MD5 11cac00bd955f0414266b247e3ca7297
BLAKE2b-256 44ae925365594b0df47e640268f3bd2d8359cd5a7b6649cf55538ad7074f29b1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.7

2 files

0.5.6

2 files

0.5.5

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

1 file

0.5.1

1 file

0.5.0

1 file

0.4.1

1 file

0.4

1 file

0.3

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page