Metadata-Version: 2.4
Name: buckaroo-sdk
Version: 0.1.0
Summary: Python bindings for the Buckaroo API
Home-page: https://github.com/buckaroo-it/BuckarooSDK_Python
Author: Buckaroo
Author-email: support@buckaroo.nl
License: MIT
Project-URL: Homepage, https://www.buckaroo.nl
Project-URL: Bug Tracker, https://github.com/buckaroo-it/BuckarooSDK_Python/issues
Project-URL: Changes, https://github.com/buckaroo-it/BuckarooSDK_Python/blob/master/CHANGELOG.md
Project-URL: Documentation, https://github.com/buckaroo-it/BuckarooSDK_Python#readme
Project-URL: Source Code, https://github.com/buckaroo-it/BuckarooSDK_Python/
Keywords: buckaroo api payments
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: typing_extensions>=4.5.0
Requires-Dist: requests>=2.20
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

<p align="center">
  <img src="https://www.buckaroo.nl/media/bldbj0zn/python-sdk_icon.png" width="200px" position="center">
</p>

# Buckaroo Python SDK
[![Latest release](https://badgen.net/github/release/buckaroo-it/BuckarooSDK_Python)](https://github.com/buckaroo-it/BuckarooSDK_Python/releases)

---
### Index
- [About](#about)
- [Requirements](#requirements)
- [Pip Installation](#pip-installation)
- [Example](#example)
- [Contribute](#contribute)
- [Versioning](#versioning)
- [Additional information](#additional-information)
---

### About

Buckaroo is the Payment Service Provider for all your online payments with more than 30,000 companies relying on Buckaroo's platform to securely process their payments, subscriptions and unpaid invoices.
Buckaroo developed their own Python SDK. The SDK is a modern, open-source Python library that makes it easy to integrate your Python application with Buckaroo's services.
Start accepting payments today with Buckaroo.

### Requirements

To use the Buckaroo API client, the following things are required:

+ A Buckaroo account ([Dutch](https://www.buckaroo.nl/start) or [English](https://www.buckaroo.eu/solutions/request-form))
+ Python >= 3.9
+ Up-to-date OpenSSL (or other SSL/TLS toolkit)

### Pip Installation

By far the easiest way to install the Buckaroo SDK is via [pip](https://pip.pypa.io/).

    $ pip install buckaroo-sdk

Then import the client in your project:

```python
from buckaroo import BuckarooClient
```

### Example
Create and configure the Buckaroo client.
You can find your credentials in [Buckaroo Plaza](https://plaza.buckaroo.nl/Configuration/Merchant/ApiKeys).

```python
from buckaroo import BuckarooClient
from buckaroo.services.payment_service import PaymentService

# Get your store & secret key in your plaza.
# mode="test" routes calls to the test environment; use "live" for production.
client = BuckarooClient("STORE_KEY", "SECRET_KEY", mode="test")
payments = PaymentService(client)
```

Create a payment with any of the available payment methods. In this example, we show how to create a credit card payment. Each payment has a slightly different payload.

```python
# Create a new payment
response = (
    payments.create_payment("creditcard", {
        "currency": "EUR",
        "amount": 10.00,                       # The amount we want to charge
        "invoice": "UNIQUE-INVOICE-NO",        # Each payment must contain a unique invoice number
        "service_parameters": {"brand": "visa"},  # Request to pay with Visa
    })
    .description("Order #UNIQUE-INVOICE-NO")
    .pay()
)

# Inspect the response from Buckaroo
if response.is_successful():
    print("transaction id:", response.get_transaction_id())
    print("redirect:", response.get_redirect_url())
else:
    print("status message:", response.get_message())
```

You can also use the fluent interface directly:

```python
response = (
    payments.create_payment("creditcard")
        .currency("EUR")
        .amount(10.00)
        .invoice("UNIQUE-INVOICE-NO")
        .pay()
)
```

Find our full documentation online on [docs.buckaroo.io](https://docs.buckaroo.io).

### Contribute

We really appreciate it when developers contribute to improve the Buckaroo plugins.
If you want to contribute as well, then please follow our [Contribution Guidelines](CONTRIBUTING.md).

### Versioning

- **MAJOR:** Breaking changes that require additional testing/caution
- **MINOR:** Changes that should not have a big impact
- **PATCHES:** Bug and hotfixes only

### Additional information
- **Support:** https://docs.buckaroo.io/docs/contact-us
- **Contact:** [support@buckaroo.nl](mailto:support@buckaroo.nl) or [+31 (0)30 711 50 50](tel:+310307115050)

## License
Buckaroo Python SDK is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
