Skip to main content

SDK for python application to use Alternative Payments

Project description

ApPythonSdk
===================================

Alternative Payments python libary sdk. Accept local payments from all over the world

Installation
-----

Install gem, using pip:

$ pip install ap-python-sdk

In your initializing files add line:

import ap_python_sdk

ap_python_sdk.api_secret_key = 'Fill it with your own secret key.'
ap_python_sdk.api_public_key = 'Fill it with your own public key.'


Usage
-----

For usage and examples check `http://www.alternativepayments.com/support/api/` or sample application on our open-source repo `https://github.com/AlternativePayments/ap-python-sdk`
Example of creating new customer:

customer = Customer.create(
{
'firstName': 'John',
'lastName': 'Doe',
'email': 'tempmail@mail.com',
'address': 'Rutledge Ave 409',
'city': 'Folsom',
'zip': '19033',
'country': 'US',
'state': 'PA',
'phone': '55555555555',
'created': '2016-03-24T15:19:10.7800694Z'
}
);

Accessing object's attributes:

customer.firstName
=> John

Same goes for complex objects like Transaction.
Create SEPA transaction:

customer = Customer(
id='cus_bd838e3611d34d598',
firstName='John',
lastName='Doe',
email='john@doe.com',
country='DE'
)

payment = Payment(
paymentOption='SEPA',
holder='John Doe',
iban='BE88271080782541'
)

return Transaction.create({
'customer': customer,
'payment': payment,
'amount': 500,
'currency': 'EUR',
'description': 'test sepa php sdk',
'merchantPassThruData': 'test_sepa_123',
'ipAddress': '127.0.0.1'
})

Access customer:

transaction.customer.firstName

Development
-----

To release a new version, update the version number in `version.py`, and then run `python setup.py sdist bdist_wheel upload -r https://pypi.python.org/pypi` to create a new version of library and deploy it to `https://pypi.python.org/pypi/ap_python_sdk`

Contributing
-----

1. Fork it ( https://github.com/AlternativePayments/ap-python-sdk/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ap_python_sdk-0.1.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

ap_python_sdk-0.1.3-py2-none-any.whl (12.5 kB view details)

Uploaded Python 2

File details

Details for the file ap_python_sdk-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ap_python_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ca830299d7a1522e9879f13cff0488790e1a4893936161b8b8686178962a2a6
MD5 bcc354c4abc2e69ec3be34e48dd60360
BLAKE2b-256 98b3f91c7da90ed9564b76a724d9da6548b8b3355e63e33398ace39c8afdcde1

See more details on using hashes here.

File details

Details for the file ap_python_sdk-0.1.3-py2-none-any.whl.

File metadata

File hashes

Hashes for ap_python_sdk-0.1.3-py2-none-any.whl
Algorithm Hash digest
SHA256 dd3342d7a52d89403721e405121953071c69a1607e189b791416d2d1fb36c687
MD5 330705ed3626e46ad35f99458efbc240
BLAKE2b-256 c514a85e53bc4219d654dc27cd6ad287d5cae34dc609f58497f83c2c9df84b55

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