Logo Lanfrica
  • Accueil
  • Atlas
  • Analyses
  • Documentation
  • Sign in

© 2026 Lanfrica. Tous droits réservés. Tous les droits d'auteur des ressources affichées sur le site Web Lanfrica appartiennent aux détenteurs de droits d'auteur d'origine, sauf indication contraire explicite.

korobosta/golang-mpesa

Domaine:

digital infrastructure

Type de record:

software
Créateur:
kor
Hôte:
# What is golang-mpesa **golang-mpesa** is an golang mpesa package that helps developers to call mpesa apis without much hussle. The package helps in generating tokens, making stk push, performing transaction query requests and even saving the transactions in the database. ## How to setup Get the package with following command : ```bash go get github.com ``` ## Functions The package provides the following functions: - **GenerateMpesaToken** : For generating mpesa access tokens - **StkPush** : For making stk push to the customer phone - **GetStkPushResponse** : For getting the stk push callback data from mpesa and saving it in the database. - **DecodeStkCallbackResponse** A function for decoding mpesa stk response data. - **SaveMpesaPaymentConfirmation** : This functions takes the mpesa payment confirmation response and saves it in the database - **TransactionQuery** : This function makes the transaction query request to MPESA - **GetTransactionQueryResponse** : This is a callback function for taking transaction query response and saving the payment in the database. - **EncryptWithPublicKey** : This function encrypts the password with MPESA public key to form the security credentail Configuration: For easy configuration of the package, we have created a model called ***Config*** so that all static variables required can be initialized at once. The configuration can be done as shown below. ```Go import ( "github.com" ) //Configuration function for all static mpesa variables func MpesaConfig() mpesa.Config { var config = mpesa.Config{} //Mandatory Fiels config.MpesaConsumerKey = "your-consumer-key" config.MpesaConsumerSecret = "your-consumer-secret" config.MpesaShortCode = "your-mpesa-short code" //e.g 174379 config.Initiator = "Your initiator username" // e.g testapi config.InitiatorPassword = "Your Initation Password" // e.g Safaricom1234!! config.TransQueryOriginatorConversationID ="your transactio …

Visit

github.com

Languages

Lusengo

Similaires

harmannkibue/golang-mpesa-sdkcodeethiopia/golang-amharicGolang-Tanzania/azampayGolang-Tanzania/tra-vfd

harmannkibue/golang-mpesa-sdk

Golang SDK for seamless integration with Safaricom's Daraja API. # Daraja Golang SDK The SDK provid

codeethiopia/golang-amharic

teaching go in Amharic # golang-amharic teaching go in Amharic

Golang-Tanzania/azampay

A Golang Client for Azam Payment Gateway AZAMPAY A golang client to access the Azam Payment Ga

Golang-Tanzania/tra-vfd

tra-vfd a fully compliant golang implementation of the VFD API as specified by the Tanzania Revenue