Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

securionpay/securionpay-python

Repository files navigation

Deprecation

This library is deprecated. Please use Shift4 Python Library.

Python library for SecurionPay API

Build

Installation

pip install securionpay

Quick start

import securionpay as securionpay

securionpay.secret_key = 'pk_test_my_secret_key'

try:
    customer = securionpay.customers.create({
        'email': '[email protected]',
        'description': 'User description'
    })
    print("Created customer:", customer)
    card = securionpay.cards.create(customer['id'], {
        'number': '4242424242424242',
        'expMonth': '12',
        'expYear': '2023',
        'cvc': '123',
        'cardholderName': 'John Smith'
    })
    print("Created card:", card)
    charge = securionpay.charges.create({
      'amount': 1000,
      'currency': 'EUR',
      'customerId': card['customerId']
    })
    print("Created charge:", charge)
except securionpay.SecurionPayException as e:
  print(e)

API reference

Please refer to detailed API docs (linked) for all available fields

For further information, please refer to our official documentation at https://securionpay.com/docs.

Developing

Optionally setup a virtual environment

python -m venv ./venv --clear
source ./venv/bin/activate 

Install the package dependencies:

pip install -r requirements.txt -r test_requirements.txt

To connect to different backend:

import securionpay as api

api.secret_key = 'pk_test_my_secret_key'
api.api_url = 'https://api.mysecurionenv.com'
api.uploads_url = 'https://uploads.mysecurionenv.com'

To run tests:

SECRET_KEY=pk_test_my_secret_key pytest tests

Format the package files using black:

black setup.py securionpay/ tests/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages