Skip to main content

SDK that allows you to access wallee

Project description

Build Status

wallee Python Library

The wallee Python library wraps around the wallee API. This library facilitates your interaction with various services such as transactions, accounts, and subscriptions.

Documentation

wallee Web Service API

Requirements

  • Python 3.4+

Installation

pip install (recommended)

pip install --upgrade wallee

pip install from source via github

pip install git+http://github.com/wallee-payment/python-sdk.git

(you may need to run pip with root permission: sudo pip install git+http://github.com/wallee-payment/python-sdk.git )

install from source via Setuptools

Install via Setuptools.

python setup.py install

(or sudo python setup.py install to install the package for all users)

Usage

The library needs to be configured with your account's space id, user id, and secret key which are available in your wallee account dashboard. Set space_id, user_id, and api_secret to their values.

Configuring a Service

from wallee import Configuration
from wallee.api import TransactionServiceApi, TransactionPaymentPageServiceApi
from wallee.models import LineItem, LineItemType, TransactionCreate

space_id = 405

config = Configuration(
    user_id=512,
    api_secret='FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ='
)
transaction_service = TransactionServiceApi(configuration=config)
transaction_payment_page_service = TransactionPaymentPageServiceApi(configuration=config)

To get started with sending transactions, please review the example below:

from wallee import Configuration
from wallee.api import TransactionServiceApi, TransactionPaymentPageServiceApi
from wallee.models import LineItem, LineItemType, TransactionCreate

space_id = 405

config = Configuration(
    user_id=512,
    api_secret='FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ='
)

transaction_service = TransactionServiceApi(configuration=config)
transaction_payment_page_service = TransactionPaymentPageServiceApi(configuration=config)

# create line item
line_item = LineItem(
    name='Red T-Shirt',
    unique_id=5412,
    sku='red-t-shirt-123',
    quantity=1,
    amount_including_tax=29.95,
    type=LineItemType.PRODUCT
)

# create transaction model
transaction = TransactionCreate(
    line_items=[line_item],
    auto_confirmation_enabled=True,
    currency='EUR',
)

transaction_create = transaction_service.create(space_id=space_id, transaction=transaction)
payment_page_url = transaction_payment_page_service.payment_page_url(space_id=space_id, id=transaction_create.id)
# redirect your customer to this payment_page_url

License

Please see the license file for more information.

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

wallee-2.1.0.tar.gz (245.6 kB view details)

Uploaded Source

File details

Details for the file wallee-2.1.0.tar.gz.

File metadata

  • Download URL: wallee-2.1.0.tar.gz
  • Upload date:
  • Size: 245.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.1

File hashes

Hashes for wallee-2.1.0.tar.gz
Algorithm Hash digest
SHA256 05ef7555194b33b7dd8d9ee08ebdf52959ef37875fb40e0f4b89d8d336546267
MD5 2626e8e6c9399aed10b3a7cebf3f0bd8
BLAKE2b-256 57b74a5887829b0ce2eb28e91ea37d4f46116bd4feb24226de5bed235700892a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page