Download the PHP package uzhlaravel/maishapay without Composer
On this page you can find all versions of the php package uzhlaravel/maishapay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download uzhlaravel/maishapay
More information about uzhlaravel/maishapay
Files in uzhlaravel/maishapay
Package maishapay
Short Description This is a laravel way to interact with maishapay.net providing good design and make it easy to use
License MIT
Homepage https://github.com/uzziahlukeka/maisha-pay
Informations about the package maishapay
This is a laravel way to interact with maishapay.com
Installation
You can install the package via composer:
- if you want to have a live account, you need to register at https://www.maishapay.net/ or https://marchand.maishapay.online/dashboard
- if you want to have a sandbox account, you need to register at https://www.maishapay.net/ or https://marchand.maishapay.online/dashboard
- you need to get your public and secret keys from the dashboard
- you can set the gateway mode to 0 for sandbox and 1 for live
automated installation
You can publish and run the migrations with:
You can publish the config file with:
This is the contents of the published config file:
Add these to your .env file:
Usage Mobile Money Payment
Automate the database
Usage Bank Payment
Automate the database transactions :
Usage B2C (Business to Customer) Payment
B2C allows your business to send money directly to a customer's mobile money wallet — useful for payouts, refunds, salaries, or commissions.
B2C with automatic database logging
Note: For B2C,
motif,customer_full_nameandcustomer_email_addressare optional (the MaishaPay API marks them as not required).amount,currency,providerandwallet_idremain required.
B2C using the static create() helper
B2C database migration
Run the additional migration to support B2C transactions:
This adds:
- A
motifcolumn tomaishapay_transactions B2Cas a validpayment_typeenum value
Querying B2C transactions
Checking transaction status from MaishaPay's servers
Instead of trusting the status stored in your local database, you can query the live status of a transaction directly from MaishaPay's Transaction Lookup API. This is useful when a callback was missed, delayed, or you simply want to confirm the real state before fulfilling an order. It works for any transaction type — Mobile Money, card, or B2C.
The lookup runs against MaishaPay's dedicated transaction endpoint
(https://marchand.maishapay.online/api/transaction/rest/v2/check) and supports
two modes:
- By merchant reference — your own
transactionReference(sent with?useRef=1). This is the default. - By MaishaPay transaction ID — the numeric ID MaishaPay returns in the initial payment response.
Quick status check (raw response)
Canonical status via EnhancedMaishapayService
Refresh the local record from the server
refreshTransactionStatus() queries MaishaPay, syncs the matching local
MaishapayTransaction record (so the database acts as a cache), and fires the
TransactionStatusUpdated event when the status changes:
Configuration
The Transaction Lookup base URL and endpoint are configurable:
| Config key | Env var | Default |
|---|---|---|
transaction_base_url |
MAISHAPAY_TRANSACTION_BASE_URL |
https://marchand.maishapay.online/api/transaction |
status_endpoint |
MAISHAPAY_STATUS_ENDPOINT |
/rest/v2/check |
The lookup posts gatewayMode, publicApiKey, secretApiKey and
transactionId (set to your merchant reference, with ?useRef=1, when looking
up by reference). The canonical status is read from MaishaPay's
transactionStatus field and normalized to PENDING, SUCCESS, FAILED or
CANCELLED.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- uzziahlukeka
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of maishapay with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0||^13.0