Skip to content

feat: add Airtel Money support, token caching, and checkAccountHolder - #9

Merged
lepresk merged 3 commits into
mainfrom
feat/airtel-and-token-cache
Mar 29, 2026
Merged

feat: add Airtel Money support, token caching, and checkAccountHolder#9
lepresk merged 3 commits into
mainfrom
feat/airtel-and-token-cache

Conversation

@lepresk

@lepresk lepresk commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add full Airtel Money API support: AirtelApi, AirtelCollectionApi, AirtelDisbursementApi
  • Add AirtelConfig and AirtelTransaction models
  • Add in-memory token caching (TokenCache) to avoid redundant OAuth requests
  • Add checkAccountHolder() to CollectionApi and DisbursementApi
  • 76 tests passing (15 new tests for Airtel + checkAccountHolder + caching)

What's new

Airtel Money

$collection = AirtelApi::collection('staging', AirtelConfig::collection(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
));
$externalId = $collection->requestToPay('5000', '068511358', 'ORDER-001');

Check Account Holder (MTN)

$active = $momo->collection()->checkAccountHolder('242068511358'); // true/false

Token Caching

Access tokens are now cached per-instance for their TTL (minus 60s buffer), eliminating redundant auth round-trips.

lepresk added 3 commits March 7, 2026 23:31
- Add AirtelApi entry point with staging/production environments
- Add AirtelCollectionApi: requestToPay, getPaymentStatus, getBalance
- Add AirtelDisbursementApi: transfer, getTransferStatus, getBalance
- Add AirtelConfig with collection() and disbursement() factory methods
- Add AirtelTransaction model with TS/TF/TIP status helpers
- Add TokenCache for in-memory token TTL caching
- Add token caching to CollectionApi and DisbursementApi
- Add checkAccountHolder() to CollectionApi and DisbursementApi
- Add unit tests for all new functionality (76 tests total)
Drop PHP 7.4/8.0/8.1 support. Upgrade symfony/http-client and
symfony/var-dumper from ^6.3 to ^7.0. Update README with Airtel Money
usage examples, API reference tables, and checkAccountHolder methods.
@lepresk
lepresk merged commit e588024 into main Mar 29, 2026
3 checks passed
@lepresk
lepresk deleted the feat/airtel-and-token-cache branch March 29, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant