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
Release history Release notifications | RSS feed
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.4.tar.gz
(5.3 kB
view hashes)
Built Distribution
Close
Hashes for securepay-0.5.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77af271030dedb0253bcd7b8eeeece85bb7557e6067debf1f4db10d27bce6ff3 |
|
MD5 | 5788271cb8eba43df745c8ee88df7bb5 |
|
BLAKE2b-256 | c59a1db359ec6df1a86963d4c8ad2e6e62368ec92d34876488194d8e7fef6646 |