Documentation
¶
Index ¶
- Constants
- func B2CPaymentDB(pb *b2c.B2CPayment) (*b2c_model.Payment, error)
- func B2CPaymentPB(db *b2c_model.Payment) (*b2c.B2CPayment, error)
- func GetDailyStatDB(pb *b2c.DailyStat) (*b2c_model.DailyStat, error)
- func GetDailyStatPB(db *b2c_model.DailyStat) (*b2c.DailyStat, error)
- func GetMpesaB2CPushKey(msisdn string) string
- func GetMpesaRequestKey(requestId string) string
- func NewB2CAPI(ctx context.Context, opt *Options) (b2c.B2CAPIServer, error)
- func ValidateOptionB2C(opt *OptionB2C) error
- func ValidateOptions(opt *Options) error
- func ValidatePayment(paymentPB *b2c.B2CPayment) error
- type OptionB2C
- type Options
Constants ¶
View Source
const SourceKey = "source"
Variables ¶
This section is empty.
Functions ¶
func B2CPaymentDB ¶
func B2CPaymentDB(pb *b2c.B2CPayment) (*b2c_model.Payment, error)
B2CPaymentDB is wrapper to converts database model to protobuf b2c payment
func B2CPaymentPB ¶
func B2CPaymentPB(db *b2c_model.Payment) (*b2c.B2CPayment, error)
B2CPaymentPB is wrapper to converts protobuf b2c payment to database model
func GetDailyStatDB ¶
GetDailyStatDB gets mpesa statistics model from protobuf message
func GetDailyStatPB ¶
GetDailyStatPB gets mpesa statistics protobuf from model
func GetMpesaB2CPushKey ¶ added in v1.2.3
GetMpesaSTKPushKey retrives key storing initiator key
func GetMpesaRequestKey ¶ added in v1.2.3
GetMpesaRequestKey is key that initiates data
func ValidateOptionB2C ¶ added in v1.2.6
ValidateOptionB2C validates b2c options
func ValidateOptions ¶
ValidateOptions validates options required by stk service
func ValidatePayment ¶
func ValidatePayment(paymentPB *b2c.B2CPayment) error
ValidatePayment validates b2c payment
Types ¶
type OptionB2C ¶ added in v1.2.6
type OptionB2C struct { ConsumerKey string ConsumerSecret string AccessTokenURL string QueueTimeOutURL string ResultURL string InitiatorUsername string InitiatorPassword string InitiatorEncryptedPassword string PublicKeyCertificateFile string // contains filtered or unexported fields }
OptionB2C contains options for doing b2c with mpesa
type Options ¶
type Options struct { PublishChannel string QueryBalanceURL string B2CURL string ReversalURL string SQLDB *gorm.DB RedisDB *redis.Client Logger grpclog.LoggerV2 AuthAPI auth.API HTTPClient httpClient OptionB2C *OptionB2C TransactionCharges float32 }
Options contains options for starting b2c service
Click to show internal directories.
Click to hide internal directories.