swish python客户端库
swish的Python项目详细描述
此客户端库旨在支持swish api。它最初是在Playing开发的。
安装
很简单!只需安装pip:
$ pip install swish
快速入门示例
importswishswish_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!