contactsys

package
v0.0.0-...-dd01cc2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUpstream  = "https://online.contact-sys.com"
	DefaultPartnerID = "D5267BED-18CC-4661-B03A-65934CAE1CA4"
	DefaultRetries   = 3
	DefaultTimeout   = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bank

type Bank struct {
	BankData string `json:"bankData"`
	BankCode string `json:"bankCode"`
	Address  string `json:"address"`
}

type Client

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

func NewClient

func NewClient(opts ...Option) (*Client, error)

func (*Client) Session

func (c *Client) Session() *Session

type Country

type Country struct {
	ID   int    `json:"id"`
	Name string `json:"caption"`
	Code string `json:"code"`
}

type Option

type Option func(session *Session)

func WithPartnerID

func WithPartnerID(id string) Option

func WithUpstream

func WithUpstream(upstream string) Option

func WithVerbose

func WithVerbose(verbose bool) Option

type Session

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

func (*Session) Auth

func (s *Session) Auth(ctx context.Context) error

func (*Session) Banks

func (s *Session) Banks(ctx context.Context, country Country) ([]Bank, error)

func (*Session) Countries

func (s *Session) Countries(ctx context.Context) ([]Country, error)

func (*Session) FillTransferDetails

func (s *Session) FillTransferDetails(ctx context.Context, transaction *Transaction, details *TransferDetails) error

func (*Session) FillTransferParticipants

func (s *Session) FillTransferParticipants(ctx context.Context, transaction *Transaction, participants *TransferParticipants) error

func (*Session) StartTransaction

func (s *Session) StartTransaction(ctx context.Context, bank Bank) (*Transaction, error)

func (*Session) TransferRate

func (s *Session) TransferRate(ctx context.Context, transaction *Transaction) (float64, error)

type Transaction

type Transaction struct {
	ID string `json:"id"`
}

type TransferDetails

type TransferDetails struct {
	Amount   string `json:"trnAmount"`
	Currency string `json:"trnCurrency"`
	Source   string `json:"tSource"`
	Ground   string `json:"tGround"`
	Relation string `json:"tRelation"`
}

func RandomTransferDetails

func RandomTransferDetails(amount float64) *TransferDetails

type TransferParticipants

type TransferParticipants struct {
	*TransferSender
	*TransferRecipient
}

type TransferRecipient

type TransferRecipient struct {
	Name     string `json:"bName"`
	LastName string `json:"bLastName"`
	Country  string `json:"bCountryC"`
	City     string `json:"bCity"`
	Phone    string `json:"bPhone"`
	Address  string `json:"bAddress"`
	Sex      string `json:"bSex"`
	Account  string `json:"bAccount"`
}

func RandomTransferRecipient

func RandomTransferRecipient(country Country, bank Bank) *TransferRecipient

type TransferSender

type TransferSender struct {
	Name         string `json:"sName"`
	LastName     string `json:"sLastName"`
	BirthPlace   string `json:"sBirthPlace"`
	Country      string `json:"sCountryC"`
	IDType       string `json:"sIDtype"`
	IDNumber     string `json:"sIDnumber"`
	IDExpireDate string `json:"sIDexpireDate"`
	Birthday     string `json:"sBirthday"`
	Sex          string `json:"sSex"`
	Occupation   string `json:"sOccupation"`
}

func RandomTransferSender

func RandomTransferSender() *TransferSender

Jump to

Keyboard shortcuts

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