Documentation ¶
Index ¶
- Constants
- func GeneratePassword(shortCode, passkey, timestamp string) string
- type B2B
- type B2C
- type BalanceInquiry
- type C2B
- type C2BRegisterURL
- type Env
- type Express
- type Pull
- type Reversal
- type Service
- func (s Service) B2BRequest(b2b B2B) (string, error)
- func (s Service) B2CRequest(b2c B2C) (string, error)
- func (s Service) BalanceInquiry(balanceInquiry BalanceInquiry) (string, error)
- func (s Service) C2BRegisterURL(c2bRegisterURL C2BRegisterURL) (string, error)
- func (s Service) C2BSimulation(c2b C2B) (string, error)
- func (s Service) GetSecurityCredential(initiatorPassword string) (string, error)
- func (s Service) PullTransactions(pull Pull) (string, error)
- func (s Service) Reversal(reversal Reversal) (string, error)
- func (s Service) Simulation(express Express) (string, error)
- func (s Service) TransactionStatus(express Express) (string, error)
Constants ¶
View Source
const ( // SANDBOX is the sandbox env tag SANDBOX = iota // PRODUCTION is the production env tag PRODUCTION )
Variables ¶
This section is empty.
Functions ¶
func GeneratePassword ¶
GeneratePassword by base64 encoding BusinessShortcode, Passkey, and Timestamp
Types ¶
type B2B ¶
type B2B struct { Initiator string SecurityCredential string CommandID string SenderIdentifierType string RecieverIdentifierType string Amount int PartyA string PartyB string Remarks string AccountReference string QueueTimeOutURL string ResultURL string }
B2B is a model
type B2C ¶
type B2C struct { InitiatorName string SecurityCredential string CommandID string Amount int PartyA string PartyB string Remarks string QueueTimeOutURL string ResultURL string Occassion string }
B2C is a model
type BalanceInquiry ¶
type BalanceInquiry struct { Initiator string SecurityCredential string CommandID string PartyA string IdentifierType string Remarks string QueueTimeOutURL string ResultURL string }
BalanceInquiry is a model
type C2BRegisterURL ¶
type C2BRegisterURL struct { ShortCode string ResponseType string ConfirmationURL string ValidationURL string }
RegisterURL is a model
type Express ¶
type Express struct { BusinessShortCode string Password string Timestamp string TransactionType string Amount int PartyA string PartyB string PhoneNumber string CallBackURL string AccountReference string TransactionDesc string }
Express is a model
type Reversal ¶
type Reversal struct { Initiator string SecurityCredential string CommandID string TransactionID string Amount int ReceiverParty string ReceiverIdentifierType string QueueTimeOutURL string ResultURL string Remarks string Occassion string }
Reversal is a model
type Service ¶
Service is an Mpesa Service
func (Service) B2BRequest ¶
B2BRequest sends a new request
func (Service) B2CRequest ¶
B2CRequest sends a new request
func (Service) BalanceInquiry ¶
func (s Service) BalanceInquiry(balanceInquiry BalanceInquiry) (string, error)
BalanceInquiry sends a balance inquiry
func (Service) C2BRegisterURL ¶
func (s Service) C2BRegisterURL(c2bRegisterURL C2BRegisterURL) (string, error)
C2BRegisterURL requests
func (Service) C2BSimulation ¶
C2BSimulation sends a new request
func (Service) GetSecurityCredential ¶
GetSecurityCredential generates a security credential The security credential depends on the environment set
func (Service) PullTransactions ¶
BalanceInquiry sends a balance inquiry
func (Service) Simulation ¶
Simulation requests user device for payment
Click to show internal directories.
Click to hide internal directories.