dintero


Namedintero JSON
Version 0.0.8 PyPI version JSON
download
home_pagehttps://github.com/dintero/Dintero.Python.SDK
SummaryPython bindings for the Dintero API
upload_time2023-07-13 19:42:37
maintainer
docs_urlNone
authorDintero
requires_python>=3.6
licenseMIT
keywords dintero api payments
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Dintero Python SDK

![Build Status](https://github.com/dintero/Dintero.Python.SDK/actions/workflows/ci.yml/badge.svg)

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](https://docs.dintero.com/docs/checkout/checkout-client).

Create a payment profile by going to [Dintero Backoffice](https://backoffice.dintero.com) --> Settings --> Payment
Profiles

Use your newly created credentials to create a session:

```python
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)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dintero/Dintero.Python.SDK",
    "name": "dintero",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "dintero api payments",
    "author": "Dintero",
    "author_email": "integration@dintero.com",
    "download_url": "https://files.pythonhosted.org/packages/99/b0/03ab6b254103866cc7837a30e029cd31cdd5ea26b285362de6fb05f40bec/dintero-0.0.8.tar.gz",
    "platform": null,
    "description": "# Dintero Python SDK\n\n![Build Status](https://github.com/dintero/Dintero.Python.SDK/actions/workflows/ci.yml/badge.svg)\n\nWith the Dintero Python SDK you can easily interact with the Dintero API to create and manage payments through the\nCheckout API, and in the future also use the many other APIs we've got.\n\n## Installation\n\nInstall from pip by using:\n\n```\npip install --upgrade dintero\n```\n\n### Requirements\n\n* Python 3.6+\n\n## Using the SDK\n\nCreate an account through https://onboarding.dintero.com.\n\nGet client credentials from the Dintero Backoffice, see [guide](https://docs.dintero.com/docs/checkout/checkout-client).\n\nCreate a payment profile by going to [Dintero Backoffice](https://backoffice.dintero.com) --> Settings --> Payment\nProfiles\n\nUse your newly created credentials to create a session:\n\n```python\nfrom dintero import Dintero\n\naccount_id = 'T12345678'\nclient_id = '72e023b1-aeda-498e-b141-4669528c44b9'\nclient_secret = '125f9f0a-e240-4bfd-be57-0086343bf0e4'\n\nprofile_id = 'T12345678.46dP6T4F1mUXYPeYKYc5Gj'\n\ndintero = Dintero(\n    account_id,\n    client_id,\n    client_secret)\ncheckout = dintero.checkout()\nsession_info = checkout.create_session({\n    \"url\": {\n        \"return_url\": \"https://example.com/accept\",\n        \"callback_url\": \"https://example.com/callback\"\n    },\n    \"order\": {\n        \"amount\": 29990,\n        \"currency\": \"NOK\",\n        \"merchant_reference\": \"string\",\n        \"items\": [\n            {\n                \"id\": \"chair-1\",\n                \"line_id\": \"1\",\n                \"description\": \"Stablestol\",\n                \"quantity\": 1,\n                \"amount\": 29990,\n                \"vat_amount\": 6000,\n                \"vat\": 25\n            }\n        ]\n    },\n    \"profile_id\": profile_id\n})\n\nprint(session_info)\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python bindings for the Dintero API",
    "version": "0.0.8",
    "project_urls": {
        "Bug Tracker": "https://github.com/dintero/Dintero.Python.SDK/issues",
        "Documentation": "https://docs.dintero.com",
        "Homepage": "https://github.com/dintero/Dintero.Python.SDK",
        "Source Code": "https://github.com/dintero/Dintero.Python.SDK"
    },
    "split_keywords": [
        "dintero",
        "api",
        "payments"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99b003ab6b254103866cc7837a30e029cd31cdd5ea26b285362de6fb05f40bec",
                "md5": "255cdd60970eefe58c4316abd7b2c5ba",
                "sha256": "98a71d3e04ac5ecba0574ff1102e1bf67a370b7eb981b17e926f4d376bb5b7ab"
            },
            "downloads": -1,
            "filename": "dintero-0.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "255cdd60970eefe58c4316abd7b2c5ba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7722,
            "upload_time": "2023-07-13T19:42:37",
            "upload_time_iso_8601": "2023-07-13T19:42:37.318445Z",
            "url": "https://files.pythonhosted.org/packages/99/b0/03ab6b254103866cc7837a30e029cd31cdd5ea26b285362de6fb05f40bec/dintero-0.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-13 19:42:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dintero",
    "github_project": "Dintero.Python.SDK",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "dintero"
}
        
Elapsed time: 0.09029s