merchants

package
v1.1.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance added in v1.1.6

type Balance struct {
	AssetIssuer string `json:"assetIssuer"`
	AssetCode   string `json:"assetCode"`
	Amount      string `json:"amount"`
	QRCode      string `json:"qrCode"`
}

Balance model for user

type BantupayAuthorizationData

type BantupayAuthorizationData struct {
	DynamicLink string `json:"dynamicLink"`
	QRCode      string `json:"qrCode"`
	AuthID      string `json:"authId"`
}

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Data    string `json:"data"`
	Message string `json:"message"`
}

type LoginWithBantupayData

type LoginWithBantupayData struct {
	DynamicLink string `json:"dynamicLink"`
	QRCode      string `json:"qrCode"`
	LoginID     string `json:"loginId"`
}

type Merchant

type Merchant struct {
	BantupayUsername string `json:"bantupayUsername" `
	BaseURL          string `json:"baseUrl"`
	KP               *keypair.Full
}

Merchant holds Merchant data model

func NewMerchant

func NewMerchant(baseUrl, merchantBantupayUsername, secretKey string) (merchantInfo *Merchant, err error)

NewMerchant retrieves merchant Info from the bantupay API

func (*Merchant) GetPaymentData

func (m *Merchant) GetPaymentData(targetUser, paymentDestination, assetCode, assetIssuer, amount, memo string) (paymentData *PayWithBantupayData, err error)

GetPaymentData verifies if authID is authorized and resturns nil

func (*Merchant) GetUserInfo added in v1.1.7

func (m *Merchant) GetUserInfo(targetUser string) (userDetail *MerchantBudsInfo, err error)

GetUserInfo gets userinfo and resturns nil

func (*Merchant) SendAuthorizationRequest

func (m *Merchant) SendAuthorizationRequest(targetUser, authDescription, deviceInfo, callbackUrl string, validityInMinutes int) (authInfo *BantupayAuthorizationData, err error)

SendAuthorizationRequest sends 2FA authorization request and retrieves QRCode and dynamic link

func (*Merchant) SendLoginRequest

func (m *Merchant) SendLoginRequest(targetUser, deviceInfo, callbackUrl string) (loginInfo *LoginWithBantupayData, err error)

SendLoginRequest sends login request and retrieves QRCode and dynamic link

func (*Merchant) SendPushNotification added in v1.1.0

func (m *Merchant) SendPushNotification(targetUser, title, message string) (err error)

SendPushNotification sends a push notification

func (*Merchant) VerifyAuthorizationRequest

func (m *Merchant) VerifyAuthorizationRequest(targetUser, authID string) (err error)

VerifyAuthorizationRequest verifies if authID is authorized and resturns nil

func (*Merchant) VerifyLoginRequest

func (m *Merchant) VerifyLoginRequest(targetUser, loginID string) (userDetail *MerchantBudsInfo, err error)

VerifyLoginRequest verifies if loginID is authorized and resturns nil

type MerchantBudsInfo

type MerchantBudsInfo struct {
	CreatedAt      string                 `json:"createdAt"`
	Username       string                 `json:"username"`
	PublicKey      string                 `json:"publicKey"`
	Email          string                 `json:"email"`
	LastName       string                 `json:"lastName"`
	FirstName      string                 `json:"firstName"`
	MiddleName     string                 `json:"middleName"`
	Mobile         string                 `json:"mobile"`
	BantuTalk      string                 `json:"bantuTalk"`
	ImageThumbnail string                 `json:"imageThumbnail"`
	Verified       uint                   `json:"verified"`
	Suspended      uint                   `json:"suspended"`
	Referrer       string                 `json:"referrer"`
	Wallet         UserBalanceForMerchant `json:"wallet"`
}

MerchantBudsInfo model for bantu user directory info

type MerchantPushNotification added in v1.1.0

type MerchantPushNotification struct {
	Title   string `json:"title,omitempty"`
	Message string `json:"message,omitempty"`
}

type MerchantRequestInput added in v1.0.9

type MerchantRequestInput struct {
	AuthDescription   string `json:"authDescription,omitempty"`
	DeviceInfo        string `json:"deviceInfo,omitempty"`
	CallbackURL       string `json:"callbackUrl,omitempty"`
	ValidityInMinutes int    `json:"validityInMinutes,omitempty"`
}

type PayWithBantupayData

type PayWithBantupayData struct {
	DynamicLink string `json:"dynamicLink"`
	QRCode      string `json:"qrCode"`
}

type UserBalanceForMerchant added in v1.1.6

type UserBalanceForMerchant struct {
	Balances []Balance `json:"balances"`
}

UserBalanceForMerchant holds user balances

Jump to

Keyboard shortcuts

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