Skip to main content

Swish Python Client Library

Project description

This client library is designed to support the Swish API. It was originally developed at Playing.

Installation

It’s easy! Just install it with pip:

$ pip install swish

Quick Start Example

import swish

swish_client = swish.SwishClient(
    environment=swish.Environment.Test,
    merchant_swish_number='1231181189',
    cert=('/path/to/cert.pem', '/path/to/key.pem'),
    verify='/path/to/swish.pem'
)

payment = swish_client.create_payment(
    payee_payment_reference='0123456789',
    callback_url='https://example.com/api/swishcb/paymentrequests',
    payer_alias='46712345678',
    amount=100,
    currency='SEK',
    message='Kingston USB Flash Drive 8 GB'
)

# YOUR CODE: Save payment.id and other info in your database for later!

Project details


Download files

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

Files for swish, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size swish-1.1-py2-none-any.whl (13.8 kB) File type Wheel Python version py2 Upload date Hashes View
Filename, size swish-1.1.tar.gz (13.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page