Python bindings for the Dintero API
Project description
Dintero Python SDK
With the Dintero Python SDK you can easily interact with the Dintero API to create and manage payments through the Checkout API, and in the future also use the many other APIs we've got.
Installation
Install from pip by using:
pip install --upgrade dintero
Requirements
- Python 3.6+
Using the SDK
Create an account through https://onboarding.dintero.com.
Get client credentials from the Dintero Backoffice, see guide.
Create a payment profile by going to Dintero Backoffice --> Settings --> Payment Profiles
Use your newly created credentials to create a session:
from dintero import Dintero
account_id = 'T12345678'
client_id = '72e023b1-aeda-498e-b141-4669528c44b9'
client_secret = '125f9f0a-e240-4bfd-be57-0086343bf0e4'
profile_id = 'T12345678.46dP6T4F1mUXYPeYKYc5Gj'
dintero = Dintero(
account_id,
client_id,
client_secret)
checkout = dintero.checkout()
session_info = checkout.create_session({
"url": {
"return_url": "https://example.com/accept",
"callback_url": "https://example.com/callback"
},
"order": {
"amount": 29990,
"currency": "NOK",
"merchant_reference": "string",
"items": [
{
"id": "chair-1",
"line_id": "1",
"description": "Stablestol",
"quantity": 1,
"amount": 29990,
"vat_amount": 6000,
"vat": 25
}
]
},
"profile_id": profile_id
})
print(session_info)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dintero-0.0.8.tar.gz
(7.7 kB
view details)
File details
Details for the file dintero-0.0.8.tar.gz
.
File metadata
- Download URL: dintero-0.0.8.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98a71d3e04ac5ecba0574ff1102e1bf67a370b7eb981b17e926f4d376bb5b7ab |
|
MD5 | 255cdd60970eefe58c4316abd7b2c5ba |
|
BLAKE2b-256 | 99b003ab6b254103866cc7837a30e029cd31cdd5ea26b285362de6fb05f40bec |