Skip to main content

Python interface to the Securepay credit card payment gateway.

Project description

securepay is a Python interface to the Securepay credit card payment gateway.

This module doesn’t yet provide credit card authorisation transactions (ie. putting some money on hold for an upcoming payment).

Quickstart

This package can be used as follows:

import securepay

SECUREPAY_API_URL= 'https://test.securepay.com.au/xmlapi/payment'
SECUREPAY_MERCHANT_ID = '...'
SECUREPAY_PASSWORD = '...'

# Take a credit card payment.
try:
    response = securepay.pay_by_cc(
        cents, purchase_order_id, cc_number, cc_expiry,
        SECUREPAY_API_URL, SECUREPAY_MERCHANT_ID,
        SECUREPAY_PASSWORD, cc_card_name)
except securepay.GatewayError as err:
    # Service unavailable. Give customers a generic error.
except securepay.PaymentError as err:
    # Payment declined. Error message is in err.
else:
    # Payment successful! Details in response.


# Refund the payment.
try:
    response = securepay.refund(
        cents, purchase_order_id, transaction_ref, SECUREPAY_API_URL,
        SECUREPAY_MERCHANT_ID, SECUREPAY_PASSWORD)
except securepay.GatewayError as err:
    # Service unavailable. Give customers a generic error.
except securepay.PaymentError as err:
    # Refund declined. Error message is in err.
else:
    # Refund successful! Details in response.

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

Uploaded Source

Built Distribution

securepay-0.5.3-py3-none-any.whl (5.2 kB view hashes)

Uploaded 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