Versions in this module Expand all Collapse all v1 v1.0.1 Dec 4, 2023 v1.0.0 Dec 4, 2023 Changes in this version + const ENVIRONMENT_PRODUCTION + const ENVIRONMENT_SANDBOX + const ExpressDefaultCallBackURL + func MapExpressGinCallBack(gingroup *gin.RouterGroup, callBackUrl string, callback ExpressCallBackFunc) + type Authorization struct + type B2BPayload struct + Amount string + CommandID string + InitiatorName string + Occasion string + PartyA string + PartyB string + PassKey string + QueueTimeOutURL string + Remarks string + ResultURL string + type B2BResponse struct + ConversationID string + OriginatorConversationID string + ResponseDescription string + type B2CCommandID string + const B2CCommandIDBusinessPayment + const B2CCommandIDPromotionPayment + const B2CCommandIDSalaryPayment + type B2CPayload struct + Amount string + CommandID B2CCommandID + InitiatorName string + Occasion string + PartyA string + PartyB string + PassKey string + QueueTimeOutURL string + Remarks string + ResultURL string + type B2CResponse struct + ConversationID string + OriginatorConversationID string + ResponseDescription string + type BalanceQuery struct + CommandID string + IdentifierType string + Initiator string + PartyA string + QueueTimeOutURL string + Remarks string + ResultURL string + SecurityCredential string + type C2BPayload struct + Amount string + BillRefNumber string + CommandID string + Msisdn string + ShortCode string + type C2BRegistrationPayload struct + ConfirmationURL string + ResponseType string + ShortCode string + ValidationURL string + type C2BRegistrationResponse struct + ConversationID string + OriginatorConversationID string + ResponseDescription string + type C2BResponse struct + ConversationID string + OriginatorConversationID string + ResponseDescription string + type C2BURLRegistration struct + ConfirmationURL string + ResponseType string + ShortCode string + ValidationURL string + type CallbackResponse struct + Body struct{ ... } + type DarajaApi struct + ConsumerKey string + ConsumerSecret string + func NewDarajaApi(consumerKey, consumerSecret string, environment Environment) *DarajaApi + func (d *DarajaApi) Authorize() (*Authorization, error) + func (d *DarajaApi) MakeB2BPayment(b2c B2BPayload, certPath string) (*B2CResponse, *ErrorResponse) + func (d *DarajaApi) MakeB2CPayment(b2c B2CPayload, certPath string) (*B2CResponse, *ErrorResponse) + func (d *DarajaApi) MakeC2BPayment(c2b C2BPayload) (*C2BResponse, *ErrorResponse) + func (d *DarajaApi) MakeC2BPaymentV2(c2b C2BPayload) (*C2BResponse, *ErrorResponse) + func (d *DarajaApi) MakeQRCodeRequest(payload QRPayload) (*QRResponse, *ErrorResponse) + func (d *DarajaApi) MakeSTKPushRequest(mpesaConfig LipaNaMpesaPayload) (*LipaNaMpesaResponse, *ErrorResponse) + func (d *DarajaApi) QuerySTKPushStatus(mpesaConfig STKPushStatusPayload) (*STKPushStatusResponse, *ErrorResponse) + func (d *DarajaApi) RegisterC2BCallback(payload C2BRegistrationPayload) (*C2BRegistrationResponse, *ErrorResponse) + func (d *DarajaApi) ReverseTransaction(transation ReversalPayload, certPath string) (*ReversalResponse, *ErrorResponse) + type Environment string + type ErrorResponse struct + ErrorCode string + ErrorMessage string + Raw []byte + RequestID string + func (e ErrorResponse) Error() string + type ExpressCallBackFunc func(response *CallbackResponse, request *http.Request, err error) + type LipaNaMpesaPayload struct + AccountReference string + Amount string + BusinessShortCode string + CallBackURL string + PartyA string + PartyB string + Password string + PhoneNumber string + Timestamp string + TransactionDesc string + TransactionType string + type LipaNaMpesaResponse struct + CheckoutRequestID string + CustomerMessage string + MerchantRequestID string + ResponseCode string + ResponseDescription string + type QRPayload struct + Amount int + CreditPartyIdentifier string + MerchantName string + RefNo string + TransactionType TransactionType + type QRResponse struct + QRCode string + RequestID string + ResponseCode string + ResponseDescription string + type RegisterURLConfig struct + ConfirmationURL string + ResponseType string + ShortCode string + ValidationURL string + type ReversalPayload struct + Amount string + CommandID string + Initiator string + Occasion string + PassKey string + QueueTimeOutURL string + ReceiverParty string + RecieverIdentifierType string + Remarks string + ResultURL string + TransactionID string + type ReversalResponse struct + ConversationID string + OriginatorConversationID string + ResponseDescription string + type STKPushStatusPayload struct + BusinessShortCode string + CheckoutRequestID string + Password string + Timestamp string + type STKPushStatusResponse struct + CheckoutRequestID string + MerchantRequestID string + ResponseCode string + ResponseDescription string + ResultCode string + ResultDesc string + type TransactionStatus struct + CommandID string + IdentifierType string + Initiator string + Occasion string + PartyA string + QueueTimeOutURL string + Remarks string + ResultURL string + SecurityCredential string + TransactionID string + type TransactionType string + const TransactionTypeBuyGoods + const TransactionTypePayBill + const TransactionTypeSendMoney + const TransactionTypeSendtoBusiness + const TransactionTypeWithdraw