Mpesa
Provides various methods to interact with the Daraja v2.0 M-PESA API. For the official documentation, see Safaricom developer website.
Parameters
Daraja API consumer key.
Daraja API consumer secret.
The Environment of the API. Defaults to Environment.SANDBOX.
Boolean value indicating whether to enable logging. Defaults to true if the environment is Environment.SANDBOX, false otherwise.
The HTTP client engine to use. Defaults to null, which uses the default engine for the current platform.
A cache to store access tokens. Defaults to a new Cache instance.
A lambda expression that configures the HTTP client. Defaults to a configuration that uses the provided consumer key, consumer secret, environment, and logging settings.
The HTTP client to use. Defaults to a new client configured with the provided configuration.
Constructors
Functions
Dynamic QR - Generates a dynamic M-PESA QR Code.
Account balance - Enquire the balance on an M-Pesa BuyGoods (Till Number).
Transaction status - Check the status of a transaction.
B2C - Transact between an M-Pesa short code to a phone number registered on M-Pesa.
Initiates a C2B transaction between a phone number and an M-Pesa short code registered on M-Pesa.
Initiates an STK Push (Lipa na M-Pesa Online) transaction.
STK Push query - Check the status of a Lipa Na M-Pesa Online Payment.
C2B register - Register validation and confirmation URLs on M-Pesa
Reversal - Reverses a C2B M-Pesa transaction.