Skip to main content

Unofficial Python SDK for Valitor (formerly AltaPay/Pensio).

Project description

https://travis-ci.org/coolshop-com/AltaPay.svg https://codecov.io/github/coolshop-com/AltaPay/coverage.svg?branch=master https://img.shields.io/pypi/v/altapay.svg

This is an unofficial Python SDK for Valitor (formerly AltaPay/Pensio), https://altapay.com/. The SDK is maintained by Coolshop.com, https://www.coolshop.com/.

Documentation

Documentation is available at Read the Docs.

Requirements

  • Python (3.5, 3.6, 3.7)

Other versions of Python may also be supported, but these are the only versions we test against.

Dependencies

  • requests

  • six

Installation

The easiest way is using pip.

pip install altapay

Getting Started

Refer to the introduction on the documentation for some getting started use cases.

Contributing

Currently, this library only implements the bare minimum of the AltaPay API. It will allow you to create payment links, and do basic subscription functionality. If you need anything else, feel free to submit a full request, or if you have ideas, open an issue.

If you do decide to submit a pull request, do note that both isort and flake8 (including pep8-naming) are run for all pull requests. You are also advised to write test cases.

Running the Tests

First of all, have tox installed on your system. System-wide is probably the better choice. Once you have tox installed, simply run:

tox

This will run all tests, against all supported Python versions.

Change Log

1.4.1 (2019-06-26)

** Python support **

  • As of version 1.4.0, Python versions below 3.5 are no longer supported.

1.4.0 (2019-06-24)

Features

  • Added altapay.Transaction.chargebacks() which returns the chargeback events as custom objects.

1.3.0 (2017-10-20)

Features

  • Added altapay.Transaction.refund() with functionality for refunding a transaction, both full and partial.

1.2.1 (2016-11-02)

Bugfix

  • Fixed a bug where parsing the values “nan”, “inf” or “-inf” would lead to a float value, when handling XML values. While this could potentially be correct, it’s safer to assume that these values are in fact string values

1.2.0 (2016-04-19)

Features*

  • Added altapay.FundingList and altapay.Funding. These two objects will interact with the funding list features of AltaPay, and will allow you to both list all of your funding files, as well as download individual files. Currently no guide section is written on the subject, but full API documentation is available

  • Added altapay.CustomReport which mimics the custom reporting module of AltaPay. Using a custom report ID and additional kwargs based on the report, you can either view or download your custom reports

1.1.0 (2016-04-12)

  • Previously, all calls would use an HTTP GET, since the AltaPay documentation in some cases suggests that this is the case. This works, however, it breaks when payments start to contain many order lines. Because of this, all calls have been changed to HTTP POST, which is the recommended way of communicating with the AltaPay API.

1.0.1 (2016-03-15)

API Change

  • Backwards incompatible altapay.Transaction.capture() will now return an altapay.Callback object instead of a altapay.Transaction object

1.0 (2016-03-03)

First Production Release

Features

  • Addded altapay.Transaction.release()

1.0.dev9 (2016-02-26)

Improvements

  • Backwards incompatible Moved altapay.Transaction.create_invoice_reservation() to altapay.Callback.create_invoice_reservation(). The method will now return a altapay.Callback object in order to read the result key (#41)

1.0.dev8 (2016-02-22)

Features

  • Added altapay.Transaction.create_invoice_reservation()

1.0.dev7 (2016-02-17)

Improvements

  • Backwards incompatible Changed the name of altapay.Transaction.reserve() to altapay.Transaction.reserve_subscription_charge()

1.0.dev6 (2016-02-17)

Features

  • Added altapay.Transaction.reserve() which will reserve an amount on a subscription

1.0.dev5 (2016-02-11)

Improvements

  • Backwards incompatible Changed the return type of altapay.Transaction.charge_subscription(). It will not return a altapay.Callback object instead of a list of transactions

  • Backwards incompatible Changed the argument of altapay.Callback.transactions() to be keyword only. Will now accept any number of filters, and these will be matched using AND logic

1.0.dev4 (2016-02-03)

Features

  • Added altapay.Transaction.charge_subscription() which will charge a subscription on a transaction, if this transaction is setup as a subscription

Bugfixes

  • Fixed a bug where looking up a non-existent transaction ID would result in a KeyError (#32)

0.1.dev3 (2016-01-18)

Bugfixes

  • Added missing apostrophe’s in the documentation for the callback guide (#24)

  • Fixed a bug where filtering transactions on a altapay.Callback object might result in a KeyError (#25)

Improvements

  • Made it more explicit how attributes on response objects work (#26)

0.1.dev2 (2016-01-14)

Features

  • Added altapay.Transaction and the ability to find a transaction by its transaction ID in the AltaPay service

  • Added altapay.Transaction.capture() which captures a transaction that has already been loaded. Optinally, parameters can be passed which allows for partial captures (see the AltaPay documentation for full list of possible arguments)

  • Added a public facing API for converting an AltaPay XML response (as a string) to a Python dictionary (altapay.utils.xml_to_dict)

  • Added altapay.Callback which wraps a callback response from AltaPay, and automatically wraps the coupled transactions in altapay.Transaction objects

Bugfixes

  • Fixed a bug where specifying a non-existing terminal while creating an altapay.Payment object would result in altapay.Payment.success returning True

  • Fixed a bug where running in production mode was not possible. It is now possible by specifying a shop name when instantiating the API

0.1.dev1 (2016-01-05)

  • Complex payments are now possible. This means it is now possible to send detailed payment information in a Pythonic way using just lists and dictionaries, instead of the PHP style query params syntax

  • Documentation now includes a small guide for available parts of the SDK, which will make is easier to get started easily without reading the raw API documentation

0.1.dev0 (2015-12-18)

  • Basic API connection class implemented in altapay.api.API

  • Basic Payment class implemented in altapay.payment.Payment which is currently mainly for creating a very basic payment request with the AltaPay service

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

altapay-1.4.1.tar.gz (32.1 kB view details)

Uploaded Source

Built Distribution

altapay-1.4.1-py2.py3-none-any.whl (15.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file altapay-1.4.1.tar.gz.

File metadata

  • Download URL: altapay-1.4.1.tar.gz
  • Upload date:
  • Size: 32.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.3

File hashes

Hashes for altapay-1.4.1.tar.gz
Algorithm Hash digest
SHA256 2014317496bfa25493bf83cd02aa920a61d47cce07abc0c9b1421d99705632e0
MD5 a576590a105140db43fb78df7f28c7a4
BLAKE2b-256 1dc6d9dac2848d095d532eaf8dd962afa213c7997e6fe7ce4636d5a026074acc

See more details on using hashes here.

File details

Details for the file altapay-1.4.1-py2.py3-none-any.whl.

File metadata

  • Download URL: altapay-1.4.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.3

File hashes

Hashes for altapay-1.4.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 93535e29fa05a989f03c7624b530e7879d2e42dd2dbfce7754181c051b12f91b
MD5 4384151f0d36d65472f090644120fc9a
BLAKE2b-256 e0f37e6d496403d8a38cf71a6de7a6d352efe5be12671b8075def6ea5d2be56f

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 Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page