Documentation ¶
Index ¶
Constants ¶
View Source
const Authentication_url = "https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials"
View Source
const Lipa_na_mpesa_url = "https://sandbox.safaricom.co.ke/mpesa/stkpush/v1/processrequest"
Variables ¶
This section is empty.
Functions ¶
func SecurityCredentials ¶
`SecurityCredentials` - This function is for generating the `SecurityCredentials` used in the parameters for mpesa API `password` is the 'Initiator Security Password' `cert_file` is the contents of the cetificate(Leaving the getting of the file to the user)
Types ¶
type Auth ¶
func (*Auth) GetAuthKey ¶
type LipaNaMpesaPayStruct ¶
type LipaNaMpesaPayStruct struct {
BusinessShortCode, Password, Timestamp string
TransactionType, Amount, PartyA, PartyB string
PhoneNumber, CallBackURL, AccountReference, TransactionDesc string
}
func (*LipaNaMpesaPayStruct) GenPasswordAndAssign ¶
func (l *LipaNaMpesaPayStruct) GenPasswordAndAssign(pass_key string)
func (*LipaNaMpesaPayStruct) LipaNaMpesaPayment ¶
func (l *LipaNaMpesaPayStruct) LipaNaMpesaPayment(a *Auth, pass_key string) (LipaNaMpesaResp, error)
`LipaNaMpesaPayment` - 'Lipa na M-Pesa Online Payment' Lipa na M-Pesa Online Payment API is used to initiate a M-Pesa transaction on behalf of a customer using STK Push. This is the same technique mySafaricom App uses whenever the app is used to make payments.
type LipaNaMpesaResp ¶
type LipaNaMpesaResp map[string]interface{}
Click to show internal directories.
Click to hide internal directories.