mpesa

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthToken

func AuthToken(publicKeyString string, apiKey string) (string, error)

AuthToken to be used as bearer token invoking mpesa api ref: https://developer.mpesa.vm.co.mz/documentation/

Types

type C2BRequest

type C2BRequest struct {
	TransactionReference string
	ThirdPartyReference  string
	CustomerMSISDN       string
	Amount               string
}

type C2BResponse

type C2BResponse struct {
	Success             bool
	ThirdPartyReference string
	ConversationId      string
	TransactionId       string
	ResponseCode        string
	ResponseDescription string
}

type Client

type Client struct {
	Config Config
}

func (*Client) C2B

func (client *Client) C2B(params C2BRequest) (C2BResponse, error)

C2B Customer to Business

type Config

type Config struct {
	PublicKey string
	ApiKey    string
	Host      string

	ServiceProviderCode string
	// contains filtered or unexported fields
}

func (*Config) SetDefaults

func (config *Config) SetDefaults()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL