{"id":18924700,"url":"https://github.com/neurotech-hq/tigopesa","last_synced_at":"2025-08-02T00:34:26.841Z","repository":{"id":103910928,"uuid":"335380248","full_name":"Neurotech-HQ/tigopesa","owner":"Neurotech-HQ","description":"Python package to ease the Tigo Pesa API integration ","archived":false,"fork":false,"pushed_at":"2021-05-03T12:55:16.000Z","size":39,"stargazers_count":14,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-25T16:52:42.635Z","etag":null,"topics":["mobile-money","payment-gateway","python-tanzania","tigo-pesa"],"latest_commit_sha":null,"homepage":"https://neurotech-hq.github.io/tigopesa/","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"patreon":"kalebujordan"}},"created_at":"2021-02-02T18:09:06.000Z","updated_at":"2024-06-17T02:04:02.000Z","dependencies_parsed_at":"2023-11-22T23:45:10.713Z","dependency_job_id":null,"html_url":"https://github.com/Neurotech-HQ/tigopesa","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Neurotech-HQ/tigopesa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Ftigopesa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Ftigopesa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Ftigopesa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Ftigopesa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neurotech-HQ","download_url":"https://codeload.github.com/Neurotech-HQ/tigopesa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neurotech-HQ%2Ftigopesa/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268318195,"owners_count":24231527,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["mobile-money","payment-gateway","python-tanzania","tigo-pesa"],"created_at":"2024-11-08T11:07:49.766Z","updated_at":"2025-08-02T00:34:26.828Z","avatar_url":"https://github.com/Neurotech-HQ.png","language":"Python","funding_links":["https://patreon.com/kalebujordan"],"categories":[],"sub_categories":[],"readme":"# [tigopesa](https://kalebu.github.io/tigopesa)\n\nPython package to easy the tigopesa api integration\n\n[![Downloads](https://pepy.tech/badge/tigopesa)](https://pepy.tech/project/tigopesa)\n[![Downloads](https://pepy.tech/badge/tigopesa/month)](https://pepy.tech/project/tigopesa)\n[![Downloads](https://pepy.tech/badge/tigopesa/week)](https://pepy.tech/project/tigopesa)\n\n\n![Become a Patron](pictures/become_a_patron_button.png)\n\n## Getting started\n\nTo get started with Tigopesa, you firstly need to install it as show below;\n\n```bash\npip install tigopesa\n```\n\n## Authorization and Configuration\n\nBefore you begin making transaction with tigopesa module, you firstly need to initialize your tigopesa api credentials *client_id* and *client_secret* you were given.\n\nWhether are sandbox keys or production keys, all of them are in great use with the tigopesa package\n\nHere how to initialize;\n\n```python\n\n\u003e\u003e\u003e from tigopesa import Tigopesa\n\u003e\u003e\u003e tigopesa = Tigopesa(\n            client_secret='xxxx',\n            client_id ='xxxx'\n            environment=\"sandbox\"\n        )\n# OR \n\n# You can do this;\n\n\u003e\u003e\u003e from tigopesa import Tigopesa\n\u003e\u003e\u003e tigopesa = Tigopesa(environment='production')\n\u003e\u003e\u003e tigopesa.client_id = 'xxxx'\n\u003e\u003e\u003e tigopesa.client_secret = \"xxxx'\n\n```\n\nOnce you initialize your module, you might need still need to configure your module with couple of more information ready to begin making transactions, there are required paramaters and optional parameters while configuring as shown below;\n\n```python\n# Master mechant (Required parameters)\n\naccount: str\npin: str\naccount_id: str\n\n# Mechant Informations\n\nmechant_reference: Optional[str] = ''\nmechant_fee: Optional[str] = '0.0'\nmechant_currency_code: Optional[str] = ''\n\n# Other_information\nlanguage: Optional[str] = 'eng'\nterminal_id: Optional[str] = ''\ncurrency_code: Optional[str] = 'TZS'\n\ntax: Optional[str] = '0.0'\nfee: Optional[str] = '0.0'\n\nexchange_rate: Optional[str] = '1'\n\n# Callbacks and Redirects\n\ncallback_url: Optional[str] = 'https://kalebujordan.dev/'\nredirect_url: Optional[str] = 'https://kalebu.github.io/pypesa/'\n\n# Subscribers default Information\n\nsubscriber_country_code: Optional[str] = '255'\nsubscriber_country: Optional[str] = 'TZA'\n```\n\nAs you can see there about 3 required parameters while the rest being optional parameters, so in our example we are going to configure using only 3 required parameters and the rest will just take the default values;\n\n```python\n\u003e\u003e\u003e from tigopesa import Tigopesa\n\u003e\u003e\u003e tigopesa.configure(\n            account = '255xxxxx', \n            pin = 'xxxxx'\n            account_id = 'xxxxxx'\n            .........\n        )\n```\n\n## Authorizing Payments \n\nNow once we are done with the authentication and the authorization part, we can start making authorizing tigopesa payment, Here an example you would authorize a secure tigopesa payment with tigopesa library;\n\n```python\n\u003e\u003e\u003e response = tigopesa.authorize_payment({\n            \"amount\": 4999,\n            \"first_name\": \"Kalebu\",\n            \"last_name\": \"Gwalugano\",\n            \"customer_email\": \"kalebjordan.kj@gmail.com\",\n            \"mobile\": \"255757294146\",}\n        )\n\nprint(response)\n\n# Response output \n\n{'transactionRefId': 'f9995a1ab5d04235a2aeeef37baad129', 'redirectUrl': 'https://secure.tigo.com/v1/tigo/payment-auth/transactions?auth_code=CgFsXfSZRL\u0026transaction_ref_id=f9995a1ab5d04235a2aeeef37baad129\u0026lang=eng', 'authCode': 'CgFsXfSZRL', 'creationDateTime': 'Sat, 1 May 2021 20:50:34 UTC', 'SessionLife': 600}\n```\n\n## Issues\n\nIf you're facing issue with the use of the package, raise an issue and I will be working to fixing it as soon as I can;\n\n## Contributing\n\nTigopesa has a lot of modules to integrate, it can be overwhelming doing all of them by myself together with other responsibilities so I warmly welcome contributors (code + documentation) to contribute to this package.\n\n## Credits\n\nAll the credits to;\n\n- [kalebu](https://kalebu.github.io/)\n- [dbrax](https://github.com/dbrax)\n- [Mtabe](https://github.com/zechtz)\n- future contributors","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurotech-hq%2Ftigopesa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneurotech-hq%2Ftigopesa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurotech-hq%2Ftigopesa/lists"}