Methods
-
accountBalance(required String queueTimeOutURL, required String resultURL})
→ Future<MpesaResponse>
-
Enquire the balance on an M-Pesa BuyGoods (Till Number)
remarks
Comments that are sent along with the transaction. Sentence of up to 100 characters
queueTimeOutURL
This is the URL to be specified in your request that will be used by API Proxy to send notification incase the payment request is timed out while awaiting processing in the queue.
resultURL
This is the URL to be specified in your request that will be used by M-PESA to send notification upon processing of the payment request.
-
b2bBuyGoodsTransaction({required String shortCode, required double amount, required String queueTimeOutURL, required String resultURL})
→ Future<MpesaResponse>
-
A transfer of funds from one Organization's Working Account to another Organization's Merchant Account.
shortCode
This is the customer business number to receive the amount.
amount
The amount of money being sent to the customer.
remarks
Comments that are sent along with the transaction. Sentence of up to 100 characters
queueTimeOutURL
This is the URL to be specified in your request that will be used by API Proxy to send notification incase the payment request is timed out while awaiting processing in the queue.
resultURL
This is the URL to be specified in your request that will be used by M-PESA to send notification upon processing of the payment request.
-
b2bPaybillTransaction({required String shortCode, required double amount, required String accountReference, required String queueTimeOutURL, required String resultURL})
→ Future<MpesaResponse>
-
This is a transfer of funds from one Organization's Working Account to another Organization's Utility Account.
shortCode
This is the customer business number to receive the amount.
amount
The amount of money being sent to the customer.
accountReference
Any additional information to be associated with the transaction. Sentence of upto 100 characters
remarks
Comments that are sent along with the transaction. Sentence of up to 100 characters
queueTimeOutURL
This is the URL to be specified in your request that will be used by API Proxy to send notification incase the payment request is timed out while awaiting processing in the queue.
resultURL
This is the URL to be specified in your request that will be used by M-PESA to send notification upon processing of the payment request.
-
b2bTransaction({required String shortCode, required IdentifierType identifierType, required double amount, String? accountReference, required String queueTimeOutURL, required String resultURL, required BbCommandId commandID})
→ Future<MpesaResponse>
-
The Business to Business (B2B) API is used to transfer money from one business to another business.
shortCode
This is the customer business number to receive the amount.
amount
The amount of money being sent to the customer.
identifierType
Type of organization receiving the transaction
accountReference
Any additional information to be associated with the transaction. Sentence of upto 100 characters
commandID
This is a unique command that specifies B2B transaction type. (BusinessPayBill, BusinessBuyGoods, DisburseFundsToBusiness, BusinessToBusinessTransfer, MerchantToMerchantTransfer)
remarks
Comments that are sent along with the transaction. Sentence of up to 100 characters
queueTimeOutURL
This is the URL to be specified in your request that will be used by API Proxy to send notification incase the payment request is timed out while awaiting processing in the queue.
resultURL
This is the URL to be specified in your request that will be used by M-PESA to send notification upon processing of the payment request.
-
b2cTransaction({required String phoneNumber, required double amount, required String occassion, required String queueTimeOutURL, required String resultURL, BcCommandId commandID = BcCommandId.BusinessPayment})
→ Future<MpesaResponse>
-
B2C API is an API used to make payments from a Business to Customers (Pay Outs). Also known as Bulk Disbursements. B2C API is used in several scenarios by businesses that require to either make Salary Payments, Cashback payments, Promotional Payments(e.g. betting winning payouts), winnings, financial institutions withdrawal of funds, loan disbursements etc.
phoneNumber
This is the customer mobile number to receive the amount. - The number should have the country code (254) without the plus sign.
amount
The amount of money being sent to the customer.
commandID
This is a unique command that specifies B2C transaction type.(BusinessPayment, SalaryPayment, PromotionPayment)
remarks
Comments that are sent along with the transaction. Sentence of up to 100 characters
queueTimeOutURL
This is the URL to be specified in your request that will be used by API Proxy to send notification incase the payment request is timed out while awaiting processing in the queue.
resultURL
This is the URL to be specified in your request that will be used by M-PESA to send notification upon processing of the payment request.
-
c2bOnlineSimulation({required String phoneNumber, required double amount, String? billRefNumber, CbCommandID commandID = CbCommandID.CustomerPayBillOnline})
→ Future<MpesaResponse>
-
Make payment requests from Client to Business (C2B). Simulate is available on sandbox only
phoneNumber
This is the phone number initiating the C2B transaction.
amount
This is the amount being transacted. The parameter expected is a numeric value.
billRefNumber
This is used on CustomerPayBillOnline option only. This is where a customer is expected to enter a unique bill identifier, e.g. an Account Number. Alpha-Numeric less then 20 digits.
commandID
This is a unique identifier of the transaction type. (CustomerPayBillOnline, CustomerBuyGoodsOnline)
-
lipanaMpesaOnline({required String phoneNumber, required double amount, required String accountReference, required String transactionDesc, required String callBackURL})
→ Future<MpesaResponse>
-
LIPA NA M-PESA ONLINE API also know as M-PESA express (STK Push) is a Merchant/Business initiated C2B (Customer to Business) Payment.
phoneNumber
The Mobile Number to receive the STK Pin Prompt.
amount
The amount of money being sent to the customer.
accountReference
Account Reference: This is an Alpha-Numeric parameter that is defined by your system as an Identifier of the transaction for CustomerPayBillOnline transaction type. Maximum of 12 characters.
transactionDesc
This is any additional information/comment that can be sent along with the request from your system. Any string between 1 and 13 characters.
callBackURL
A CallBack URL is a valid secure URL that is used to receive notifications from M-Pesa API. It is the endpoint to which the results will be sent by M-Pesa API.
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a non-existent method or property is accessed. [...]
inherited
-
reversalTransaction({required String transactionID, required double amount, required String occassion, required String queueTimeOutURL, required String resultURL})
→ Future<MpesaResponse>
-
Reverses a B2B, B2C or C2B M-Pesa transaction.
transactionID
This is the Mpesa Transaction ID of the transaction which you wish to reverse.
amount
The amount of money being sent to the customer.
occassion
Any additional information to be associated with the transaction. Sentence of upto 100 characters
remarks
Comments that are sent along with the transaction. Sentence of up to 100 characters
queueTimeOutURL
This is the URL to be specified in your request that will be used by API Proxy to send notification incase the payment request is timed out while awaiting processing in the queue.
resultURL
This is the URL to be specified in your request that will be used by M-PESA to send notification upon processing of the payment request.
-
stkPushQuery({required String checkoutRequestID})
→ Future<MpesaResponse>
-
Use this API to check the status of a Lipa Na M-Pesa Online Payment.
checkoutRequestID
This is a global unique identifier of the processed checkout transaction request.
-
toString()
→ String
-
A string representation of this object. [...]
inherited
-
transactionStatus({required String transactionID, required IdentifierType identifierType, required String occassion, required String queueTimeOutURL, required String resultURL})
→ Future<MpesaResponse>
-
Check the status of a transaction
transactionID
This is the Mpesa Transaction ID of the transaction which you wish to reverse.
identifierType
Type of organization receiving the transaction (MSISDN, TillNumber, OrganizationShortCode)
occassion
Any additional information to be associated with the transaction. Sentence of upto 100 characters
remarks
Comments that are sent along with the transaction. Sentence of up to 100 characters
queueTimeOutURL
This is the URL to be specified in your request that will be used by API Proxy to send notification incase the payment request is timed out while awaiting processing in the queue.
resultURL
This is the URL to be specified in your request that will be used by M-PESA to send notification upon processing of the payment request.