{"id":22668679,"url":"https://github.com/KwaWingu/Mobile-Payments-Library","last_synced_at":"2025-08-06T14:32:08.234Z","repository":{"id":244529734,"uuid":"805714082","full_name":"KwaWingu/Mobile-Payments-Library","owner":"KwaWingu","description":"The mobile-payment-library repository is a versatile Java-based toolkit engineered for payment integrations across both mobile applications and server-side environments.","archived":false,"fork":false,"pushed_at":"2024-11-23T14:36:08.000Z","size":301,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-26T22:09:03.907Z","etag":null,"topics":["airtel-money","azampay","ezypesa","halopesa","java","java-library","mpesa","payments","selcom","t-pesa","tigo-pesa"],"latest_commit_sha":null,"homepage":"","language":"Java","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/KwaWingu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-05-25T08:57:38.000Z","updated_at":"2025-01-23T06:39:51.000Z","dependencies_parsed_at":"2024-08-17T21:48:35.119Z","dependency_job_id":"10b2358e-504b-4d04-9fda-763c745338ed","html_url":"https://github.com/KwaWingu/Mobile-Payments-Library","commit_stats":null,"previous_names":["theoddagen/mobile-payments-library","collinsbyte/mobile-payments-library","thecollinsbyte/mobile-payments-library","kwawingu/mobile-payments-library"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KwaWingu/Mobile-Payments-Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwaWingu%2FMobile-Payments-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwaWingu%2FMobile-Payments-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwaWingu%2FMobile-Payments-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwaWingu%2FMobile-Payments-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KwaWingu","download_url":"https://codeload.github.com/KwaWingu/Mobile-Payments-Library/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KwaWingu%2FMobile-Payments-Library/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268644980,"owners_count":24283408,"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-04T02:00:09.867Z","response_time":79,"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":["airtel-money","azampay","ezypesa","halopesa","java","java-library","mpesa","payments","selcom","t-pesa","tigo-pesa"],"created_at":"2024-12-09T15:16:18.649Z","updated_at":"2025-08-06T14:32:08.155Z","avatar_url":"https://github.com/KwaWingu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003ch1\u003e\u003ca href=\"https://github.com/TheCollinsByte/Mobile-Payments-Library\"\u003eMobile Payment Library\u003c/a\u003e\u003c/h1\u003e\n\n\u003ca href=\"https://github.com/TheCollinsByte/Mobile-Payments-Library/blob/main/LICENSE\"\u003e\n\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/TheCollinsByte/Mobile-Payments-Library?style=flat\u0026color=eee\u0026label=\"\u003e \u003c/a\u003e\n\n\u003ca href=\"https://github.com/TheCollinsByte/Mobile-Payments-Library/graphs/contributors\"\u003e\n\u003cimg alt=\"People\" src=\"https://img.shields.io/github/contributors/TheCollinsByte/Mobile-Payments-Library?style=flat\u0026color=ffaaf2\u0026label=People\"\u003e \u003c/a\u003e\n\n\u003ca href=\"https://github.com/TheCollinsByte/Mobile-Payments-Library/stargazers\"\u003e\n\u003cimg alt=\"Stars\" src=\"https://img.shields.io/github/stars/TheCollinsByte/Mobile-Payments-Library?style=flat\u0026color=98c379\u0026label=Stars\"\u003e \u003c/a\u003e\n\n\u003ca href=\"https://github.com/TheCollinsByte/Mobile-Payments-Library/network/members\"\u003e\n\u003cimg alt=\"Forks\" src=\"https://img.shields.io/github/forks/TheCollinsByte/Mobile-Payments-Library?style=flat\u0026color=66a8e0\u0026label=Forks\"\u003e \u003c/a\u003e\n\n\u003ca href=\"https://github.com/TheCollinsByte/Mobile-Payments-Library/watchers\"\u003e\n\u003cimg alt=\"Watches\" src=\"https://img.shields.io/github/watchers/TheCollinsByte/Mobile-Payments-Library?style=flat\u0026color=f5d08b\u0026label=Watches\"\u003e \u003c/a\u003e\n\n\u003ca href=\"https://github.com/TheCollinsByte/Mobile-Payments-Library/pulse\"\u003e\n\u003cimg alt=\"Last Updated\" src=\"https://img.shields.io/github/last-commit/TheCollinsByte/Mobile-Payments-Library?style=flat\u0026color=e06c75\u0026label=\"\u003e \u003c/a\u003e\n\n\u003c/div\u003e\n\n\n## Description\n\nThis is open-source mobile payment library with support for M-Pesa, Tigo Pesa, Airtel Money and Halopesa. It provides a simple and intuitive API for integrating mobile payments into your applications.\n\n- [Installation](#installation)\n- [Features](#features)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n\n## Features\n- Easy integration with Vodacom (M-Pesa), Tigo (Tigo Pesa), Airtel (Airtel Money), PesaPal, SelcomPay, AzamPay and Halotel (HaloPesa)\n- Support to various payment methods\n- Extensible for other mobile payment providers\n- Detailed error handling and logging\n\n## Installation\n\n### Gradle\n\nAdd the following dependency to your `build.gradle` file:\n\n```groovy\ndependencies {\n    implementation 'com.kwawingu:mobile-payment:1.0.0'\n}\n```\n\n### Maven\n\nAdd the following dependency to your `pom.xml` file:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.kwawingu\u003c/groupId\u003e\n    \u003cartifactId\u003emobile-payment\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\n### Initialization\n\nFirst, initialize the library with your M-Pesa credentials from environment variables.\n\n```java\nMpesaKeyProviderFromEnvironment.Config config =\n        new MpesaKeyProviderFromEnvironment.Config.Builder()\n                .setApiKeyEnvName(\"MPESA_API_KEY\")\n                .setPublicKeyEnvName(\"MPESA_PUBLIC_KEY\")\n                .build();\nmpesaSessionKeyGenerator = new SessionKeyGenerator();\napiEndpoint = new ApiEndpoint(Environment.SANDBOX, Market.VODACOM_TANZANIA);\nkeyProvider = new MpesaKeyProviderFromEnvironment(config);\n```\n\nThis configuration sets up the MpesaKeyProviderFromEnvironment to retrieve the API key and public key from the specified environment variables. The SessionKeyGenerator and ApiEndpoint are also initialized for generating session keys and defining the API endpoint, respectively.\n\n### Customer To Business (C2B)\n\nThe C2B API call is used as a standard customer-to-business transaction. Funds from the customer’s mobile money wallet will be deducted and be transferred to the mobile money wallet of the business. To authenticate and authorize this transaction, M-Pesa Payments Gateway will initiate a USSD Push message to the customer to gather and verify the mobile money PIN number. This number is not stored and is used only to authorize the transaction.\n\n```java\nPayload customerToBusinessPayload =\n        new Payload.Builder()\n                .setAmount(\"10.00\")\n                .setCustomerMSISDN(\"+255-762-578-467\")\n                .setCountry(Market.VODACOM_TANZANIA.getInputCountryValue())\n                .setCurrency(Market.VODACOM_TANZANIA.getInputCurrencyValue())\n                .setServiceProviderCode(\"ORG001\")\n                .setTransactionReference(\"T12344C\")\n                .setThirdPartyConversationID(\"1e9b774d1da34af78412a498cbc28f5e\")\n                .setPurchasedItemsDesc(\"Lenovo ThinkPad X1 Carbon Gen 12\")\n                .build();\n\nCustomerToBusinessTransaction customerToBusinessTransaction =\n        new CustomerToBusinessTransaction.Builder()\n                .setApiEndpoint(new ApiEndpoint(Environment.SANDBOX, Market.VODACOM_TANZANIA))\n                .setEncryptedSessionKey(session.getEncryptedSessionKey())\n                .setPayload(customerToBusinessPayload)\n                .build();\n```\n\n\n## Contributing\n\nContributions are welcome! Please read the [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to contribute to this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n\u003cbr/\u003e\u003cbr/\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n\u003cstrong\u003e⭐ hit the star button if you found this useful ⭐\u003c/strong\u003e\u003cbr\u003e\n\n\u003ca href=\"https://github.com/TheCollinsByte/Mobile-Payments-Library\"\u003eSource\u003c/a\u003e\n| \u003ca href=\"https://x.com/TheCollinsByte\" target=\"_blank\"\u003eTwitter \u003c/a\u003e\n| \u003ca href=\"http://www.linkedin.com/in/collins-boniface\" target=\"_blank\"\u003eLinkedIn \u003c/a\u003e\n| \u003ca href=\"mailto:collo@fastmail.com\"\u003eEmail\u003c/a\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKwaWingu%2FMobile-Payments-Library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKwaWingu%2FMobile-Payments-Library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKwaWingu%2FMobile-Payments-Library/lists"}