Skip to content

Conversation

@sathwikshetty33
Copy link
Contributor

🚀 Airtel Money Payment Adapter Integration

This PR introduces a new payment adapter for Airtel Money, enabling mobile money payments across 14 countries through the EasySwitch SDK. Addresses issue #48


✨ What's New

  • New Adapter: AirtelMoneyAdapter following the established EasySwitch adapter pattern
  • Multi-country Support: Integration covers 14 African markets where Airtel Money operates
  • OAuth 2.0 Authentication: Implements automatic token management and refresh
  • Mobile Money Workflows: Supports USSD push and app-based payment flows

🌍 Supported Countries & Currencies

Region Countries & Currencies
East Africa Uganda (UGX), Tanzania (TZS), Kenya (KES), Rwanda (RWF), Burundi (BIF)
Southern Africa Zambia (ZMW), Malawi (MWK), Zimbabwe (ZWL), Botswana (BWP)
West Africa Nigeria (NGN), Ghana (GHS), Senegal/Guinea-Bissau (XOF)
Central Africa DR Congo (CDF), Ethiopia (ETB)

🔧 Key Features

✅ Payment initialization (collection requests)
✅ Transaction status checking
✅ Webhook validation with HMAC-SHA256
✅ Refund support
✅ Transaction detail retrieval
✅ Automatic OAuth token refresh
✅ Phone number validation and formatting
✅ Multi-currency and multi-country headers


📋 Implementation Details

🔐 Authentication

  • Flow: OAuth 2.0 client credentials
  • Features:
    • Automatic token caching and refresh (5 min buffer before expiry)
    • Requires: client_id, client_secret, api_key

💸 Payment Flow

  • Mobile-first: Uses phone numbers (MSISDN) as primary identifier
  • Customer Experience: Push notifications to the customer's mobile device
  • No web payment links: Fully USSD/App-based

📊 Status Mapping

Airtel Status EasySwitch Status
TS SUCCESSFUL
TF FAILED
TA / TP PENDING
TR REFUNDED
TC CANCELLED

🔒 Webhook Security

  • HMAC-SHA256 signature validation
  • Supports both x-airtel-signature and x-signature headers

🏗️ Architecture

  • Follows the same pattern as PaystackAdapter
  • Inherits from BaseAdapter
  • Implements all required abstract methods
  • Registered via @AdaptersRegistry.register()
  • Consistent error handling with PaymentError
  • Returns standardized response types

🚫 Unsupported Operations

Transaction Cancellation:
Not supported by the Airtel Money API (raises UnsupportedOperationError).


@sathwikshetty33 sathwikshetty33 changed the title dd Airtel Money payment adapter Add Airtel Money payment adapter Oct 11, 2025
Copy link
Collaborator

@Einswilli Einswilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!
Thanks for contributions...

Can we have a full usage example with detailed explanation for the doc under docs/assets/examples/airtel.md??? (maybe in a new PR)
And if possible add some screenshots.

@sathwikshetty33
Copy link
Contributor Author

sathwikshetty33 commented Oct 13, 2025

@Einswilli Thank You, I had a few queries, will this be merged after the docs pr and for the docs pr can you create an issue with the tag hacktoberfest attached so that is also considered for hacktoberfest.

Thank you!

@Einswilli
Copy link
Collaborator

@Einswilli Thank You, I had a few queries, will this be merged after the docs pr and for the docs pr can you create an issue with the tag hacktoberfest attached so that is also considered for hacktoberfest.

Thank you!

Sure @sathwikshetty33 !

@Einswilli Einswilli merged commit 42e64dd into AllDotPy:master Oct 13, 2025
1 check passed
@Einswilli
Copy link
Collaborator

Can you self assign the issue #48 please @sathwikshetty33 ???

@sathwikshetty33
Copy link
Contributor Author

Can you self assign the issue #48 please @sathwikshetty33 ???

@Einswilli I am unable to self assign andd also it would be really helpful if you could create an issue for airtel money docs and assign that to me!

@Einswilli
Copy link
Collaborator

Can you self assign the issue #48 please @sathwikshetty33 ???

@Einswilli I am unable to self assign andd also it would be really helpful if you could create an issue for airtel money docs and assign that to me!

Okay, just leave a comment and i'll be able to assign it to you for the Hacktoberfest.

@Einswilli Einswilli added enhancement New feature or request Adapters EasySwitch Adapter for a mobile money provider support Hacktoberfest-accepted labels Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Adapters EasySwitch Adapter for a mobile money provider support enhancement New feature or request Hacktoberfest-accepted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants