transferwise

package module
v0.0.0-...-42de1ee Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

README

transferwise-go

A transferwise API SDK for the Go programming language

Documentation

Transferwise API documentation

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AmericanEnglish Language = "en_US"
	BritishEnglish           = "en"
	Dutch                    = "nl"
	French                   = "fr"
	German                   = "de"
	Hungarian                = "hu"
	Italian                  = "it"
	Japanese                 = "ja"
	Korean                   = "ko"
	Polish                   = "po"
	Portugese                = "pt"
	Romanian                 = "ro"
	Russian                  = "ru"
	Spanish                  = "es"
)
View Source
var (
	DriversLicence DocumentType = "DRIVERS_LICENSE"
	IdentityCard                = "IDENTITY_CARD"
	GreenCard                   = "GREEN_CARD"
	MyNumber                    = "MY_NUMBER"
	Passport                    = "PASSPORT"
	Other                       = "OTHER"
)
View Source
var NoExpiry time.Time
View Source
var None float64 = 0.0

Functions

This section is empty.

Types

type API

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

func New

func New(token string, options ...APIOption) (*API, error)

func (*API) CreateBusinessProfile

func (a *API) CreateBusinessProfile(r BusinessProfileRequest) (*Business, error)

func (*API) CreatePersonalProfile

func (a *API) CreatePersonalProfile(r PersonalProfileRequest) (*Person, error)

func (*API) CreateProfile

func (a *API) CreateProfile(r interface{}) (*profile, error)

func (*API) GetBusiness

func (a *API) GetBusiness(id int) (*Business, error)

func (*API) GetPerson

func (a *API) GetPerson(id int) (*Person, error)

func (*API) GetProfile

func (a *API) GetProfile(id int) (*profile, error)

func (*API) PayInMethods

func (a *API) PayInMethods(id int) (*PayInMethods, error)

func (*API) Profiles

func (a *API) Profiles() ([]profile, error)

func (*API) Quote

func (a *API) Quote(r quoteRequest) (*QuoteResponse, error)

func (*API) QuoteByID

func (a *API) QuoteByID(id int) (*QuoteResponse, error)

func (*API) TemoraryQuote

func (a *API) TemoraryQuote(source, target string, targetAmount, sourceAmount float64) (*QuoteResponse, error)

func (*API) UpdateBusinessProfile

func (a *API) UpdateBusinessProfile(r BusinessProfileRequest) (*Business, error)

func (*API) UpdatePersonalProfile

func (a *API) UpdatePersonalProfile(r PersonalProfileRequest) (*Person, error)

func (*API) UpdateProfile

func (a *API) UpdateProfile(r interface{}) (*profile, error)

func (*API) VerificationDocument

func (a *API) VerificationDocument(p *Person, t DocumentType, id string, issued time.Time, country string, state string, expires time.Time) error

type APIError

type APIError struct {
	Errors []struct {
		Code      string        `json:"code"`
		Message   string        `json:"message"`
		Path      string        `json:"path"`
		Arguments []interface{} `json:"arguments"`
	} `json:"errors"`
}

func (APIError) Error

func (a APIError) Error() string

type APIOption

type APIOption func(*API) error

func WithLanguage

func WithLanguage(l Language) APIOption

func WithSandbox

func WithSandbox() APIOption

func WithURL

func WithURL(url string) APIOption

type Business

type Business struct {
	ID      int `json:"id"`
	Details struct {
		Name               string      `json:"name"`
		RegistrationNumber string      `json:"registrationNumber"`
		ACN                string      `json:"acn,omitempty"`
		ABN                string      `json:"abn,omitempty"`
		ARBN               string      `json:"arbn,omitempty"`
		CompanyType        CompanyType `json:"companyType"`
		CompanyRole        CompanyRole `json:"companyRole"`
		Description        string      `json:"description"`
		Webpage            string      `json:"webpage"`
		PrimaryAddress     int         `json:"primaryAddress"`
	} `json:"details"`
}

type BusinessProfileRequest

type BusinessProfileRequest struct {
	Name               string      `json:"name"`
	RegistrationNumber string      `json:"registrationNumber"`
	ACN                string      `json:"acn,omitempty"`
	ABN                string      `json:"abn,omitempty"`
	ARBN               string      `json:"arbn,omitempty"`
	CompanyType        CompanyType `json:"companyType"`
	CompanyRole        CompanyRole `json:"companyRole"`
	Description        string      `json:"descriptionOfBusiness"`
	Webpage            string      `json:"webpage"`
}

type CompanyRole

type CompanyRole string
var (
	Owner     CompanyRole = "OWNER"
	Director  CompanyRole = "DIRECTOR"
	OtherRole CompanyRole = "OTHER"
)

type CompanyType

type CompanyType string
var (
	Limited                     CompanyType = "LIMITED"
	Partnership                 CompanyType = "PARTNETSHIP"
	SoleTrader                  CompanyType = "SOLE_TRADER"
	LimitedByGuarantee          CompanyType = "LIMITED_BY_GUARANTEE"
	LimitedLiabilityCompany     CompanyType = "LIMITED_LIABILITY_COMPANY"
	ForProfitCorporation        CompanyType = "FOR_PROFIT_CORPORATION"
	NonProfitCorporation        CompanyType = "NON_PROFIT_COROPORATION"
	LimitedPartnership          CompanyType = "LIMITED_PARTNERSHIP"
	LimitedLiabilityPartnership CompanyType = "LIMITED_LIABILITY_PARTNERSHIP"
	GeneralPartnership          CompanyType = "GENERAL_PARTNERSHIP"
	SoleProprietorship          CompanyType = "SOLE_PROPRIETORSHIP"
	PrivateLimitedCompany       CompanyType = "PRIVATE_LIMITED_COMPANY"
	PublicLimitedCompany        CompanyType = "PUBLIC_LIMITED_COMPANY"
	Trust                       CompanyType = "TRUST"
	OtherType                   CompanyType = "OTHER"
)

type DocumentType

type DocumentType string

type Language

type Language string

type PayInMethods

type PayInMethods struct {
	Type    string `json:"type"`
	Details struct {
		PayInReference string `json:"payInReference"`
	} `json:"details"`
}

type Person

type Person struct {
	ID      int `json:"id"`
	Details struct {
		FirstName      string    `json:"firstName"`
		LastName       string    `json:"lastName"`
		DateOfBirth    time.Time `json:"dateOfBirth"`
		PhoneNumber    string    `json:"phoneNumber"`
		Avatar         string    `json:"avatar"`
		Occupation     string    `json:"occupation"`
		PrimaryAddress int       `json:"primaryAddress"`
	} `json:"details"`
}

type PersonalProfileRequest

type PersonalProfileRequest struct {
	FirstName   string `json:"firstName"`
	LastName    string `json:"lastName"`
	DateOfBirth TwDate `json:"dateOfBirth"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
}

type QuoteRequestType

type QuoteRequestType string
var (
	BalancePayout     QuoteRequestType = "BALANCE_PAYOUT"
	BalanceConversion QuoteRequestType = "BALANCE_CONVERSION"
)

type QuoteResponse

type QuoteResponse struct {
	Profile                int              `json:"profile"`
	ID                     int              `json:"id"`
	Source                 string           `json:"source"`
	Target                 string           `json:"target"`
	RateType               string           `json:"rateType"`
	TargetAmount           float64          `json:"targetAmount,omitempty"`
	SourceAmount           float64          `json:"sourceAmount,omitempty"`
	Type                   QuoteRequestType `json:"type"`
	Rate                   float64          `json:"rate"`
	Created                time.Time        `json:"createdTime"`
	UserID                 int              `json:"createdByUserId"`
	DeliveryEstimate       time.Time        `json:"deliveryEstimate"`
	Fee                    float64          `json:"fee"`
	AllowedProfileTypes    []string         `json:"allowedProfileTypes"`
	GuaranteedTargetAmount bool             `json:"guaranteedTargetAmount,omitempty"`
	OfSourceAmount         bool             `json:"ofSourceAmount,omitempty"`
}

type ReqOption

type ReqOption func(*http.Request) error

func WithReqLanguage

func WithReqLanguage(l Language) ReqOption

type TwDate

type TwDate struct {
	time.Time
}

func (*TwDate) MarshalJSON

func (d *TwDate) MarshalJSON() ([]byte, error)

func (*TwDate) UnmarshalJSON

func (d *TwDate) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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