mbsGo

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2022 License: MIT Imports: 11 Imported by: 0

README

Steps

  1. New Client
  2. Method Call

If Statement Request

  1. New CLient
  2. New Statement Request Object
  3. Method Call

Documentation

Index

Constants

View Source
const (
	BaseUrl                        = "https://mybankstatement.net/TP/api"
	RequestStatementEndpoint       = "/RequestStatement"
	GetFeedbackByRequestIdEndpoint = "/GetFeedbackByRequestID"
	GetFeedbackByTicketNoEndpoint  = "/GetFeedbackByTicketNo"
	ConfirmStatementEndpoint       = "/ConfirmStatement"
	ReConfirmStatementEndpoint     = "/ReconfirmStatement"
	ListBanksEndpoint              = "/SelectActiveRequestBanks"
	GetStatementJSONEndpoint       = "/GetStatementJSONObject"
	GetStatementPDFEndpoint        = "/GetPDFStatement"

	Applicant = "Applicant"
	Guarantor = "Guarantor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bank

type Bank struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	SortCode string `json:"sortCode"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseUrl, clientId, clientSecret, userName, country string) *Client

func (*Client) ConfirmStatement

func (cl *Client) ConfirmStatement(ticketNumber, password string) (message string, err error)

func (*Client) GetBankList

func (cl *Client) GetBankList() (list []Bank, err error)

func (*Client) GetFeedbackByRequestID

func (cl *Client) GetFeedbackByRequestID(reqID int) (status, feedback string, err error)

func (*Client) GetFeedbackByTicketNo added in v0.0.7

func (cl *Client) GetFeedbackByTicketNo(ticketNo string) (status, feedback string, err error)

func (*Client) GetStatementJSON

func (cl *Client) GetStatementJSON(ticketNumber, password string) (st *JSONStatement, err error)

func (*Client) GetStatementPDF

func (cl *Client) GetStatementPDF(ticketNumber, password string) (base64PDF string, err error)

func (*Client) NewStatementRequestObjectWithClientDefaults added in v0.0.8

func (cl *Client) NewStatementRequestObjectWithClientDefaults(bankId int, accountNo, startDate, endDate, role, applicantName, phone string) *StatementRequestObject

func (*Client) ReConfirmStatement

func (cl *Client) ReConfirmStatement(reqID int) (message string, err error)

func (*Client) RequestStatement

func (cl *Client) RequestStatement(req *StatementRequestObject) (requestId int, err error)

type ConfirmStatementRequest

type ConfirmStatementRequest struct {
	TicketNo string `json:"ticketNo"`
	Password string `json:"password"`
}

type Feedback

type Feedback struct {
	Status   string `json:"status"`
	Feedback string `json:"feedback"`
}

type JSONStatement

type JSONStatement struct {
	Status          string `json:"status"`
	Name            string `json:"Name"`
	Nuban           string `json:"Nuban"`
	AccountCategory string `json:"AccountCategory"`
	AccountType     string `json:"AccountType"`
	TicketNo        string `json:"TicketNo"`
	AvailableBal    string `json:"AvailableBal"`
	BookBal         string `json:"BookBal"`
	TotalCredit     string `json:"TotalCredit"`
	TotalDebit      string `json:"TotalDebit"`
	Tenor           string `json:"Tenor"`
	Period          string `json:"Period"`
	Currency        string `json:"Currency"`
	Address         string `json:"Address"`
	Applicants      string `json:"Applicants"`
	Signatories     []struct {
		Name string `json:"Name"`
		BVN  string `json:"BVN"`
	} `json:"Signatories"`
	Details []struct {
		PTransactionDate string `json:"PTransactionDate"`
		PValueDate       string `json:"PValueDate"`
		PNarration       string `json:"PNarration"`
		PCredit          string `json:"PCredit"`
		PDebit           string `json:"PDebit"`
		PBalance         string `json:"PBalance"`
	} `json:"Details"`
}

type RequestId

type RequestId struct {
	RequestId int `json:"requestId"`
}

type Response

type Response struct {
	Status  string          `json:"status"`
	Message string          `json:"message"`
	Result  json.RawMessage `json:"result"`
}

type StatementRequestObject

type StatementRequestObject struct {
	AccountNo     string `json:"accountNo"`
	BankId        int    `json:"bankId"`
	DestinationId string `json:"destinationId"`
	StartDate     string `json:"startDate"`
	EndDate       string `json:"endDate"`
	Role          string `json:"role"`
	Username      string `json:"username"`
	Country       string `json:"country"`
	Phone         string `json:"phone"`
	Applicants    []struct {
		Name          string `json:"name"`
		ApplicationNo string `json:"applicationNo"`
	} `json:"applicants"`
}

func NewStatementRequestObject

func NewStatementRequestObject(bankId int, accountNo, destinationId, startDate, endDate, role, username, country, phone, applicantName string) *StatementRequestObject

func (*StatementRequestObject) Validate

func (sro *StatementRequestObject) Validate() (err error)

type TicketNo added in v0.0.7

type TicketNo struct {
	TicketNo string `json:"ticketNo"`
}

Jump to

Keyboard shortcuts

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