Documentation ¶
Index ¶
- Constants
- 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) PullTransactions(pull Pull) (string, error)
- func (s Service) Reversal(reversal Reversal) (string, error)
- func (s Service) Simulation(express Express) (Transaction, error)
- func (s Service) TransactionStatus(transaction Transaction) (string, error)
- type Transaction
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 ¶
This section is empty.
Types ¶
type B2B ¶
type B2B struct { Initiator string SecurityCredential string CommandID string SenderIdentifierType string RecieverIdentifierType string Amount string 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 string 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 C2B ¶
type C2B struct { ShortCode string CommandID string Amount string Msisdn string BillRefNumber string }
C2B 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 string 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 string 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) PullTransactions ¶
BalanceInquiry sends a balance inquiry
func (Service) Simulation ¶
func (s Service) Simulation(express Express) (Transaction, error)
Simulation requests user device for payment
func (Service) TransactionStatus ¶
func (s Service) TransactionStatus(transaction Transaction) (string, error)
TransactionStatus gets status of a transaction
Click to show internal directories.
Click to hide internal directories.