Skip to content

MadSpindel/swish-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e3df0dc Β· Jul 12, 2024
Jun 19, 2024
Jul 12, 2024
Jun 19, 2024
Apr 13, 2016
Jan 29, 2016
May 7, 2019
Jan 29, 2016
Jun 19, 2024
Apr 11, 2016
Jun 19, 2024
Jun 23, 2017
Apr 3, 2016
Feb 7, 2016
Jul 12, 2024

Repository files navigation

swish

Build Status codecov.io

πŸ’° Swish Python Client Library

This client library is designed to support the Swish handel API.

Offical Integration Guide

πŸ— Installation

It's easy! Just install it with pip:

pip install swish

πŸ“‹ Quick Start Example

import swish

swish_client = swish.SwishClient(
    environment=swish.Environment.MSS,
    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!