Skip to content

MultiSafepay/python-sdk

MultiSafepay Python SDK

Code Quality Codecov License Latest stable version Python versions

Easily integrate MultiSafepay's payment solutions into your Python applications with this official API client. This SDK provides convenient access to the MultiSafepay REST API, supports all core payment features, and is designed for seamless integration into any Python-based backend.

About MultiSafepay

MultiSafepay is a Dutch payment services provider, which takes care of contracts, processing transactions, and collecting payment for a range of local and international payment methods. Start selling online today and manage all your transactions in one place!

Installation

If you want to use the built-in default transport, install with the requests extra.

pip install "multisafepay[requests]"

If you want to provide your own transport implementation, install the base package.

pip install multisafepay

HTTP client / transport (optional dependency)

WARNING: This SDK does not have a hard dependency on a specific HTTP client.

The SDK uses a small transport abstraction so you can choose (and swap) the underlying HTTP implementation without affecting the rest of your integration.

How it works

  • The SDK expects an object implementing the HTTPTransport / HTTPResponse protocols defined in src/multisafepay/transport/http_transport.py.
  • If you do not provide a transport, the SDK defaults to RequestsTransport.
  • requests is an optional extra:
    • To use the default transport, install multisafepay[requests].
    • To avoid requests, inject your own transport (for example, httpx or urllib3).

Custom transport example

pip install multisafepay
from multisafepay import Sdk


sdk = Sdk(
    api_key="<api_key>",
    is_production=False,
    transport=my_custom_transport,  # must implement HTTPTransport
)

See transport examples in examples/transport/ (httpx_transport.py, urllib3_transport.py, request_transport.py).

Getting started

Initialize the client

from multisafepay import Sdk

multisafepay_sdk: Sdk = Sdk(api_key='<api_key>', is_production=True)

Examples

Go to the folder examples to see how to use the SDK.

Code quality checks

Linting

make lint

Testing

make test

Support

Create an issue on this repository or email integration@multisafepay.com

Contributors

If you create a pull request to suggest an improvement, we'll send you some MultiSafepay swag as a thank you!

License

Open Software License (OSL 3.0)

Want to be part of the team?

Are you a developer interested in working at MultiSafepay? Check out our job openings and feel free to get in touch!

About

The default Python library for connecting to the MultiSafepay REST API

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors