{"id":18924708,"url":"https://github.com/neurotech-hq/python-dpo","last_synced_at":"2025-04-15T12:32:46.150Z","repository":{"id":45810109,"uuid":"427312110","full_name":"Neurotech-HQ/python-dpo","owner":"Neurotech-HQ","description":"A python package to easy the integration with Direct Online Pay (Mpesa, TigoPesa, AirtelMoney, Card Payments)","archived":false,"fork":false,"pushed_at":"2021-11-19T11:40:09.000Z","size":35,"stargazers_count":16,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-03-04T03:47:44.670Z","etag":null,"topics":["airtelmoney","direct-online-pay","mobile-payments","mpesa","tigopesa"],"latest_commit_sha":null,"homepage":"https://directpayonline.atlassian.net/wiki/spaces/API/overview","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neurotech-HQ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"kalebujordan"}},"created_at":"2021-11-12T10:06:01.000Z","updated_at":"2023-01-05T05:52:02.000Z","dependencies_parsed_at":"2022-08-31T21:23:03.650Z","dependency_job_id":null,"html_url":"https://github.com/Neurotech-HQ/python-dpo","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Fpython-dpo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Fpython-dpo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Fpython-dpo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Fpython-dpo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neurotech-HQ","download_url":"https://codeload.github.com/Neurotech-HQ/python-dpo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223673012,"owners_count":17183618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airtelmoney","direct-online-pay","mobile-payments","mpesa","tigopesa"],"created_at":"2024-11-08T11:07:51.070Z","updated_at":"2024-11-08T11:07:51.756Z","avatar_url":"https://github.com/Neurotech-HQ.png","language":"Python","funding_links":["https://patreon.com/kalebujordan"],"categories":[],"sub_categories":[],"readme":"\u003csamp\u003e\n\n# [python-dpo](https://github.com/Kalebu/python-dpo)\n\n[![Downloads](https://pepy.tech/badge/directpayonline)](https://pepy.tech/project/directpayonline)\n[![Downloads](https://pepy.tech/badge/directpayonline/month)](https://pepy.tech/project/directpayonline)\n[![Downloads](https://pepy.tech/badge/directpayonline/week)](https://pepy.tech/project/directpayonline)\n\nA python package to easy the integration with Direct Online Pay (DPO)  which easily allow you easily integrate  with payment options once without having to deal with each of them individually;\n\n- [Mpesa](https://vodacom.co.tz/mpesa)\n- [TigoPesa](https://www.tigo.co.tz/tigo-pesa)\n- [AirtelMoney]()\n- Card Payments\n  - MasterCard\n  - Visa\n  - American Express\n  - Orange Money\n  - MTN MOMO\n\n## Getting started\n\nTo gets started with [python-dpo](https://github.com/Kalebu/python-dpo) you need to install the package first, here how;\n\n```bash\npip install DirectPayOnline --upgrade\n```\n\n## Configuring .env \n\nYou can configure some variables directly on **.env** file and  so they will be loaded by the dotenv package.\n\nHere some of importants of things you to configure;\n\n```bash\nCOMPANY_TOKEN=9F416C11-127B-4DE2-AC7F-D5710E4C5E0A\nCURRENCY=TZS\nADDRESS=Tanzania\nSERVICE_TYPE=3854\nCOMPANY_REFERENCE=34TESTREFF\n```\n\n## How does it work ?\n\n1. Create payment token\n2. Verify token\n3. Redirect to DPO payment page\n4. Fetch response\n5. Done\n\n## Example of usage\n\n```python\n\u003e\u003e\u003e from dotenv import load_dotenv\n\u003e\u003e\u003e load_dotenv() # loading environment variables \n\u003e\u003e\u003e from DirectPayOnline import DPO\n\u003e\u003e\u003e dpo = DPO(sandbox=False)\n\u003e\u003e\u003e response = dpo.create_token(\n    {\n      'amount': 400, \n      \"service_description\": \"Sarufi.io subscription\"\n    }\n  )\n\u003e\u003e\u003e transtoken = response.get('API3G')['TransToken']\n\u003e\u003e\u003e dpo.create_payment_url(transtoken)\n'https://secure.3gdirectpay.com/payv2.php?ID=1D0CC035-40E5-44A3-B5EF-034A34AD33E9'\n```\n\nWhen a user visit a payment_url, he/she will have an option to pay through preffered payment option, where if its a mastercard or visa or mobile money (Mpesa, TigoPesa, AirtelMoney).\n\n## Issues ?\n\nIf you encounter any issue with the usage of the package, please raise one so as we can fix it as soon as possible.\n\n## Contributions\n\n**Python-DPO** is an opensource project under [MIT Public LICENSE](https://github.com/Kalebu/python-dpo/blob/main/LICENSE), contributions of any kind are welcomes from;\n\n- fixing Typos\n- improving documentation\n- writing detailed example usecases\n- fixing bugs and adding new features\n- sharing with your developer friends and community\n\n## Give it a star\n\nWas this useful to you ? Then give it a star so that more people can make use of this.\n\n## Credits\n\nAn inspiration for this came from [dpo-php](https://github.com/Zepson-Technologies/dpo-php) Thanks to amazing work made by [Novath Thomas](https://github.com/pro-cms) and [Alpa Olomi](https://github.com/alphaolomi).\n\nAll the credits to:\n\n- [kalebu](https://github.com/kalebu)\n- [Novath Thomas](https://github.com/pro-cms)\n- and all the contributors\n\n\u003c/samp\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurotech-hq%2Fpython-dpo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneurotech-hq%2Fpython-dpo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurotech-hq%2Fpython-dpo/lists"}