broker

package
v0.0.0-...-f154cc1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

type Broker struct {
	ClientId     string
	ClientSecret string
	Token        string
	BaseURL      string
	BrokerSender string
	CallbackURL  string
}

func NewBroker

func NewBroker(clientId, clientSecret, brokerToken, brokerSender, baseURL, callbackURL string) *Broker

func (*Broker) CreditWallet

func (b *Broker) CreditWallet(requestDetails payments.MPaymentRequest) payments.MPaymentResponse

func (*Broker) DebitWallet

func (b *Broker) DebitWallet(requestDetails payments.MPaymentRequest) payments.MPaymentResponse

func (*Broker) NewError

func (b *Broker) NewError(err interface{}) error

func (*Broker) NewRequest

func (b *Broker) NewRequest(data interface{}) payments.MPaymentResponse

type Request

type Request struct {
	MSISDN       string  `json:"receiverPhone"`
	ReceiverName string  `json:"receiverName"`
	Amount       float64 `json:"amount"`
	ForeignID    string  `json:"foreignId,omitempty"`
	Provider     string  `json:"provider"`
	Sender       string  `json:"sender"`
	Token        string  `json:"token"`
	ReceiveToken string  `json:"receiveToken,omitempty"`
	Type         string  `json:"type"`
	CallbackURL  string  `json:"callbackUrl"`
}

type Response

type Response struct {
	ID          string `json:"Id,omitempty"`
	Customer    string `json:"Customer,omitempty"`
	ForeignID   string `json:"ForeignId,omitempty"`
	ProviderID  string `json:"ProviderId,omitempty"`
	ErrorCode   string `json:"ErrorCode,omitempty"`
	Description string `json:"Description,omitempty"`
}

func (Response) GetProviderID

func (r Response) GetProviderID() string

func (Response) GetResponse

func (r Response) GetResponse() interface{}

func (Response) GetTransactionID

func (r Response) GetTransactionID() string

Jump to

Keyboard shortcuts

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