treezor

package module
v0.0.0-...-2a3a929 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: BSD-3-Clause Imports: 19 Imported by: 0

README

Treezor SDK

This package provides an http client to Treezor API (https://www.treezor.com/api-documentation/) written in Go.

Generate accessors

Run make gen to generate structures' accessors.

Documentation

Index

Constants

View Source
const (
	Noop    int = 0
	Foreign     = 1
	Online      = 2
	ATM         = 4
	NFC         = 8
	All         = 15
)

Available permissions for a card.

View Source
const (
	ErrCodeCardWrongPIN = 32056
	ErrCodeCardLost     = 32095
	ErrCodeCardStolen   = 32096
	ErrCodeCardBlocked  = 32111
)

Error code for given status

View Source
const (
	DocumentStatusPending   = "PENDING"
	DocumentStatusCanceled  = "CANCELED"
	DocumentStatusValidated = "VALIDATED"
)

Treezor document status

View Source
const (
	PoliceRecord                DocumentType = 2
	CompanyRegistration                      = 4
	CV                                       = 6
	SwornStatement                           = 7
	Turnover                                 = 8
	IdentityCard                             = 9
	BankIdentityStatement                    = 11
	ProofOfAddress                           = 12
	MobilePhoneInvoice                       = 13
	Invoice                                  = 14
	ResidencePermit                          = 15
	DrivingLicense                           = 16
	Passport                                 = 17
	EmployeeProxy                            = 18
	OfficialCompanyRegistration              = 19
	TaxCertificate                           = 20
	EmployeePaymentNotice                    = 21
	UserBankStatement                        = 22
	BusinessLegalStatus                      = 23
	TaxStatement                             = 24
	ExemptionStatement                       = 25
)

All the types of Document Treezor accepts.

View Source
const (
	ErrCodeInsuficientFunds = 15030
)

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

func ConvertPermissions

func ConvertPermissions(permissions int) string

ConvertPermissions map binary field of card permission to an internal value at Treezor which groups those permissions.

e.g.: ConvertPermissions(ATM|Foreign) returns TRZ-CU-006.

ConvertPermissions(All) returns TRZ-CU-016.

func Float64

func Float64(v float64) *float64

Float64 is a helper routine that allocates a new float64 value to store v and returns a pointer to it.

func Int

func Int(v int) *int

Int is a helper routine that allocates a new int value to store v and returns a pointer to it.

func Int64

func Int64(v int64) *int64

Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

func Stringify

func Stringify(message interface{}) string

Stringify attempts to create a reasonable string representation of types in the Treezor library. It does things like resolve pointers to their values and omits struct fields with nil values.

Types

type Access

type Access struct {
	IdempotencyKey *string `json:"accessTag,omitempty"`
	UserID         *string `json:"accessUserId,omitempty"`
	UserIP         *string `json:"accessUserIp,omitempty"`
}

Access contains global keys to all Treezor objects.

func (*Access) GetIdempotencyKey

func (a *Access) GetIdempotencyKey() string

GetIdempotencyKey returns the IdempotencyKey field if it's non-nil, zero value otherwise.

func (*Access) GetUserID

func (a *Access) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

func (*Access) GetUserIP

func (a *Access) GetUserIP() string

GetUserIP returns the UserIP field if it's non-nil, zero value otherwise.

type AdditionalDataOneOf

type AdditionalDataOneOf struct {
	AdditionalData struct {
		Card struct {
			ExternalProvider struct {
				TransactionReference string `json:"transactionReference"`
			} `json:"externalProvider"`
		} `json:"card"`
	} `json:"additionalData"`
	Message string
}

func (*AdditionalDataOneOf) UnmarshalJSON

func (t *AdditionalDataOneOf) UnmarshalJSON(data []byte) error

type Balance

type Balance struct {
	Access
	WalletID          *string         `json:"walletId,omitempty"`
	CurrentBalance    *float64        `json:"currentBalance,string,omitempty"`
	Authorizations    *float64        `json:"authorizations,string,omitempty"`
	AuthorizedBalance *float64        `json:"authorizedBalance,string,omitempty"`
	Currency          Currency        `json:"currency,omitempty"`
	CalculationDate   *TimestampParis `json:"calculationDate,omitempty"`
}

Balance represents the balance on a wallet.

func (*Balance) GetAuthorizations

func (b *Balance) GetAuthorizations() float64

GetAuthorizations returns the Authorizations field if it's non-nil, zero value otherwise.

func (*Balance) GetAuthorizedBalance

func (b *Balance) GetAuthorizedBalance() float64

GetAuthorizedBalance returns the AuthorizedBalance field if it's non-nil, zero value otherwise.

func (*Balance) GetCalculationDate

func (b *Balance) GetCalculationDate() TimestampParis

GetCalculationDate returns the CalculationDate field if it's non-nil, zero value otherwise.

func (*Balance) GetCurrentBalance

func (b *Balance) GetCurrentBalance() float64

GetCurrentBalance returns the CurrentBalance field if it's non-nil, zero value otherwise.

func (*Balance) GetWalletID

func (b *Balance) GetWalletID() string

GetWalletID returns the WalletID field if it's non-nil, zero value otherwise.

type BalanceOptions

type BalanceOptions struct {
	ListOptions

	WalletID string `url:"walletId,omitempty"`
	UserID   string `url:"userId,omitempty"`
}

BalanceOptions specifies the optional parameters to the BalanceService.List.

type BalanceResponse

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

BalanceResponse represents a list of balances on multiple wallets. It may contain only one item.

func (*BalanceResponse) GetBalances

func (b *BalanceResponse) GetBalances() []*Balance

GetBalances returns the Balances field.

type BalanceService

type BalanceService service

BalanceService handles communication with the balance related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/balance

func (*BalanceService) List

List the balances for the authenticated user. If WalletID is provided, list one balance for the specified wallet; if UserID is provided, list all the balances for the user's wallets.

type BearerAuthTransport

type BearerAuthTransport struct {
	AccessToken string // Treezor AccessToken

	// Transport is the underlying HTTP transport to use when making requests.
	// It will default to http.DefaultTransport if nil.
	Transport http.RoundTripper
}

BearerAuthTransport is an http.RoundTripper that authenticates all requests using HTTP Bearer Authentication with the provided access token.

func (*BearerAuthTransport) Client

func (t *BearerAuthTransport) Client() *http.Client

Client returns an *http.Client that makes requests that are authenticated using HTTP Basic Authentication.

func (*BearerAuthTransport) RoundTrip

func (t *BearerAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface.

type Beneficiary

type Beneficiary struct {
	BeneficiaryID                      *json.Number       `json:"id,omitempty"`
	UserID                             *json.Number       `json:"userId,omitempty"`
	Tag                                *string            `json:"tag,omitempty"`
	NickName                           *string            `json:"nickName,omitempty"`
	Name                               *string            `json:"name,omitempty"`
	Address                            *string            `json:"address,omitempty"`
	EncryptedIBAN                      *string            `json:"iban,omitempty"`
	BIC                                *string            `json:"bic,omitempty"`
	SEPACreditorIdentifier             *string            `json:"sepaCreditorIdentifier,omitempty"`
	UsableForSCT                       *bool              `json:"usableForSct,omitempty"`
	SDDCoreKnownUniqueMandateReference []string           `json:"sddCoreKnownUniqueMandateReference,omitempty"`
	SDDCoreBlacklist                   []string           `json:"sddCoreBlacklist,omitempty"`
	SDDB2BWhitelist                    []*SDDB2BWhitelist `json:"sddB2bWhitelist,omitempty"`
}

Beneficiary represents a beneficiary.

func (*Beneficiary) GetAddress

func (b *Beneficiary) GetAddress() string

GetAddress returns the Address field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetBIC

func (b *Beneficiary) GetBIC() string

GetBIC returns the BIC field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetBeneficiaryID

func (b *Beneficiary) GetBeneficiaryID() json.Number

GetBeneficiaryID returns the BeneficiaryID field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetEncryptedIBAN

func (b *Beneficiary) GetEncryptedIBAN() string

GetEncryptedIBAN returns the EncryptedIBAN field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetName

func (b *Beneficiary) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetNickName

func (b *Beneficiary) GetNickName() string

GetNickName returns the NickName field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetSDDB2BWhitelist

func (b *Beneficiary) GetSDDB2BWhitelist() []*SDDB2BWhitelist

GetSDDB2BWhitelist returns the SDDB2BWhitelist field.

func (*Beneficiary) GetSDDCoreBlacklist

func (b *Beneficiary) GetSDDCoreBlacklist() []string

GetSDDCoreBlacklist returns the SDDCoreBlacklist field.

func (*Beneficiary) GetSDDCoreKnownUniqueMandateReference

func (b *Beneficiary) GetSDDCoreKnownUniqueMandateReference() []string

GetSDDCoreKnownUniqueMandateReference returns the SDDCoreKnownUniqueMandateReference field.

func (*Beneficiary) GetSEPACreditorIdentifier

func (b *Beneficiary) GetSEPACreditorIdentifier() string

GetSEPACreditorIdentifier returns the SEPACreditorIdentifier field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetTag

func (b *Beneficiary) GetTag() string

GetTag returns the Tag field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetUsableForSCT

func (b *Beneficiary) GetUsableForSCT() bool

GetUsableForSCT returns the UsableForSCT field if it's non-nil, zero value otherwise.

func (*Beneficiary) GetUserID

func (b *Beneficiary) GetUserID() json.Number

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

type BeneficiaryOptions

type BeneficiaryOptions struct {
	UserID string `url:"userId,omitempty"`
}

BeneficiaryOptions specifies the optional parameters to the BeneficiaryService.List.

type BeneficiaryRequest

type BeneficiaryRequest struct {
	Access
	BeneficiaryID                      *string            `json:"id,omitempty"`
	UserID                             *string            `json:"userId,omitempty"`
	Tag                                *string            `json:"tag,omitempty"`
	NickName                           *string            `json:"nickName,omitempty"`
	Name                               *string            `json:"name,omitempty"`
	Address                            *string            `json:"address,omitempty"`
	IBAN                               *string            `json:"iban,omitempty"`
	BIC                                *string            `json:"bic,omitempty"`
	SEPACreditorIdentifier             *string            `json:"sepaCreditorIdentifier,omitempty"`
	UsableForSCT                       *bool              `json:"usableForSct,omitempty"`
	SDDCoreKnownUniqueMandateReference *[]string          `json:"sddCoreKnownUniqueMandateReference,omitempty"`
	SDDCoreBlacklist                   *[]string          `json:"sddCoreBlacklist,omitempty"`
	SDDB2BWhitelist                    []*SDDB2BWhitelist `json:"sddB2bWhitelist,omitempty"`
}

BeneficiaryRequest represents a request to create/edit a beneficiary. It is separate from Beneficiary above because otherwise IDs fail to serialize to the correct JSON.

func (*BeneficiaryRequest) GetAddress

func (b *BeneficiaryRequest) GetAddress() string

GetAddress returns the Address field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetBIC

func (b *BeneficiaryRequest) GetBIC() string

GetBIC returns the BIC field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetBeneficiaryID

func (b *BeneficiaryRequest) GetBeneficiaryID() string

GetBeneficiaryID returns the BeneficiaryID field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetIBAN

func (b *BeneficiaryRequest) GetIBAN() string

GetIBAN returns the IBAN field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetName

func (b *BeneficiaryRequest) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetNickName

func (b *BeneficiaryRequest) GetNickName() string

GetNickName returns the NickName field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetSDDB2BWhitelist

func (b *BeneficiaryRequest) GetSDDB2BWhitelist() []*SDDB2BWhitelist

GetSDDB2BWhitelist returns the SDDB2BWhitelist field.

func (*BeneficiaryRequest) GetSDDCoreBlacklist

func (b *BeneficiaryRequest) GetSDDCoreBlacklist() []string

GetSDDCoreBlacklist returns the SDDCoreBlacklist field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetSDDCoreKnownUniqueMandateReference

func (b *BeneficiaryRequest) GetSDDCoreKnownUniqueMandateReference() []string

GetSDDCoreKnownUniqueMandateReference returns the SDDCoreKnownUniqueMandateReference field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetSEPACreditorIdentifier

func (b *BeneficiaryRequest) GetSEPACreditorIdentifier() string

GetSEPACreditorIdentifier returns the SEPACreditorIdentifier field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetTag

func (b *BeneficiaryRequest) GetTag() string

GetTag returns the Tag field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetUsableForSCT

func (b *BeneficiaryRequest) GetUsableForSCT() bool

GetUsableForSCT returns the UsableForSCT field if it's non-nil, zero value otherwise.

func (*BeneficiaryRequest) GetUserID

func (b *BeneficiaryRequest) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

type BeneficiaryResponse

type BeneficiaryResponse struct {
	Beneficiaries []*Beneficiary `json:"beneficiaries"`
}

BeneficiaryResponse represents a list of beneficiaries. It may contain only one item.

func (*BeneficiaryResponse) GetBeneficiaries

func (b *BeneficiaryResponse) GetBeneficiaries() []*Beneficiary

GetBeneficiaries returns the Beneficiaries field.

type BeneficiaryService

type BeneficiaryService service

BeneficiaryService handles communication with the beneficiary related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/beneficiary

func (*BeneficiaryService) Create

Create creates a Treezor beneficiary.

func (*BeneficiaryService) Edit

func (s *BeneficiaryService) Edit(ctx context.Context, beneficiaryID string, beneficiary *BeneficiaryRequest) (*Beneficiary, *http.Response, error)

Edit updates a beneficiary.

func (*BeneficiaryService) Get

func (s *BeneficiaryService) Get(ctx context.Context, beneficiaryID string) (*Beneficiary, *http.Response, error)

Get returns a beneficiary.

func (*BeneficiaryService) List

List the beneficiaries for the authenticated user.s

type Card

type Card struct {
	Access
	CardID                     *string          `json:"cardId,omitempty"`
	UserID                     *string          `json:"userId,omitempty"`
	WalletID                   *string          `json:"walletId,omitempty"`
	PermsGroup                 *string          `json:"permsGroup,omitempty"`
	WalletCardtransactionID    *string          `json:"walletCardtransactionId,omitempty"`
	CardPrint                  *string          `json:"cardPrint,omitempty"`
	CardDesign                 *string          `json:"cardDesign,omitempty"`
	MccRestrictionGroupID      *string          `json:"mccRestrictionGroupId,omitempty"`
	MerchantRestrictionGroupID *string          `json:"merchantRestrictionGroupId,omitempty"`
	PublicToken                *string          `json:"publicToken,omitempty"`
	IsPhysical                 *int64           `json:"physical,string,omitempty"`
	CardTag                    *string          `json:"cardTag,omitempty"`
	StatusCode                 *string          `json:"statusCode,omitempty"`
	LockStatus                 *int64           `json:"lockStatus,omitempty"`
	IsLive                     *int64           `json:"isLive,string,omitempty"`
	PINTryExceeds              *int64           `json:"pinTryExceeds,string,omitempty"`
	MaskedPan                  *string          `json:"maskedPan,omitempty"`
	EmbossedName               *string          `json:"embossedName,omitempty"`
	ExpiryDate                 *Date            `json:"expiryDate,omitempty"`
	CVV                        *string          `json:"CVV,omitempty"`
	StartDate                  *Date            `json:"startDate,omitempty"`
	EndDate                    *Date            `json:"endDate,omitempty"`
	CountryCode                *string          `json:"countryCode,omitempty"`
	CurrencyCode               Currency         `json:"currencyCode,omitempty"`
	Lang                       *string          `json:"lang,omitempty"`
	DeliveryTitle              *string          `json:"deliveryTitle,omitempty"`
	DeliveryFirstname          *string          `json:"deliveryFirstname,omitempty"`
	DeliveryLastname           *string          `json:"deliveryLastname,omitempty"`
	DeliveryAddress1           *string          `json:"deliveryAddress1,omitempty"`
	DeliveryAddress2           *string          `json:"deliveryAddress2,omitempty"`
	DeliveryAddress3           *string          `json:"deliveryAddress3,omitempty"`
	DeliveryCity               *string          `json:"deliveryCity,omitempty"`
	DeliveryPostcode           *string          `json:"deliveryPostcode,omitempty"`
	DeliveryCountry            *string          `json:"deliveryCountry,omitempty"`
	MobileSent                 *string          `json:"mobileSent,omitempty"`
	LimitsGroup                *string          `json:"limitsGroup,omitempty"`
	VirtualConverted           *int64           `json:"virtualConverted,string,omitempty"`
	OptionATM                  *int64           `json:"optionAtm,string,omitempty"`
	OptionForeign              *int64           `json:"optionForeign,string,omitempty"`
	OptionOnline               *int64           `json:"optionOnline,string,omitempty"`
	OptionNFC                  *int64           `json:"optionNfc,string,omitempty"`
	PIN                        *string          `json:"pin,omitempty"`
	LimitATMYear               *int64           `json:"limitAtmYear,string,omitempty"`
	LimitATMMonth              *int64           `json:"limitAtmMonth,string,omitempty"`
	LimitATMWeek               *int64           `json:"limitAtmWeek,string,omitempty"`
	LimitATMDay                *int64           `json:"limitAtmDay,string,omitempty"`
	LimitATMAll                *int64           `json:"limitAtmAll,string,omitempty"`
	LimitPaymentYear           *int64           `json:"limitPaymentYear,string,omitempty"`
	LimitPaymentMonth          *int64           `json:"limitPaymentMonth,string,omitempty"`
	LimitPaymentWeek           *int64           `json:"limitPaymentWeek,string,omitempty"`
	LimitPaymentDay            *int64           `json:"limitPaymentDay,string,omitempty"`
	LimitPaymentAll            *int64           `json:"limitPaymentAll,string,omitempty"`
	TotalATMYear               *float64         `json:"totalAtmYear,string,omitempty"`
	TotalATMMonth              *float64         `json:"totalAtmMonth,string,omitempty"`
	TotalATMWeek               *float64         `json:"totalAtmWeek,string,omitempty"`
	TotalATMDay                *float64         `json:"totalAtmDay,string,omitempty"`
	TotalATMAll                *float64         `json:"totalAtmAll,string,omitempty"`
	TotalPaymentYear           *float64         `json:"totalPaymentYear,string,omitempty"`
	TotalPaymentMonth          *float64         `json:"totalPaymentMonth,string,omitempty"`
	TotalPaymentWeek           *float64         `json:"totalPaymentWeek,string,omitempty"`
	TotalPaymentDay            *float64         `json:"totalPaymentDay,string,omitempty"`
	TotalPaymentAll            *float64         `json:"totalPaymentAll,string,omitempty"`
	CreatedBy                  *string          `json:"createdBy,omitempty"`
	CreatedDate                *TimestampLondon `json:"createdDate,omitempty"`
	ModifiedBy                 *string          `json:"modifiedBy,omitempty"`
	ModifiedDate               *TimestampLondon `json:"modifiedDate,omitempty"`
	TotalRows                  *int64           `json:"totalRows,string,omitempty"`
}

Card represents a physical or virtual card.

func (*Card) GetCVV

func (c *Card) GetCVV() string

GetCVV returns the CVV field if it's non-nil, zero value otherwise.

func (*Card) GetCardDesign

func (c *Card) GetCardDesign() string

GetCardDesign returns the CardDesign field if it's non-nil, zero value otherwise.

func (*Card) GetCardID

func (c *Card) GetCardID() string

GetCardID returns the CardID field if it's non-nil, zero value otherwise.

func (*Card) GetCardPrint

func (c *Card) GetCardPrint() string

GetCardPrint returns the CardPrint field if it's non-nil, zero value otherwise.

func (*Card) GetCardTag

func (c *Card) GetCardTag() string

GetCardTag returns the CardTag field if it's non-nil, zero value otherwise.

func (*Card) GetCountryCode

func (c *Card) GetCountryCode() string

GetCountryCode returns the CountryCode field if it's non-nil, zero value otherwise.

func (*Card) GetCreatedBy

func (c *Card) GetCreatedBy() string

GetCreatedBy returns the CreatedBy field if it's non-nil, zero value otherwise.

func (*Card) GetCreatedDate

func (c *Card) GetCreatedDate() TimestampLondon

GetCreatedDate returns the CreatedDate field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryAddress1

func (c *Card) GetDeliveryAddress1() string

GetDeliveryAddress1 returns the DeliveryAddress1 field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryAddress2

func (c *Card) GetDeliveryAddress2() string

GetDeliveryAddress2 returns the DeliveryAddress2 field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryAddress3

func (c *Card) GetDeliveryAddress3() string

GetDeliveryAddress3 returns the DeliveryAddress3 field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryCity

func (c *Card) GetDeliveryCity() string

GetDeliveryCity returns the DeliveryCity field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryCountry

func (c *Card) GetDeliveryCountry() string

GetDeliveryCountry returns the DeliveryCountry field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryFirstname

func (c *Card) GetDeliveryFirstname() string

GetDeliveryFirstname returns the DeliveryFirstname field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryLastname

func (c *Card) GetDeliveryLastname() string

GetDeliveryLastname returns the DeliveryLastname field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryPostcode

func (c *Card) GetDeliveryPostcode() string

GetDeliveryPostcode returns the DeliveryPostcode field if it's non-nil, zero value otherwise.

func (*Card) GetDeliveryTitle

func (c *Card) GetDeliveryTitle() string

GetDeliveryTitle returns the DeliveryTitle field if it's non-nil, zero value otherwise.

func (*Card) GetEmbossedName

func (c *Card) GetEmbossedName() string

GetEmbossedName returns the EmbossedName field if it's non-nil, zero value otherwise.

func (*Card) GetEndDate

func (c *Card) GetEndDate() Date

GetEndDate returns the EndDate field if it's non-nil, zero value otherwise.

func (*Card) GetExpiryDate

func (c *Card) GetExpiryDate() Date

GetExpiryDate returns the ExpiryDate field if it's non-nil, zero value otherwise.

func (*Card) GetIsLive

func (c *Card) GetIsLive() int64

GetIsLive returns the IsLive field if it's non-nil, zero value otherwise.

func (*Card) GetIsPhysical

func (c *Card) GetIsPhysical() int64

GetIsPhysical returns the IsPhysical field if it's non-nil, zero value otherwise.

func (*Card) GetLang

func (c *Card) GetLang() string

GetLang returns the Lang field if it's non-nil, zero value otherwise.

func (*Card) GetLimitATMAll

func (c *Card) GetLimitATMAll() int64

GetLimitATMAll returns the LimitATMAll field if it's non-nil, zero value otherwise.

func (*Card) GetLimitATMDay

func (c *Card) GetLimitATMDay() int64

GetLimitATMDay returns the LimitATMDay field if it's non-nil, zero value otherwise.

func (*Card) GetLimitATMMonth

func (c *Card) GetLimitATMMonth() int64

GetLimitATMMonth returns the LimitATMMonth field if it's non-nil, zero value otherwise.

func (*Card) GetLimitATMWeek

func (c *Card) GetLimitATMWeek() int64

GetLimitATMWeek returns the LimitATMWeek field if it's non-nil, zero value otherwise.

func (*Card) GetLimitATMYear

func (c *Card) GetLimitATMYear() int64

GetLimitATMYear returns the LimitATMYear field if it's non-nil, zero value otherwise.

func (*Card) GetLimitPaymentAll

func (c *Card) GetLimitPaymentAll() int64

GetLimitPaymentAll returns the LimitPaymentAll field if it's non-nil, zero value otherwise.

func (*Card) GetLimitPaymentDay

func (c *Card) GetLimitPaymentDay() int64

GetLimitPaymentDay returns the LimitPaymentDay field if it's non-nil, zero value otherwise.

func (*Card) GetLimitPaymentMonth

func (c *Card) GetLimitPaymentMonth() int64

GetLimitPaymentMonth returns the LimitPaymentMonth field if it's non-nil, zero value otherwise.

func (*Card) GetLimitPaymentWeek

func (c *Card) GetLimitPaymentWeek() int64

GetLimitPaymentWeek returns the LimitPaymentWeek field if it's non-nil, zero value otherwise.

func (*Card) GetLimitPaymentYear

func (c *Card) GetLimitPaymentYear() int64

GetLimitPaymentYear returns the LimitPaymentYear field if it's non-nil, zero value otherwise.

func (*Card) GetLimitsGroup

func (c *Card) GetLimitsGroup() string

GetLimitsGroup returns the LimitsGroup field if it's non-nil, zero value otherwise.

func (*Card) GetLockStatus

func (c *Card) GetLockStatus() int64

GetLockStatus returns the LockStatus field if it's non-nil, zero value otherwise.

func (*Card) GetMaskedPan

func (c *Card) GetMaskedPan() string

GetMaskedPan returns the MaskedPan field if it's non-nil, zero value otherwise.

func (*Card) GetMccRestrictionGroupID

func (c *Card) GetMccRestrictionGroupID() string

GetMccRestrictionGroupID returns the MccRestrictionGroupID field if it's non-nil, zero value otherwise.

func (*Card) GetMerchantRestrictionGroupID

func (c *Card) GetMerchantRestrictionGroupID() string

GetMerchantRestrictionGroupID returns the MerchantRestrictionGroupID field if it's non-nil, zero value otherwise.

func (*Card) GetMobileSent

func (c *Card) GetMobileSent() string

GetMobileSent returns the MobileSent field if it's non-nil, zero value otherwise.

func (*Card) GetModifiedBy

func (c *Card) GetModifiedBy() string

GetModifiedBy returns the ModifiedBy field if it's non-nil, zero value otherwise.

func (*Card) GetModifiedDate

func (c *Card) GetModifiedDate() TimestampLondon

GetModifiedDate returns the ModifiedDate field if it's non-nil, zero value otherwise.

func (*Card) GetOptionATM

func (c *Card) GetOptionATM() int64

GetOptionATM returns the OptionATM field if it's non-nil, zero value otherwise.

func (*Card) GetOptionForeign

func (c *Card) GetOptionForeign() int64

GetOptionForeign returns the OptionForeign field if it's non-nil, zero value otherwise.

func (*Card) GetOptionNFC

func (c *Card) GetOptionNFC() int64

GetOptionNFC returns the OptionNFC field if it's non-nil, zero value otherwise.

func (*Card) GetOptionOnline

func (c *Card) GetOptionOnline() int64

GetOptionOnline returns the OptionOnline field if it's non-nil, zero value otherwise.

func (*Card) GetPIN

func (c *Card) GetPIN() string

GetPIN returns the PIN field if it's non-nil, zero value otherwise.

func (*Card) GetPINTryExceeds

func (c *Card) GetPINTryExceeds() int64

GetPINTryExceeds returns the PINTryExceeds field if it's non-nil, zero value otherwise.

func (*Card) GetPermsGroup

func (c *Card) GetPermsGroup() string

GetPermsGroup returns the PermsGroup field if it's non-nil, zero value otherwise.

func (*Card) GetPublicToken

func (c *Card) GetPublicToken() string

GetPublicToken returns the PublicToken field if it's non-nil, zero value otherwise.

func (*Card) GetStartDate

func (c *Card) GetStartDate() Date

GetStartDate returns the StartDate field if it's non-nil, zero value otherwise.

func (*Card) GetStatusCode

func (c *Card) GetStatusCode() string

GetStatusCode returns the StatusCode field if it's non-nil, zero value otherwise.

func (*Card) GetTotalATMAll

func (c *Card) GetTotalATMAll() float64

GetTotalATMAll returns the TotalATMAll field if it's non-nil, zero value otherwise.

func (*Card) GetTotalATMDay

func (c *Card) GetTotalATMDay() float64

GetTotalATMDay returns the TotalATMDay field if it's non-nil, zero value otherwise.

func (*Card) GetTotalATMMonth

func (c *Card) GetTotalATMMonth() float64

GetTotalATMMonth returns the TotalATMMonth field if it's non-nil, zero value otherwise.

func (*Card) GetTotalATMWeek

func (c *Card) GetTotalATMWeek() float64

GetTotalATMWeek returns the TotalATMWeek field if it's non-nil, zero value otherwise.

func (*Card) GetTotalATMYear

func (c *Card) GetTotalATMYear() float64

GetTotalATMYear returns the TotalATMYear field if it's non-nil, zero value otherwise.

func (*Card) GetTotalPaymentAll

func (c *Card) GetTotalPaymentAll() float64

GetTotalPaymentAll returns the TotalPaymentAll field if it's non-nil, zero value otherwise.

func (*Card) GetTotalPaymentDay

func (c *Card) GetTotalPaymentDay() float64

GetTotalPaymentDay returns the TotalPaymentDay field if it's non-nil, zero value otherwise.

func (*Card) GetTotalPaymentMonth

func (c *Card) GetTotalPaymentMonth() float64

GetTotalPaymentMonth returns the TotalPaymentMonth field if it's non-nil, zero value otherwise.

func (*Card) GetTotalPaymentWeek

func (c *Card) GetTotalPaymentWeek() float64

GetTotalPaymentWeek returns the TotalPaymentWeek field if it's non-nil, zero value otherwise.

func (*Card) GetTotalPaymentYear

func (c *Card) GetTotalPaymentYear() float64

GetTotalPaymentYear returns the TotalPaymentYear field if it's non-nil, zero value otherwise.

func (*Card) GetTotalRows

func (c *Card) GetTotalRows() int64

GetTotalRows returns the TotalRows field if it's non-nil, zero value otherwise.

func (*Card) GetUserID

func (c *Card) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

func (*Card) GetVirtualConverted

func (c *Card) GetVirtualConverted() int64

GetVirtualConverted returns the VirtualConverted field if it's non-nil, zero value otherwise.

func (*Card) GetWalletCardtransactionID

func (c *Card) GetWalletCardtransactionID() string

GetWalletCardtransactionID returns the WalletCardtransactionID field if it's non-nil, zero value otherwise.

func (*Card) GetWalletID

func (c *Card) GetWalletID() string

GetWalletID returns the WalletID field if it's non-nil, zero value otherwise.

type Card3DS

type Card3DS struct {
	CardID *string `json:"cardId,omitempty"`
}

Card3DS is used to make register a 3D Secure card.

func (*Card3DS) GetCardID

func (c *Card3DS) GetCardID() string

GetCardID returns the CardID field if it's non-nil, zero value otherwise.

type CardActivateEvent

type CardActivateEvent struct {
	CardResponse
}

type CardChangePINEvent

type CardChangePINEvent struct {
	CardResponse
}

type CardConvertVirtualEvent

type CardConvertVirtualEvent struct {
	CardResponse
}

type CardCreateVirtualEvent

type CardCreateVirtualEvent struct {
	CardResponse
}

type CardGetImagesOptions

type CardGetImagesOptions struct {
	CardID string `url:"cardId,omitempty"`
}

CardGetImagesOptions contains options when getting a card image.

type CardImage

type CardImage struct {
	ID     *string `json:"id,omitempty"`
	CardID *string `json:"cardId,omitempty"`
	File   *string `json:"file,omitempty"`
}

CardImage represents a virtual card image.

func (*CardImage) GetCardID

func (c *CardImage) GetCardID() string

GetCardID returns the CardID field if it's non-nil, zero value otherwise.

func (*CardImage) GetFile

func (c *CardImage) GetFile() string

GetFile returns the File field if it's non-nil, zero value otherwise.

func (*CardImage) GetID

func (c *CardImage) GetID() string

GetID returns the ID field if it's non-nil, zero value otherwise.

type CardImagesResponse

type CardImagesResponse struct {
	CardImages []*CardImage `json:"cardimages"`
}

CardImagesResponse contains a list of virtual card images.

func (*CardImagesResponse) GetCardImages

func (c *CardImagesResponse) GetCardImages() []*CardImage

GetCardImages returns the CardImages field.

type CardLimits

type CardLimits struct {
	LimitATMYear      int64 `json:"limitAtmYear,omitempty"`
	LimitATMMonth     int64 `json:"limitAtmMonth,omitempty"`
	LimitATMWeek      int64 `json:"limitAtmWeek,omitempty"`
	LimitATMDay       int64 `json:"limitAtmDay,omitempty"`
	LimitATMAll       int64 `json:"limitAtmAll,omitempty"`
	LimitPaymentYear  int64 `json:"limitPaymentYear,omitempty"`
	LimitPaymentMonth int64 `json:"limitPaymentMonth,omitempty"`
	LimitPaymentWeek  int64 `json:"limitPaymentWeek,omitempty"`
	LimitPaymentDay   int64 `json:"limitPaymentDay,omitempty"`
	LimitPaymentAll   int64 `json:"limitPaymentAng,omitempty"`
}

CardLimits contains a card limit.

type CardLimitsEvent

type CardLimitsEvent struct {
	CardResponse
}

type CardListOptions

type CardListOptions struct {
	ListOptions
}

CardListOptions contains URL options for listing cards.

type CardLockUnlockEvent

type CardLockUnlockEvent struct {
	CardResponse
}

type CardOptions

type CardOptions struct {
	Foreign int `json:"foreign"`
	Online  int `json:"online"`
	ATM     int `json:"atm"`
	NFC     int `json:"nfc"`
}

CardOptions contains a card options.

type CardOptionsEvent

type CardOptionsEvent struct {
	CardResponse
}

type CardRegenerateEvent

type CardRegenerateEvent struct {
	CardResponse
}

type CardRenewEvent

type CardRenewEvent struct {
	CardResponse
}

type CardRequestPhysicalEvent

type CardRequestPhysicalEvent struct {
	CardResponse
}

type CardResponse

type CardResponse struct {
	Cards []*Card `json:"cards"`
}

CardResponse represents a list of cards. It may contain only one item.

func (*CardResponse) GetCards

func (c *CardResponse) GetCards() []*Card

GetCards returns the Cards field.

type CardService

type CardService service

CardService handles communication with the card related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/card

func (*CardService) Activate

func (s *CardService) Activate(ctx context.Context, cardID string) (*Card, *http.Response, error)

Activate enable a card to make payments. It needs to be done only once.

func (*CardService) ChangeLimits

func (s *CardService) ChangeLimits(ctx context.Context, cardID string, limits *CardLimits) (*Card, *http.Response, error)

ChangeLimits change a card' limits with the provided limits.

func (*CardService) ChangeOptions

func (s *CardService) ChangeOptions(ctx context.Context, cardID string, options *CardOptions) (*Card, *http.Response, error)

ChangeOptions change a card' options with the provided options.

func (*CardService) ChangePIN

func (s *CardService) ChangePIN(ctx context.Context, cardID string, pin *PIN) (*Card, *http.Response, error)

ChangePIN changes the card PIN. It needs the current PIN, the new one and a confirmation one.

func (*CardService) ConvertVirtual

func (s *CardService) ConvertVirtual(ctx context.Context, cardID string) (*Card, *http.Response, error)

ConvertVirtual will convert a virtual card to a physical one.

func (*CardService) CreateVirtual

func (s *CardService) CreateVirtual(ctx context.Context, card *Card) (*Card, *http.Response, error)

CreateVirtual will create a virtual card.

func (*CardService) Deactivate

func (s *CardService) Deactivate(ctx context.Context, cardID string) (*Card, *http.Response, error)

Deactivate deactivates a card permanently.

func (*CardService) Edit

func (s *CardService) Edit(ctx context.Context, cardID string, card *Card) (*Card, *http.Response, error)

Edit updates the referenced card (with cardID) in parameter.

func (*CardService) Get

func (s *CardService) Get(ctx context.Context, cardID string) (*Card, *http.Response, error)

Get returns a card (virtual or physical).

func (*CardService) GetImage

GetImage returns the provided virtual card image.

func (*CardService) List

List the cards for the authenticated user.

func (*CardService) LockUnlock

func (s *CardService) LockUnlock(ctx context.Context, cardID string, lockStatus LockStatus) (*Card, *http.Response, error)

LockUnlock toggle the lock or unlock state of a card. If the card is locked, calling this function will unlock the card, and vice versa.

func (*CardService) Regenerate

func (s *CardService) Regenerate(ctx context.Context, cardID string) (*Card, *http.Response, error)

Regenerate will recreate or re-order the card given in parameter with the exact same configuration.

func (*CardService) Register3DSecure

func (s *CardService) Register3DSecure(ctx context.Context, cardID *Card3DS) (*Card, *http.Response, error)

Register3DSecure will register a card to 3DSecure

func (*CardService) RequestPhysical

func (s *CardService) RequestPhysical(ctx context.Context, card *Card) (*Card, *http.Response, error)

RequestPhysical will request a physical card that will be sent to the user's address.

func (*CardService) SetPIN

func (s *CardService) SetPIN(ctx context.Context, cardID string, pin *PIN) (*Card, *http.Response, error)

SetPIN sets the card PIN. It needs the the new PIN and a confirmation one. It is solely used by operators, not users.

func (*CardService) UnblockPIN

func (s *CardService) UnblockPIN(ctx context.Context, cardID string) (*Card, *http.Response, error)

UnblockPIN unlocks the card PIN if it was blocked because of 3 failed attempts.

type CardSetPINEvent

type CardSetPINEvent struct {
	CardResponse
}

type CardTransaction

type CardTransaction struct {
	CardTransactionID         *string          `json:"cardtransactionId,omitempty"`
	CardID                    *string          `json:"cardId,omitempty"`
	WalletID                  *string          `json:"walletId,omitempty"`
	WalletCurrency            *string          `json:"walletCurrency,omitempty"`
	MerchantID                *string          `json:"merchantId,omitempty"`
	MerchantName              *string          `json:"merchantName,omitempty"`
	MerchantCity              *string          `json:"merchantCity,omitempty"`
	MerchantCountry           *string          `json:"merchantCountry,omitempty"`
	PaymentLocalTime          *string          `json:"paymentLocalTime,omitempty"`
	PublicToken               *string          `json:"publicToken,omitempty"`
	PaymentAmount             *float64         `json:"paymentAmount,string,omitempty"`
	PaymentCurrency           *string          `json:"paymentCurrency,omitempty"`
	Fees                      *float64         `json:"fees,string,omitempty"`
	Is3DS                     *string          `json:"is3DS,omitempty"`
	PaymentCountry            *string          `json:"paymentCountry,omitempty"`
	PaymentID                 *string          `json:"paymentId,omitempty"`
	PaymentStatus             *string          `json:"paymentStatus,omitempty"`
	PaymentLocalAmount        *float64         `json:"paymentLocalAmount,string,omitempty"`
	PosCardholderPresence     *string          `json:"posCardholderPresence,omitempty"`
	PosPostcode               *string          `json:"posPostcode,omitempty"`
	PosCountry                *string          `json:"posCountry,omitempty"`
	PosTerminalID             *string          `json:"posTerminalId,omitempty"`
	PosCardPresence           *string          `json:"posCardPresence,omitempty"`
	PanEntryMethod            *string          `json:"panEntryMethod,omitempty"`
	AuthorizationNote         *string          `json:"authorizationNote,omitempty"`
	AuthorizationResponseCode *string          `json:"authorizationResponseCode,omitempty"`
	AuthorizationIssuerID     *string          `json:"authorizationIssuerId,omitempty"`
	AuthorizationIssuerTime   *TimestampLondon `json:"authorizationIssuerTime,omitempty"`
	AuthorizationMti          *string          `json:"authorizationMti,omitempty"`
	AuthorizedBalance         *float64         `json:"authorizedBalance,string,omitempty"`
	LimitATMYear              *int64           `json:"limitAtmYear,string,omitempty"`
	LimitATMMonth             *int64           `json:"limitAtmMonth,string,omitempty"`
	LimitATMWeek              *int64           `json:"limitAtmWeek,string,omitempty"`
	LimitATMDay               *int64           `json:"limitAtmDay,string,omitempty"`
	LimitATMAll               *int64           `json:"limitAtmAll,string,omitempty"`
	LimitPaymentYear          *int64           `json:"limitPaymentYear,string,omitempty"`
	LimitPaymentMonth         *int64           `json:"limitPaymentMonth,string,omitempty"`
	LimitPaymentWeek          *int64           `json:"limitPaymentWeek,string,omitempty"`
	LimitPaymentDay           *int64           `json:"limitPaymentDay,string,omitempty"`
	LimitPaymentAll           *int64           `json:"limitPaymentAll,string,omitempty"`
	TotalLimitATMYear         *float64         `json:"totalLimitAtmYear,string,omitempty"`
	TotalLimitATMMonth        *float64         `json:"totalLimitAtmMonth,string,omitempty"`
	TotalLimitATMWeek         *float64         `json:"totalLimitAtmWeek,string,omitempty"`
	TotalLimitATMDay          *float64         `json:"totalLimitAtmDay,string,omitempty"`
	TotalLimitATMAll          *float64         `json:"totalLimitAtmAll,string,omitempty"`
	TotalLimitPaymentYear     *float64         `json:"totalLimitPaymentYear,string,omitempty"`
	TotalLimitPaymentMonth    *float64         `json:"totalLimitPaymentMonth,string,omitempty"`
	TotalLimitPaymentWeek     *float64         `json:"totalLimitPaymentWeek,string,omitempty"`
	TotalLimitPaymentDay      *float64         `json:"totalLimitPaymentDay,string,omitempty"`
	TotalLimitPaymentAll      *float64         `json:"totalLimitPaymentAll,string,omitempty"`
	MccCode                   *string          `json:"mccCode,omitempty"`
}

CardTransaction represents a card transaction made at a PoS.

func (*CardTransaction) GetAuthorizationIssuerID

func (c *CardTransaction) GetAuthorizationIssuerID() string

GetAuthorizationIssuerID returns the AuthorizationIssuerID field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetAuthorizationIssuerTime

func (c *CardTransaction) GetAuthorizationIssuerTime() TimestampLondon

GetAuthorizationIssuerTime returns the AuthorizationIssuerTime field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetAuthorizationMti

func (c *CardTransaction) GetAuthorizationMti() string

GetAuthorizationMti returns the AuthorizationMti field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetAuthorizationNote

func (c *CardTransaction) GetAuthorizationNote() string

GetAuthorizationNote returns the AuthorizationNote field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetAuthorizationResponseCode

func (c *CardTransaction) GetAuthorizationResponseCode() string

GetAuthorizationResponseCode returns the AuthorizationResponseCode field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetAuthorizedBalance

func (c *CardTransaction) GetAuthorizedBalance() float64

GetAuthorizedBalance returns the AuthorizedBalance field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetCardID

func (c *CardTransaction) GetCardID() string

GetCardID returns the CardID field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetCardTransactionID

func (c *CardTransaction) GetCardTransactionID() string

GetCardTransactionID returns the CardTransactionID field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetFees

func (c *CardTransaction) GetFees() float64

GetFees returns the Fees field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetIs3DS

func (c *CardTransaction) GetIs3DS() string

GetIs3DS returns the Is3DS field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitATMAll

func (c *CardTransaction) GetLimitATMAll() int64

GetLimitATMAll returns the LimitATMAll field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitATMDay

func (c *CardTransaction) GetLimitATMDay() int64

GetLimitATMDay returns the LimitATMDay field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitATMMonth

func (c *CardTransaction) GetLimitATMMonth() int64

GetLimitATMMonth returns the LimitATMMonth field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitATMWeek

func (c *CardTransaction) GetLimitATMWeek() int64

GetLimitATMWeek returns the LimitATMWeek field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitATMYear

func (c *CardTransaction) GetLimitATMYear() int64

GetLimitATMYear returns the LimitATMYear field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitPaymentAll

func (c *CardTransaction) GetLimitPaymentAll() int64

GetLimitPaymentAll returns the LimitPaymentAll field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitPaymentDay

func (c *CardTransaction) GetLimitPaymentDay() int64

GetLimitPaymentDay returns the LimitPaymentDay field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitPaymentMonth

func (c *CardTransaction) GetLimitPaymentMonth() int64

GetLimitPaymentMonth returns the LimitPaymentMonth field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitPaymentWeek

func (c *CardTransaction) GetLimitPaymentWeek() int64

GetLimitPaymentWeek returns the LimitPaymentWeek field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetLimitPaymentYear

func (c *CardTransaction) GetLimitPaymentYear() int64

GetLimitPaymentYear returns the LimitPaymentYear field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetMccCode

func (c *CardTransaction) GetMccCode() string

GetMccCode returns the MccCode field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetMerchantCity

func (c *CardTransaction) GetMerchantCity() string

GetMerchantCity returns the MerchantCity field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetMerchantCountry

func (c *CardTransaction) GetMerchantCountry() string

GetMerchantCountry returns the MerchantCountry field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetMerchantID

func (c *CardTransaction) GetMerchantID() string

GetMerchantID returns the MerchantID field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetMerchantName

func (c *CardTransaction) GetMerchantName() string

GetMerchantName returns the MerchantName field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPanEntryMethod

func (c *CardTransaction) GetPanEntryMethod() string

GetPanEntryMethod returns the PanEntryMethod field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPaymentAmount

func (c *CardTransaction) GetPaymentAmount() float64

GetPaymentAmount returns the PaymentAmount field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPaymentCountry

func (c *CardTransaction) GetPaymentCountry() string

GetPaymentCountry returns the PaymentCountry field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPaymentCurrency

func (c *CardTransaction) GetPaymentCurrency() string

GetPaymentCurrency returns the PaymentCurrency field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPaymentID

func (c *CardTransaction) GetPaymentID() string

GetPaymentID returns the PaymentID field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPaymentLocalAmount

func (c *CardTransaction) GetPaymentLocalAmount() float64

GetPaymentLocalAmount returns the PaymentLocalAmount field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPaymentLocalTime

func (c *CardTransaction) GetPaymentLocalTime() string

GetPaymentLocalTime returns the PaymentLocalTime field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPaymentStatus

func (c *CardTransaction) GetPaymentStatus() string

GetPaymentStatus returns the PaymentStatus field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPosCardPresence

func (c *CardTransaction) GetPosCardPresence() string

GetPosCardPresence returns the PosCardPresence field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPosCardholderPresence

func (c *CardTransaction) GetPosCardholderPresence() string

GetPosCardholderPresence returns the PosCardholderPresence field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPosCountry

func (c *CardTransaction) GetPosCountry() string

GetPosCountry returns the PosCountry field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPosPostcode

func (c *CardTransaction) GetPosPostcode() string

GetPosPostcode returns the PosPostcode field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPosTerminalID

func (c *CardTransaction) GetPosTerminalID() string

GetPosTerminalID returns the PosTerminalID field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetPublicToken

func (c *CardTransaction) GetPublicToken() string

GetPublicToken returns the PublicToken field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitATMAll

func (c *CardTransaction) GetTotalLimitATMAll() float64

GetTotalLimitATMAll returns the TotalLimitATMAll field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitATMDay

func (c *CardTransaction) GetTotalLimitATMDay() float64

GetTotalLimitATMDay returns the TotalLimitATMDay field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitATMMonth

func (c *CardTransaction) GetTotalLimitATMMonth() float64

GetTotalLimitATMMonth returns the TotalLimitATMMonth field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitATMWeek

func (c *CardTransaction) GetTotalLimitATMWeek() float64

GetTotalLimitATMWeek returns the TotalLimitATMWeek field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitATMYear

func (c *CardTransaction) GetTotalLimitATMYear() float64

GetTotalLimitATMYear returns the TotalLimitATMYear field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitPaymentAll

func (c *CardTransaction) GetTotalLimitPaymentAll() float64

GetTotalLimitPaymentAll returns the TotalLimitPaymentAll field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitPaymentDay

func (c *CardTransaction) GetTotalLimitPaymentDay() float64

GetTotalLimitPaymentDay returns the TotalLimitPaymentDay field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitPaymentMonth

func (c *CardTransaction) GetTotalLimitPaymentMonth() float64

GetTotalLimitPaymentMonth returns the TotalLimitPaymentMonth field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitPaymentWeek

func (c *CardTransaction) GetTotalLimitPaymentWeek() float64

GetTotalLimitPaymentWeek returns the TotalLimitPaymentWeek field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetTotalLimitPaymentYear

func (c *CardTransaction) GetTotalLimitPaymentYear() float64

GetTotalLimitPaymentYear returns the TotalLimitPaymentYear field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetWalletCurrency

func (c *CardTransaction) GetWalletCurrency() string

GetWalletCurrency returns the WalletCurrency field if it's non-nil, zero value otherwise.

func (*CardTransaction) GetWalletID

func (c *CardTransaction) GetWalletID() string

GetWalletID returns the WalletID field if it's non-nil, zero value otherwise.

type CardTransactionCreateEvent

type CardTransactionCreateEvent struct {
	CardTransactionResponse
}

type CardTransactionResponse

type CardTransactionResponse struct {
	CardTransactions []*CardTransaction `json:"cardtransactions"`
}

CardTransactionResponse represents a list of card transactions. It may contain only one item.

func (*CardTransactionResponse) GetCardTransactions

func (c *CardTransactionResponse) GetCardTransactions() []*CardTransaction

GetCardTransactions returns the CardTransactions field.

type CardTransactionService

type CardTransactionService service

CardTransactionService handles communication with the card transaction related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/cardtransaction

func (*CardTransactionService) Get

func (s *CardTransactionService) Get(ctx context.Context, cardTransactionID string) (*CardTransaction, *http.Response, error)

Get fetches a CardTransaction from Treezor.

func (*CardTransactionService) List

List the pay-ins for the authenticated user.

type CardTransactionsListOptions

type CardTransactionsListOptions struct {
	PaymentID       string `url:"paymentId,omitempty"`
	UserID          string `url:"userId,omitempty"`
	WalletID        string `url:"walletId,omitempty"`
	CreatedDateFrom string `url:"createdDateFrom,omitempty"`
	CreatedDateTo   string `url:"createdDateTo,omitempty"`

	ListOptions
}

CardTransactionsListOptions defines options to be passed as query parameters when performing a List operation

type CardUnblockPINEvent

type CardUnblockPINEvent struct {
	CardResponse
}

type CardUpdateEvent

type CardUpdateEvent struct {
	CardResponse
}

type Client

type Client struct {

	// Base URL for API requests. Defaults to the public Treezor API. BaseURL should
	// always be specified with a trailing slash.
	BaseURL *url.URL
	// Base URL without index used for endpoints that doesn't have index.php prefix.
	// For example : https://sandbox.treezor.com/v1/index.php/users/{id}/kycliveness
	BaseURLWithoutIndex *url.URL

	// User agent used when communicating with the Treezor API.
	UserAgent string

	User            *UserService
	Wallet          *WalletService
	Card            *CardService
	CardTransaction *CardTransactionService
	Balance         *BalanceService
	Document        *DocumentService
	Beneficiary     *BeneficiaryService
	Transfer        *TransferService
	Payin           *PayinService
	Payout          *PayoutService
	Hearthbeat      *HearthbeatService
	TaxResidences   *TaxResidencesService
	// contains filtered or unexported fields
}

A Client manages communication with the Treezor API.

func NewClient

func NewClient(httpClient *http.Client, isProduction bool) *Client

NewClient returns a new Treezor API client. If a nil httpClient is provided, http.DefaultClient will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library).

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.

The provided ctx must be non-nil. If it is canceled or times out, ctx.Err() will be returned.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

func (*Client) NewRequestWithoutIndex

func (c *Client) NewRequestWithoutIndex(method, urlStr string, body interface{}) (*http.Request, error)

NewRequestWithoutIndex do the same as NewRequest but without /index.php/

type Currency

type Currency string

Currency is a string that contains the ISO 4217 currency code.

const (
	AED Currency = "AED" // United Arab Emirates Dirham
	AFN Currency = "AFN" // Afghan Afghani
	ALL Currency = "ALL" // Albanian Lek
	AMD Currency = "AMD" // Armenian Dram
	ANG Currency = "ANG" // Netherlands Antillean Gulden
	AOA Currency = "AOA" // Angolan Kwanza
	ARS Currency = "ARS" // Argentine Peso
	AUD Currency = "AUD" // Australian Dollar
	AWG Currency = "AWG" // Aruban Florin
	AZN Currency = "AZN" // Azerbaijani Manat
	BAM Currency = "BAM" // Bosnia & Herzegovina Convertible Mark
	BBD Currency = "BBD" // Barbadian Dollar
	BDT Currency = "BDT" // Bangladeshi Taka
	BGN Currency = "BGN" // Bulgarian Lev
	BIF Currency = "BIF" // Burundian Franc
	BMD Currency = "BMD" // Bermudian Dollar
	BND Currency = "BND" // Brunei Dollar
	BOB Currency = "BOB" // Bolivian Boliviano
	BRL Currency = "BRL" // Brazilian Real
	BSD Currency = "BSD" // Bahamian Dollar
	BTN Currency = "BTN" // Bhutanese Ngultrum
	BWP Currency = "BWP" // Botswana Pula
	BZD Currency = "BZD" // Belize Dollar
	CAD Currency = "CAD" // Canadian Dollar
	CDF Currency = "CDF" // Congolese Franc
	CHF Currency = "CHF" // Swiss Franc
	CLP Currency = "CLP" // Chilean Peso
	CNY Currency = "CNY" // Chinese Renminbi Yuan
	COP Currency = "COP" // Colombian Peso
	CRC Currency = "CRC" // Costa Rican Colón
	CVE Currency = "CVE" // Cape Verdean Escudo
	CZK Currency = "CZK" // Czech Koruna
	DJF Currency = "DJF" // Djiboutian Franc
	DKK Currency = "DKK" // Danish Krone
	DOP Currency = "DOP" // Dominican Peso
	DZD Currency = "DZD" // Algerian Dinar
	EEK Currency = "EEK" // Estonian Kroon
	EGP Currency = "EGP" // Egyptian Pound
	ERN Currency = "ERN" // Eritrean Nakfa
	ETB Currency = "ETB" // Ethiopian Birr
	EUR Currency = "EUR" // Euro
	FJD Currency = "FJD" // Fijian Dollar
	FKP Currency = "FKP" // Falkland Islands Pound
	GBP Currency = "GBP" // British Pound
	GEL Currency = "GEL" // Georgian Lari
	GIP Currency = "GIP" // Gibraltar Pound
	GMD Currency = "GMD" // Gambian Dalasi
	GNF Currency = "GNF" // Guinean Franc
	GTQ Currency = "GTQ" // Guatemalan Quetzal
	GYD Currency = "GYD" // Guyanese Dollar
	HKD Currency = "HKD" // Hong Kong Dollar
	HNL Currency = "HNL" // Honduran Lempira
	HRK Currency = "HRK" // Croatian Kuna
	HTG Currency = "HTG" // Haitian Gourde
	HUF Currency = "HUF" // Hungarian Forint
	IDR Currency = "IDR" // Indonesian Rupiah
	ILS Currency = "ILS" // Israeli New Sheqel
	INR Currency = "INR" // Indian Rupee
	ISK Currency = "ISK" // Icelandic Króna
	JMD Currency = "JMD" // Jamaican Dollar
	JPY Currency = "JPY" // Japanese Yen
	KES Currency = "KES" // Kenyan Shilling
	KGS Currency = "KGS" // Kyrgyzstani Som
	KHR Currency = "KHR" // Cambodian Riel
	KMF Currency = "KMF" // Comorian Franc
	KRW Currency = "KRW" // South Korean Won
	KYD Currency = "KYD" // Cayman Islands Dollar
	KZT Currency = "KZT" // Kazakhstani Tenge
	LAK Currency = "LAK" // Lao Kip
	LBP Currency = "LBP" // Lebanese Pound
	LKR Currency = "LKR" // Sri Lankan Rupee
	LRD Currency = "LRD" // Liberian Dollar
	LSL Currency = "LSL" // Lesotho Loti
	LTL Currency = "LTL" // Lithuanian Litas
	LVL Currency = "LVL" // Latvian Lats
	MAD Currency = "MAD" // Moroccan Dirham
	MDL Currency = "MDL" // Moldovan Leu
	MGA Currency = "MGA" // Malagasy Ariary
	MKD Currency = "MKD" // Macedonian Denar
	MNT Currency = "MNT" // Mongolian Tögrög
	MOP Currency = "MOP" // Macanese Pataca
	MRO Currency = "MRO" // Mauritanian Ouguiya
	MUR Currency = "MUR" // Mauritian Rupee
	MVR Currency = "MVR" // Maldivian Rufiyaa
	MWK Currency = "MWK" // Malawian Kwacha
	MXN Currency = "MXN" // Mexican Peso
	MYR Currency = "MYR" // Malaysian Ringgit
	MZN Currency = "MZN" // Mozambican Metical
	NAD Currency = "NAD" // Namibian Dollar
	NGN Currency = "NGN" // Nigerian Naira
	NIO Currency = "NIO" // Nicaraguan Córdoba
	NOK Currency = "NOK" // Norwegian Krone
	NPR Currency = "NPR" // Nepalese Rupee
	NZD Currency = "NZD" // New Zealand Dollar
	PAB Currency = "PAB" // Panamanian Balboa
	PEN Currency = "PEN" // Peruvian Nuevo Sol
	PGK Currency = "PGK" // Papua New Guinean Kina
	PHP Currency = "PHP" // Philippine Peso
	PKR Currency = "PKR" // Pakistani Rupee
	PLN Currency = "PLN" // Polish Złoty
	PYG Currency = "PYG" // Paraguayan Guaraní
	QAR Currency = "QAR" // Qatari Riyal
	RON Currency = "RON" // Romanian Leu
	RSD Currency = "RSD" // Serbian Dinar
	RUB Currency = "RUB" // Russian Ruble
	RWF Currency = "RWF" // Rwandan Franc
	SAR Currency = "SAR" // Saudi Riyal
	SBD Currency = "SBD" // Solomon Islands Dollar
	SCR Currency = "SCR" // Seychellois Rupee
	SEK Currency = "SEK" // Swedish Krona
	SGD Currency = "SGD" // Singapore Dollar
	SHP Currency = "SHP" // Saint Helenian Pound
	SLL Currency = "SLL" // Sierra Leonean Leone
	SOS Currency = "SOS" // Somali Shilling
	SRD Currency = "SRD" // Surinamese Dollar
	STD Currency = "STD" // São Tomé and Príncipe Dobra
	SVC Currency = "SVC" // Salvadoran Colón
	SZL Currency = "SZL" // Swazi Lilangeni
	THB Currency = "THB" // Thai Baht
	TJS Currency = "TJS" // Tajikistani Somoni
	TOP Currency = "TOP" // Tongan Paʻanga
	TRY Currency = "TRY" // Turkish Lira
	TTD Currency = "TTD" // Trinidad and Tobago Dollar
	TWD Currency = "TWD" // New Taiwan Dollar
	TZS Currency = "TZS" // Tanzanian Shilling
	UAH Currency = "UAH" // Ukrainian Hryvnia
	UGX Currency = "UGX" // Ugandan Shilling
	USD Currency = "USD" // United States Dollar
	UYU Currency = "UYU" // Uruguayan Peso
	UZS Currency = "UZS" // Uzbekistani Som
	VEF Currency = "VEF" // Venezuelan Bolívar
	VND Currency = "VND" // Vietnamese Đồng
	VUV Currency = "VUV" // Vanuatu Vatu
	WST Currency = "WST" // Samoan Tala
	XAF Currency = "XAF" // Central African Cfa Franc
	XCD Currency = "XCD" // East Caribbean Dollar
	XOF Currency = "XOF" // West African Cfa Franc
	XPF Currency = "XPF" // Cfp Franc
	YER Currency = "YER" // Yemeni Rial
	ZAR Currency = "ZAR" // South African Rand
	ZMW Currency = "ZMW" // Zambian Kwacha
)

All supported currency.

type Date

type Date struct {
	time.Time
	OriginalPayload string
}

Date represents a date that can be unmarshalled from a JSON string formatted as "YYYY-MM-DD". This is necessary for some fields since the Treezor API is inconsistent in how it represents dates.

func NewDate

func NewDate(t time.Time) *Date

NewDate create a date with the right format for testing

func (*Date) MarshalJSON

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

MarshalJSON implements the json.Marshaler interface. Time is return as "YYYY-MM-DD"

func (Date) String

func (d Date) String() string

String implements string default behavior

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in "YYYY-MM-DD".

type Document

type Document struct {
	Access
	DocumentID        *string      `json:"documentId,omitempty"`
	DocumentStatus    *string      `json:"documentStatus,omitempty"`
	DocumentTypeID    DocumentType `json:"documentTypeId,string,omitempty"`
	DocumentType      *string      `json:"documentType,omitempty"`
	ClientID          *string      `json:"clientId,omitempty"`
	UserID            *string      `json:"userId,omitempty"`
	UserLastname      *string      `json:"userLastname,omitempty"`
	UserFirstname     *string      `json:"userFirstname,omitempty"`
	Filename          *string      `json:"fileName,omitempty"`
	FileSize          *int64       `json:"fileSize,omitempty"`
	Name              *string      `json:"name,omitempty"`
	FileContentBase64 string       `json:"fileContentBase64,omitempty"`
	TemporaryURL      *string      `json:"temporaryUrl,omitempty"`
	TemporaryURLThumb *string      `json:"temporaryUrlThumb,omitempty"`
	CreatedDate       *string      `json:"createdDate,omitempty"`
	ModifiedDate      *string      `json:"modifiedDate,omitempty"`
	TotalRows         *int64       `json:"totalRows,omitempty"`
	ResidenceID       *string      `json:"residenceId,omitempty"`
	InformationStatus *string      `json:"informationStatus,omitempty"`
	CodeStatus        *string      `json:"codeStatus,omitempty"`
}

Document represents a KYC document.

func (*Document) GetClientID

func (d *Document) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*Document) GetCodeStatus

func (d *Document) GetCodeStatus() string

GetCodeStatus returns the CodeStatus field if it's non-nil, zero value otherwise.

func (*Document) GetCreatedDate

func (d *Document) GetCreatedDate() string

GetCreatedDate returns the CreatedDate field if it's non-nil, zero value otherwise.

func (*Document) GetDocumentID

func (d *Document) GetDocumentID() string

GetDocumentID returns the DocumentID field if it's non-nil, zero value otherwise.

func (*Document) GetDocumentStatus

func (d *Document) GetDocumentStatus() string

GetDocumentStatus returns the DocumentStatus field if it's non-nil, zero value otherwise.

func (*Document) GetDocumentType

func (d *Document) GetDocumentType() string

GetDocumentType returns the DocumentType field if it's non-nil, zero value otherwise.

func (*Document) GetFileSize

func (d *Document) GetFileSize() int64

GetFileSize returns the FileSize field if it's non-nil, zero value otherwise.

func (*Document) GetFilename

func (d *Document) GetFilename() string

GetFilename returns the Filename field if it's non-nil, zero value otherwise.

func (*Document) GetInformationStatus

func (d *Document) GetInformationStatus() string

GetInformationStatus returns the InformationStatus field if it's non-nil, zero value otherwise.

func (*Document) GetModifiedDate

func (d *Document) GetModifiedDate() string

GetModifiedDate returns the ModifiedDate field if it's non-nil, zero value otherwise.

func (*Document) GetName

func (d *Document) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Document) GetResidenceID

func (d *Document) GetResidenceID() string

GetResidenceID returns the ResidenceID field if it's non-nil, zero value otherwise.

func (*Document) GetTemporaryURL

func (d *Document) GetTemporaryURL() string

GetTemporaryURL returns the TemporaryURL field if it's non-nil, zero value otherwise.

func (*Document) GetTemporaryURLThumb

func (d *Document) GetTemporaryURLThumb() string

GetTemporaryURLThumb returns the TemporaryURLThumb field if it's non-nil, zero value otherwise.

func (*Document) GetTotalRows

func (d *Document) GetTotalRows() int64

GetTotalRows returns the TotalRows field if it's non-nil, zero value otherwise.

func (*Document) GetUserFirstname

func (d *Document) GetUserFirstname() string

GetUserFirstname returns the UserFirstname field if it's non-nil, zero value otherwise.

func (*Document) GetUserID

func (d *Document) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

func (*Document) GetUserLastname

func (d *Document) GetUserLastname() string

GetUserLastname returns the UserLastname field if it's non-nil, zero value otherwise.

type DocumentResponse

type DocumentResponse struct {
	Documents []*Document `json:"documents"`
}

DocumentResponse represents a list of KYC documents. It may contain only one item.

func (*DocumentResponse) GetDocuments

func (d *DocumentResponse) GetDocuments() []*Document

GetDocuments returns the Documents field.

type DocumentService

type DocumentService service

DocumentService handles communication with the document related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/document

func (*DocumentService) Delete

func (s *DocumentService) Delete(ctx context.Context, documentID string) (*http.Response, error)

Delete deletes a document in treezor

func (*DocumentService) Get

func (s *DocumentService) Get(ctx context.Context, documentID string) (*Document, *http.Response, error)

Get fetch document info from Treezor

func (*DocumentService) Send

func (s *DocumentService) Send(ctx context.Context, document *Document) (*Document, *http.Response, error)

Send uploads the given file to Treezor for later KYC review.

type DocumentType

type DocumentType int32

DocumentType represents the type of legal document.

func (DocumentType) String

func (d DocumentType) String() string

type Error

type Error struct {
	Code    int    `json:"errorCode"`
	Message string `json:"errorMessage"`
}

An Error reports more details on an individual error in an ErrorResponse.

func (*Error) Error

func (e *Error) Error() string

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response // HTTP response that caused this error
	Errors   []Error        `json:"errors"`
}

An ErrorResponse reports one or more errors caused by an API request.

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

func (*ErrorResponse) GetErrors

func (e *ErrorResponse) GetErrors() []Error

GetErrors returns the Errors field.

func (*ErrorResponse) GetResponse

func (e *ErrorResponse) GetResponse() http.Response

GetResponse returns the Response field if it's non-nil, zero value otherwise.

type Event

type Event struct {
	ID               *string          `json:"webhook_id,omitempty"`
	Type             *string          `json:"webhook,omitempty"`
	Object           *string          `json:"object,omitempty"`
	ObjectID         *string          `json:"object_id,omitempty"`
	RawPayload       *json.RawMessage `json:"object_payload,omitempty"`
	PayloadSignature *string          `json:"object_payload_signature,omitempty"`
}

Event represent an event that occurred on Treezor's infrastructure and is sent as a webhook to us.

func ValidatePayload

func ValidatePayload(r *http.Request, secretKey []byte) (evt *Event, err error)

ValidatePayload validates an incoming Treezor Webhook event request and returns the (JSON) payload. The Content-Type header of the payload can only be "application/json". If the Content-Type is incorrect then an error is returned. secretKey is the Treezor Webhook secret message.

Example usage:

func (s *TreezorEventMonitor) ServeHTTP(w http.ResponseWriter, r *http.Request) {
  payload, err := treezor.ValidatePayload(r, s.webhookSecretKey)
  if err != nil { ... }
  // Process payload...
}

func (*Event) GetID

func (e *Event) GetID() string

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*Event) GetObject

func (e *Event) GetObject() string

GetObject returns the Object field if it's non-nil, zero value otherwise.

func (*Event) GetObjectID

func (e *Event) GetObjectID() string

GetObjectID returns the ObjectID field if it's non-nil, zero value otherwise.

func (*Event) GetPayloadSignature

func (e *Event) GetPayloadSignature() string

GetPayloadSignature returns the PayloadSignature field if it's non-nil, zero value otherwise.

func (*Event) GetRawPayload

func (e *Event) GetRawPayload() json.RawMessage

GetRawPayload returns the RawPayload field if it's non-nil, zero value otherwise.

func (*Event) GetType

func (e *Event) GetType() string

GetType returns the Type field if it's non-nil, zero value otherwise.

func (*Event) ParsePayload

func (e *Event) ParsePayload() (payload interface{}, err error)

ParsePayload parses the event payload. For recognized event types, a value of the corresponding struct type will be returned.

func (Event) String

func (e Event) String() string

type HearthbeatService

type HearthbeatService service

HearthbeatService handles communication with the heartbeat related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/heartbeat

func (*HearthbeatService) Ping

Ping will try to reach the Treezor API. Returns true if the API is healthy, otherwise it returns false.

type Identification

type Identification struct {
	IdentificationID  *string `json:"identification-id,omitempty"`
	IdentificationURL *string `json:"identification-url,omitempty"`
}

Identification represent an identification returned by Treezor for a kycLiveness request

func (*Identification) GetIdentificationID

func (i *Identification) GetIdentificationID() string

GetIdentificationID returns the IdentificationID field if it's non-nil, zero value otherwise.

func (*Identification) GetIdentificationURL

func (i *Identification) GetIdentificationURL() string

GetIdentificationURL returns the IdentificationURL field if it's non-nil, zero value otherwise.

type IdentificationResponse

type IdentificationResponse struct {
	Identification *Identification `json:"identification,omitempty"`
}

IdentificationResponse represent a list of identification

func (*IdentificationResponse) GetIdentification

func (i *IdentificationResponse) GetIdentification() *Identification

GetIdentification returns the Identification field.

type KycLiveness

type KycLiveness struct {
	Access
	StartedAt *time.Time           `json:"started-at,omitempty"`
	UpdatedAt *time.Time           `json:"updated-at,omitempty"`
	Identity  *KycLivenessIdentity `json:"identity"`
	KycStatus *string              `json:"kyc-status,omitempty"`
	Comment   *string              `json:"comment,omitempty"`
	UserID    *string              `json:"user_id,omitempty"`
	Score     *int                 `json:"score,omitempty"`
}

KycLiveness represent a kyc liveness event

func (*KycLiveness) GetComment

func (k *KycLiveness) GetComment() string

GetComment returns the Comment field if it's non-nil, zero value otherwise.

func (*KycLiveness) GetIdentity

func (k *KycLiveness) GetIdentity() *KycLivenessIdentity

GetIdentity returns the Identity field.

func (*KycLiveness) GetKycStatus

func (k *KycLiveness) GetKycStatus() string

GetKycStatus returns the KycStatus field if it's non-nil, zero value otherwise.

func (*KycLiveness) GetScore

func (k *KycLiveness) GetScore() int

GetScore returns the Score field if it's non-nil, zero value otherwise.

func (*KycLiveness) GetStartedAt

func (k *KycLiveness) GetStartedAt() time.Time

GetStartedAt returns the StartedAt field if it's non-nil, zero value otherwise.

func (*KycLiveness) GetUpdatedAt

func (k *KycLiveness) GetUpdatedAt() time.Time

GetUpdatedAt returns the UpdatedAt field if it's non-nil, zero value otherwise.

func (*KycLiveness) GetUserID

func (k *KycLiveness) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

type KycLivenessCreateEvent

type KycLivenessCreateEvent struct {
	*KycLiveness
}

type KycLivenessIdentity

type KycLivenessIdentity struct {
	LastName  *string `json:"last-name,omitempty"`
	FirstName *string `json:"first-name,omitempty"`
	BirthDate *string `json:"birth-date,omitempty"`
}

KycLivenessIdentity represent a detect identity in a kyc liveness

func (*KycLivenessIdentity) GetBirthDate

func (k *KycLivenessIdentity) GetBirthDate() string

GetBirthDate returns the BirthDate field if it's non-nil, zero value otherwise.

func (*KycLivenessIdentity) GetFirstName

func (k *KycLivenessIdentity) GetFirstName() string

GetFirstName returns the FirstName field if it's non-nil, zero value otherwise.

func (*KycLivenessIdentity) GetLastName

func (k *KycLivenessIdentity) GetLastName() string

GetLastName returns the LastName field if it's non-nil, zero value otherwise.

type KycLivenessUpdateEvent

type KycLivenessUpdateEvent struct {
	*KycLiveness
}

type Level

type Level int32
const (
	LevelNone          Level = 0
	LevelPending       Level = 1
	LevelRegular       Level = 2
	LevelStrong        Level = 3
	LevelRefused       Level = 4
	LevelInvestigating Level = 5
)

func (Level) String

func (l Level) String() string

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"pageNumber,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"pageCount,omitempty"`

	// For paginated result sets, the resource element you want to sort the list with.
	SortBy string `url:"sortBy,omitempty"`

	// For paginated result sets, The order you want to sort the list.
	// Possible values: DESC and ASC.
	SortOrder string `url:"sortOrder,omitempty"`

	// For paginated result sets, the creation date from which you want to filter the request result.
	// Format: YYYY-MM-DD HH:MM:SS
	CreatedFrom string `url:"createdDateFrom,omitempty"`

	// For paginated result sets, the creation date up to which you want to filter the request result.
	// Format: YYYY-MM-DD HH:MM:SS
	CreatedTo string `url:"createdDateFrom,omitempty"`

	// For paginated result sets, the modification date from which you want to filter the request result.
	// Format: YYYY-MM-DD HH:MM:SS
	UpdatedFrom string `url:"createdDateFrom,omitempty"`

	// For paginated result sets, the modification date up to which you want to filter the request result.
	// Format: YYYY-MM-DD HH:MM:SS
	UpdatedTo string `url:"createdDateFrom,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support pagination.

type LockStatus

type LockStatus int32

LockStatus is the card status.

const (
	Unlocked LockStatus = iota
	Locked
	Lost
	Stolen
)

All the possible card lock statuses.

type Origin

type Origin string

Origin represents who made the request.

const (
	// OperatorOrigin represents the support
	OperatorOrigin Origin = "OPERATOR"
	// UserOrigin represents the end user.
	UserOrigin Origin = "USER"
)

type PIN

type PIN struct {
	Current      string `json:"currentPIN,omitempty"`
	New          string `json:"newPIN,omitempty"`
	Confirmation string `json:"confirmPIN,omitempty"`
}

PIN is used to make PIN modification operations.

type Payin

type Payin struct {
	Access
	PayinID              *string         `json:"payinId,omitempty"`
	PayinTag             *string         `json:"payinTag,omitempty"`
	PayinStatus          *string         `json:"payinStatus,omitempty"`
	CodeStatus           *string         `json:"codeStatus,omitempty"`
	InformationStatus    *string         `json:"informationStatus,omitempty"`
	WalletID             *string         `json:"walletId,omitempty"`
	UserID               *string         `json:"userId,omitempty"`
	WalletEventName      *string         `json:"walletEventName,omitempty"`
	WalletAlias          *string         `json:"walletAlias,omitempty"`
	UserFirstname        *string         `json:"userFirstname,omitempty"`
	UserLastname         *string         `json:"userLastname,omitempty"`
	MessageToUser        *string         `json:"messageToUser,omitempty"`
	PaymentMethodID      *string         `json:"paymentMethodId,omitempty"`
	SubtotalItems        *float64        `json:"subtotalItems,string,omitempty"`
	SubtotalServices     *float64        `json:"subtotalServices,string,omitempty"`
	SubtotalTax          *float64        `json:"subtotalTax,string,omitempty"`
	Amount               *float64        `json:"amount,string,omitempty"`
	Currency             Currency        `json:"currency,omitempty"`
	DistributorFee       *float64        `json:"distributorFee,string,omitempty"`
	CreatedDate          *TimestampParis `json:"createdDate,omitempty"`
	CreatedIP            *string         `json:"createdIp,omitempty"`
	PaymentHTML          *string         `json:"paymentHtml,omitempty"`
	PaymentLanguage      *string         `json:"paymentLanguage,omitempty"`
	PaymentPostURL       *string         `json:"paymentPostUrl,omitempty"`
	PaymentPostDataURL   *string         `json:"paymentPostDataUrl,omitempty"`
	PaymentAcceptedURL   *string         `json:"paymentAcceptedUrl,omitempty"`
	PaymentWaitingURL    *string         `json:"paymentWaitingUrl,omitempty"`
	PaymentRefusedURL    *string         `json:"paymentRefusedUrl,omitempty"`
	PaymentCanceledURL   *string         `json:"paymentCanceledUrl,omitempty"`
	PaymentExceptionURL  *string         `json:"paymentExceptionUrl,omitempty"`
	DebitorIBAN          *string         `json:"DbtrIBAN,omitempty"`
	IBANFullname         *string         `json:"ibanFullname,omitempty"`
	IBANID               *string         `json:"ibanId,omitempty"`
	IBANBIC              *string         `json:"ibanBic,omitempty"`
	IBANTxEndToEndID     *string         `json:"ibanTxEndToEndId,omitempty"`
	IBANTxID             *string         `json:"ibanTxId,omitempty"`
	RefundAmount         *float64        `json:"refundAmount,string,omitempty"`
	TotalRows            *int64          `json:"totalRows,string,omitempty"`
	ForwardURL           *string         `json:"forwardUrl,omitempty"`
	PayinDate            *Date           `json:"payinDate,omitempty"`
	MandateID            *string         `json:"mandateId,omitempty"`
	CreditorName         *string         `json:"creditorName,omitempty"`
	CreditorAddressLine  *string         `json:"creditorAddressLine,omitempty"`
	CreditorCountry      *string         `json:"creditorCountry,omitempty"`
	CreditorIBAN         *string         `json:"creditorIban,omitempty"`
	CreditorBIC          *string         `json:"creditorBIC,omitempty"`
	VirtualIBANID        *string         `json:"virtualIbanId,omitempty"`
	VirtualIBANReference *string         `json:"virtualIbanReference,omitempty"`
	AdditionalData       *AdditionalDataOneOf
}

Payin represents a pay-in to a beneficiary.

func (*Payin) GetAdditionalData

func (p *Payin) GetAdditionalData() AdditionalDataOneOf

GetAdditionalData returns the AdditionalData field if it's non-nil, zero value otherwise.

func (*Payin) GetAmount

func (p *Payin) GetAmount() float64

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*Payin) GetCodeStatus

func (p *Payin) GetCodeStatus() string

GetCodeStatus returns the CodeStatus field if it's non-nil, zero value otherwise.

func (*Payin) GetCreatedDate

func (p *Payin) GetCreatedDate() TimestampParis

GetCreatedDate returns the CreatedDate field if it's non-nil, zero value otherwise.

func (*Payin) GetCreatedIP

func (p *Payin) GetCreatedIP() string

GetCreatedIP returns the CreatedIP field if it's non-nil, zero value otherwise.

func (*Payin) GetCreditorAddressLine

func (p *Payin) GetCreditorAddressLine() string

GetCreditorAddressLine returns the CreditorAddressLine field if it's non-nil, zero value otherwise.

func (*Payin) GetCreditorBIC

func (p *Payin) GetCreditorBIC() string

GetCreditorBIC returns the CreditorBIC field if it's non-nil, zero value otherwise.

func (*Payin) GetCreditorCountry

func (p *Payin) GetCreditorCountry() string

GetCreditorCountry returns the CreditorCountry field if it's non-nil, zero value otherwise.

func (*Payin) GetCreditorIBAN

func (p *Payin) GetCreditorIBAN() string

GetCreditorIBAN returns the CreditorIBAN field if it's non-nil, zero value otherwise.

func (*Payin) GetCreditorName

func (p *Payin) GetCreditorName() string

GetCreditorName returns the CreditorName field if it's non-nil, zero value otherwise.

func (*Payin) GetDebitorIBAN

func (p *Payin) GetDebitorIBAN() string

GetDebitorIBAN returns the DebitorIBAN field if it's non-nil, zero value otherwise.

func (*Payin) GetDistributorFee

func (p *Payin) GetDistributorFee() float64

GetDistributorFee returns the DistributorFee field if it's non-nil, zero value otherwise.

func (*Payin) GetForwardURL

func (p *Payin) GetForwardURL() string

GetForwardURL returns the ForwardURL field if it's non-nil, zero value otherwise.

func (*Payin) GetIBANBIC

func (p *Payin) GetIBANBIC() string

GetIBANBIC returns the IBANBIC field if it's non-nil, zero value otherwise.

func (*Payin) GetIBANFullname

func (p *Payin) GetIBANFullname() string

GetIBANFullname returns the IBANFullname field if it's non-nil, zero value otherwise.

func (*Payin) GetIBANID

func (p *Payin) GetIBANID() string

GetIBANID returns the IBANID field if it's non-nil, zero value otherwise.

func (*Payin) GetIBANTxEndToEndID

func (p *Payin) GetIBANTxEndToEndID() string

GetIBANTxEndToEndID returns the IBANTxEndToEndID field if it's non-nil, zero value otherwise.

func (*Payin) GetIBANTxID

func (p *Payin) GetIBANTxID() string

GetIBANTxID returns the IBANTxID field if it's non-nil, zero value otherwise.

func (*Payin) GetInformationStatus

func (p *Payin) GetInformationStatus() string

GetInformationStatus returns the InformationStatus field if it's non-nil, zero value otherwise.

func (*Payin) GetMandateID

func (p *Payin) GetMandateID() string

GetMandateID returns the MandateID field if it's non-nil, zero value otherwise.

func (*Payin) GetMessageToUser

func (p *Payin) GetMessageToUser() string

GetMessageToUser returns the MessageToUser field if it's non-nil, zero value otherwise.

func (*Payin) GetPayinDate

func (p *Payin) GetPayinDate() Date

GetPayinDate returns the PayinDate field if it's non-nil, zero value otherwise.

func (*Payin) GetPayinID

func (p *Payin) GetPayinID() string

GetPayinID returns the PayinID field if it's non-nil, zero value otherwise.

func (*Payin) GetPayinStatus

func (p *Payin) GetPayinStatus() string

GetPayinStatus returns the PayinStatus field if it's non-nil, zero value otherwise.

func (*Payin) GetPayinTag

func (p *Payin) GetPayinTag() string

GetPayinTag returns the PayinTag field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentAcceptedURL

func (p *Payin) GetPaymentAcceptedURL() string

GetPaymentAcceptedURL returns the PaymentAcceptedURL field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentCanceledURL

func (p *Payin) GetPaymentCanceledURL() string

GetPaymentCanceledURL returns the PaymentCanceledURL field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentExceptionURL

func (p *Payin) GetPaymentExceptionURL() string

GetPaymentExceptionURL returns the PaymentExceptionURL field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentHTML

func (p *Payin) GetPaymentHTML() string

GetPaymentHTML returns the PaymentHTML field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentLanguage

func (p *Payin) GetPaymentLanguage() string

GetPaymentLanguage returns the PaymentLanguage field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentMethodID

func (p *Payin) GetPaymentMethodID() string

GetPaymentMethodID returns the PaymentMethodID field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentPostDataURL

func (p *Payin) GetPaymentPostDataURL() string

GetPaymentPostDataURL returns the PaymentPostDataURL field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentPostURL

func (p *Payin) GetPaymentPostURL() string

GetPaymentPostURL returns the PaymentPostURL field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentRefusedURL

func (p *Payin) GetPaymentRefusedURL() string

GetPaymentRefusedURL returns the PaymentRefusedURL field if it's non-nil, zero value otherwise.

func (*Payin) GetPaymentWaitingURL

func (p *Payin) GetPaymentWaitingURL() string

GetPaymentWaitingURL returns the PaymentWaitingURL field if it's non-nil, zero value otherwise.

func (*Payin) GetRefundAmount

func (p *Payin) GetRefundAmount() float64

GetRefundAmount returns the RefundAmount field if it's non-nil, zero value otherwise.

func (*Payin) GetSubtotalItems

func (p *Payin) GetSubtotalItems() float64

GetSubtotalItems returns the SubtotalItems field if it's non-nil, zero value otherwise.

func (*Payin) GetSubtotalServices

func (p *Payin) GetSubtotalServices() float64

GetSubtotalServices returns the SubtotalServices field if it's non-nil, zero value otherwise.

func (*Payin) GetSubtotalTax

func (p *Payin) GetSubtotalTax() float64

GetSubtotalTax returns the SubtotalTax field if it's non-nil, zero value otherwise.

func (*Payin) GetTotalRows

func (p *Payin) GetTotalRows() int64

GetTotalRows returns the TotalRows field if it's non-nil, zero value otherwise.

func (*Payin) GetUserFirstname

func (p *Payin) GetUserFirstname() string

GetUserFirstname returns the UserFirstname field if it's non-nil, zero value otherwise.

func (*Payin) GetUserID

func (p *Payin) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

func (*Payin) GetUserLastname

func (p *Payin) GetUserLastname() string

GetUserLastname returns the UserLastname field if it's non-nil, zero value otherwise.

func (*Payin) GetVirtualIBANID

func (p *Payin) GetVirtualIBANID() string

GetVirtualIBANID returns the VirtualIBANID field if it's non-nil, zero value otherwise.

func (*Payin) GetVirtualIBANReference

func (p *Payin) GetVirtualIBANReference() string

GetVirtualIBANReference returns the VirtualIBANReference field if it's non-nil, zero value otherwise.

func (*Payin) GetWalletAlias

func (p *Payin) GetWalletAlias() string

GetWalletAlias returns the WalletAlias field if it's non-nil, zero value otherwise.

func (*Payin) GetWalletEventName

func (p *Payin) GetWalletEventName() string

GetWalletEventName returns the WalletEventName field if it's non-nil, zero value otherwise.

func (*Payin) GetWalletID

func (p *Payin) GetWalletID() string

GetWalletID returns the WalletID field if it's non-nil, zero value otherwise.

type PayinCancelEvent

type PayinCancelEvent struct {
	PayinResponse
}

type PayinCreateEvent

type PayinCreateEvent struct {
	PayinResponse
}

type PayinListOptions

type PayinListOptions struct {
	PayinStatus     string `url:"payinStatus,omitempty"`
	UserID          string `url:"userId,omitempty"`
	WalletID        string `url:"walletId,omitempty"`
	CreatedDateFrom string `url:"createdDateFrom,omitempty"`
	CreatedDateTo   string `url:"createdDateTo,omitempty"`

	ListOptions
}

PayinListOptions specifies the optional parameters to the PayinService.List.

type PayinResponse

type PayinResponse struct {
	Payins []*Payin `json:"payins"`
}

PayinResponse represents a list of payins. It may contain only one item.

func (*PayinResponse) GetPayins

func (p *PayinResponse) GetPayins() []*Payin

GetPayins returns the Payins field.

type PayinService

type PayinService service

PayinService handles communication with the payin related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/payin

func (*PayinService) Create

func (s *PayinService) Create(ctx context.Context, payin *Payin) (*Payin, *http.Response, error)

Create creates a Treezor pay-in. The required field are WalletID, BeneficiaryID, Amount, Currency(ISO 4217).

func (*PayinService) Delete

func (s *PayinService) Delete(ctx context.Context, payinID string) (*Payin, *http.Response, error)

Delete deletes a payin. Change payin's status to CANCELED. A validated payin can't be cancelled.

func (*PayinService) Get

func (s *PayinService) Get(ctx context.Context, payinID string) (*Payin, *http.Response, error)

Get returns a pay-in.

func (*PayinService) List

List the pay-ins for the authenticated user.

type PayinUpdateEvent

type PayinUpdateEvent struct {
	PayinResponse
}

type Payout

type Payout struct {
	Access
	PayoutID               *string         `json:"payoutId,omitempty"`
	PayoutTag              *string         `json:"payoutTag,omitempty"`
	PayoutStatus           *string         `json:"payoutStatus,omitempty"`
	PayoutTypeID           *string         `json:"payoutTypeId,omitempty"`
	PayoutType             *string         `json:"payoutType,omitempty"`
	WalletID               *string         `json:"walletId,omitempty"`
	PayoutDate             *Date           `json:"payoutDate,omitempty"`
	WalletEventName        *string         `json:"walletEventName,omitempty"`
	WalletAlias            *string         `json:"walletAlias,omitempty"`
	UserFirstname          *string         `json:"userFirstname,omitempty"`
	UserLastname           *string         `json:"userLastname,omitempty"`
	UserID                 *string         `json:"userId,omitempty"`
	BeneficiaryID          *string         `json:"beneficiaryId,omitempty"`
	UniqueMandateReference *string         `json:"uniqueMandateReference,omitempty"`
	Label                  *string         `json:"label,omitempty"`
	Amount                 *float64        `json:"amount,string,omitempty"`
	Currency               Currency        `json:"currency,omitempty"`
	PartnerFee             *float64        `json:"partnerFee,string,omitempty"`
	CreatedDate            *TimestampParis `json:"createdDate,omitempty"`
	ModifiedDate           *TimestampParis `json:"modifiedDate,omitempty"`
	TotalRows              *int64          `json:"totalRows,string,omitempty"`
}

Payout represents a pay-out to a beneficiary.

func (*Payout) GetAmount

func (p *Payout) GetAmount() float64

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*Payout) GetBeneficiaryID

func (p *Payout) GetBeneficiaryID() string

GetBeneficiaryID returns the BeneficiaryID field if it's non-nil, zero value otherwise.

func (*Payout) GetCreatedDate

func (p *Payout) GetCreatedDate() TimestampParis

GetCreatedDate returns the CreatedDate field if it's non-nil, zero value otherwise.

func (*Payout) GetLabel

func (p *Payout) GetLabel() string

GetLabel returns the Label field if it's non-nil, zero value otherwise.

func (*Payout) GetModifiedDate

func (p *Payout) GetModifiedDate() TimestampParis

GetModifiedDate returns the ModifiedDate field if it's non-nil, zero value otherwise.

func (*Payout) GetPartnerFee

func (p *Payout) GetPartnerFee() float64

GetPartnerFee returns the PartnerFee field if it's non-nil, zero value otherwise.

func (*Payout) GetPayoutDate

func (p *Payout) GetPayoutDate() Date

GetPayoutDate returns the PayoutDate field if it's non-nil, zero value otherwise.

func (*Payout) GetPayoutID

func (p *Payout) GetPayoutID() string

GetPayoutID returns the PayoutID field if it's non-nil, zero value otherwise.

func (*Payout) GetPayoutStatus

func (p *Payout) GetPayoutStatus() string

GetPayoutStatus returns the PayoutStatus field if it's non-nil, zero value otherwise.

func (*Payout) GetPayoutTag

func (p *Payout) GetPayoutTag() string

GetPayoutTag returns the PayoutTag field if it's non-nil, zero value otherwise.

func (*Payout) GetPayoutType

func (p *Payout) GetPayoutType() string

GetPayoutType returns the PayoutType field if it's non-nil, zero value otherwise.

func (*Payout) GetPayoutTypeID

func (p *Payout) GetPayoutTypeID() string

GetPayoutTypeID returns the PayoutTypeID field if it's non-nil, zero value otherwise.

func (*Payout) GetTotalRows

func (p *Payout) GetTotalRows() int64

GetTotalRows returns the TotalRows field if it's non-nil, zero value otherwise.

func (*Payout) GetUniqueMandateReference

func (p *Payout) GetUniqueMandateReference() string

GetUniqueMandateReference returns the UniqueMandateReference field if it's non-nil, zero value otherwise.

func (*Payout) GetUserFirstname

func (p *Payout) GetUserFirstname() string

GetUserFirstname returns the UserFirstname field if it's non-nil, zero value otherwise.

func (*Payout) GetUserID

func (p *Payout) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

func (*Payout) GetUserLastname

func (p *Payout) GetUserLastname() string

GetUserLastname returns the UserLastname field if it's non-nil, zero value otherwise.

func (*Payout) GetWalletAlias

func (p *Payout) GetWalletAlias() string

GetWalletAlias returns the WalletAlias field if it's non-nil, zero value otherwise.

func (*Payout) GetWalletEventName

func (p *Payout) GetWalletEventName() string

GetWalletEventName returns the WalletEventName field if it's non-nil, zero value otherwise.

func (*Payout) GetWalletID

func (p *Payout) GetWalletID() string

GetWalletID returns the WalletID field if it's non-nil, zero value otherwise.

type PayoutCancelEvent

type PayoutCancelEvent struct {
	PayoutResponse
}

type PayoutCreateEvent

type PayoutCreateEvent struct {
	PayoutResponse
}

type PayoutListOptions

type PayoutListOptions struct {
	PayoutStatus    string `url:"payoutStatus,omitempty"`
	UserID          string `url:"userId,omitempty"`
	WalletID        string `url:"walletId,omitempty"`
	PayoutTypeID    string `url:"payoutId,omitempty"`
	CreatedDateFrom string `url:"createdDateFrom,omitempty"`
	CreatedDateTo   string `url:"createdDateTo,omitempty"`

	ListOptions
}

PayoutListOptions specifies the optional parameters to the PayoutService.List.

type PayoutResponse

type PayoutResponse struct {
	Payouts []*Payout `json:"payouts"`
}

PayoutResponse represents a list of payouts. It may contain only one item.

func (*PayoutResponse) GetPayouts

func (p *PayoutResponse) GetPayouts() []*Payout

GetPayouts returns the Payouts field.

type PayoutService

type PayoutService service

PayoutService handles communication with the payout related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/payout

func (*PayoutService) Create

func (s *PayoutService) Create(ctx context.Context, payout *Payout) (*Payout, *http.Response, error)

Create creates a Treezor pay-out. The required field are WalletID, BeneficiaryID, Amount, Currency(ISO 4217).

func (*PayoutService) Delete

func (s *PayoutService) Delete(ctx context.Context, payoutID string) (*Payout, *http.Response, error)

Delete deletes a payout. Change payout's status to CANCELED. A validated payout can't be cancelled.

func (*PayoutService) Get

func (s *PayoutService) Get(ctx context.Context, payoutID string) (*Payout, *http.Response, error)

Get returns a pay-out.

func (*PayoutService) List

List the pay-outs for the authenticated user.

type PayoutUpdateEvent

type PayoutUpdateEvent struct {
	PayoutResponse
}

type Review

type Review int32
const (
	ReviewNone      Review = 0
	ReviewPending   Review = 1
	ReviewValidated Review = 2
	ReviewRefused   Review = 3
)

func (Review) String

func (r Review) String() string

type SDDB2BWhitelist

type SDDB2BWhitelist struct {
	UniqueMandateReference *string `json:"uniqueMandateReference,omitempty"`
	IsRecurrent            *bool   `json:"isRecurrent,omitempty"`
	BeneficiaryID          *string `json:"beneficiaryId,omitempty"`
}

SDDB2BWhitelist is a whitelisted company for B2B SEPA mandates.

func (*SDDB2BWhitelist) GetBeneficiaryID

func (s *SDDB2BWhitelist) GetBeneficiaryID() string

GetBeneficiaryID returns the BeneficiaryID field if it's non-nil, zero value otherwise.

func (*SDDB2BWhitelist) GetIsRecurrent

func (s *SDDB2BWhitelist) GetIsRecurrent() bool

GetIsRecurrent returns the IsRecurrent field if it's non-nil, zero value otherwise.

func (*SDDB2BWhitelist) GetUniqueMandateReference

func (s *SDDB2BWhitelist) GetUniqueMandateReference() string

GetUniqueMandateReference returns the UniqueMandateReference field if it's non-nil, zero value otherwise.

type SepaSddr

type SepaSddr struct {
	Access
	WalletID                  *int64  `json:"wallet_id,omitempty"`
	VirtualIbanID             *string `json:"virtual_iban_id,omitempty"`
	TransactionID             *string `json:"transaction_id,omitempty"`
	SequenceType              *string `json:"sequence_type,omitempty"`
	RejectReasonCode          *string `json:"reject_reason_code,omitempty"`
	InterbankSettlementAmount *string `json:"interbank_settlement_amount,omitempty"`
	RequestedCollectionDate   *string `json:"requested_collection_date,omitempty"`
	MandateID                 *string `json:"mandate_id,omitempty"`
	SepaCreditorIdentifier    *string `json:"sepa_creditor_identifier,omitempty"`
	DateOfSignature           *string `json:"date_of_signature,omitempty"`
	DebitorName               *string `json:"debitor_name,omitempty"`
	DebitorAddress            *string `json:"debitor_address,omitempty"`
	DebitorCountry            *string `json:"debitor_country,omitempty"`
	CreditorName              *string `json:"creditor_name,omitempty"`
	CreditorAddress           *string `json:"creditor_address,omitempty"`
	CreditorCountry           *string `json:"creditor_country,omitempty"`
	UnstructuredField         *string `json:"unstructured_field,omitempty"`
	BankaccountID             *string `json:"bankaccount_id,omitempty"`
	BeneficiaryID             *string `json:"beneficiary_id,omitempty"`
}

SepaSddr represent a sdd reject object

func (*SepaSddr) GetBankaccountID

func (s *SepaSddr) GetBankaccountID() string

GetBankaccountID returns the BankaccountID field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetBeneficiaryID

func (s *SepaSddr) GetBeneficiaryID() string

GetBeneficiaryID returns the BeneficiaryID field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetCreditorAddress

func (s *SepaSddr) GetCreditorAddress() string

GetCreditorAddress returns the CreditorAddress field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetCreditorCountry

func (s *SepaSddr) GetCreditorCountry() string

GetCreditorCountry returns the CreditorCountry field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetCreditorName

func (s *SepaSddr) GetCreditorName() string

GetCreditorName returns the CreditorName field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetDateOfSignature

func (s *SepaSddr) GetDateOfSignature() string

GetDateOfSignature returns the DateOfSignature field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetDebitorAddress

func (s *SepaSddr) GetDebitorAddress() string

GetDebitorAddress returns the DebitorAddress field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetDebitorCountry

func (s *SepaSddr) GetDebitorCountry() string

GetDebitorCountry returns the DebitorCountry field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetDebitorName

func (s *SepaSddr) GetDebitorName() string

GetDebitorName returns the DebitorName field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetInterbankSettlementAmount

func (s *SepaSddr) GetInterbankSettlementAmount() string

GetInterbankSettlementAmount returns the InterbankSettlementAmount field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetMandateID

func (s *SepaSddr) GetMandateID() string

GetMandateID returns the MandateID field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetRejectReasonCode

func (s *SepaSddr) GetRejectReasonCode() string

GetRejectReasonCode returns the RejectReasonCode field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetRequestedCollectionDate

func (s *SepaSddr) GetRequestedCollectionDate() string

GetRequestedCollectionDate returns the RequestedCollectionDate field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetSepaCreditorIdentifier

func (s *SepaSddr) GetSepaCreditorIdentifier() string

GetSepaCreditorIdentifier returns the SepaCreditorIdentifier field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetSequenceType

func (s *SepaSddr) GetSequenceType() string

GetSequenceType returns the SequenceType field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetTransactionID

func (s *SepaSddr) GetTransactionID() string

GetTransactionID returns the TransactionID field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetUnstructuredField

func (s *SepaSddr) GetUnstructuredField() string

GetUnstructuredField returns the UnstructuredField field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetVirtualIbanID

func (s *SepaSddr) GetVirtualIbanID() string

GetVirtualIbanID returns the VirtualIbanID field if it's non-nil, zero value otherwise.

func (*SepaSddr) GetWalletID

func (s *SepaSddr) GetWalletID() int64

GetWalletID returns the WalletID field if it's non-nil, zero value otherwise.

type SepaSddrCoreRejectEvent

type SepaSddrCoreRejectEvent struct {
	SepaSddrResponse
}

type SepaSddrResponse

type SepaSddrResponse struct {
	SepaSddrs []*SepaSddr `json:"sepaSddrs"`
}

SepaSddrResponse represent data send when a sepa.reject_sdd is received

func (*SepaSddrResponse) GetSepaSddrs

func (s *SepaSddrResponse) GetSepaSddrs() []*SepaSddr

GetSepaSddrs returns the SepaSddrs field.

type TaxResidence

type TaxResidence struct {
	ID              *int64  `json:"id,omitempty"`
	UserID          *int64  `json:"userId,omitempty"`
	Country         *string `json:"country,omitempty"`
	TaxPayerID      *string `json:"taxPayerId,omitempty"`
	LiabilityWaiver *bool   `json:"liabilityWaiver,omitempty"`
}

TaxResidence represents a kyc TaxResidences

func (*TaxResidence) GetCountry

func (t *TaxResidence) GetCountry() string

GetCountry returns the Country field if it's non-nil, zero value otherwise.

func (*TaxResidence) GetID

func (t *TaxResidence) GetID() int64

GetID returns the ID field if it's non-nil, zero value otherwise.

func (*TaxResidence) GetLiabilityWaiver

func (t *TaxResidence) GetLiabilityWaiver() bool

GetLiabilityWaiver returns the LiabilityWaiver field if it's non-nil, zero value otherwise.

func (*TaxResidence) GetTaxPayerID

func (t *TaxResidence) GetTaxPayerID() string

GetTaxPayerID returns the TaxPayerID field if it's non-nil, zero value otherwise.

func (*TaxResidence) GetUserID

func (t *TaxResidence) GetUserID() int64

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

type TaxResidencesResponse

type TaxResidencesResponse struct {
	TaxResidences []*TaxResidence `json:"taxResidences,omitempty"`
}

TaxResidencesResponse returns an array of TaxResidence. Array may contain only one item.

func (*TaxResidencesResponse) GetTaxResidences

func (t *TaxResidencesResponse) GetTaxResidences() []*TaxResidence

GetTaxResidences returns the TaxResidences field.

type TaxResidencesService

type TaxResidencesService service

TaxResidencesService handles the communication with tax residences related kyc methods

Treezor API docs: https://www.treezor.com/api-documentation/#!/taxResidence/

func (*TaxResidencesService) Create

func (s *TaxResidencesService) Create(ctx context.Context, taxResidence *TaxResidence) (*TaxResidence, *http.Response, error)

Create tax residences in Treezor.

func (*TaxResidencesService) Edit

func (s *TaxResidencesService) Edit(ctx context.Context, taxResidenceID int64, taxResidence *TaxResidence) (*TaxResidence, *http.Response, error)

Edit updates a tax residences.

type TimestampLondon

type TimestampLondon timestamp

TimestampLondon london time zone

func NewTimestampLondon

func NewTimestampLondon(t time.Time) *TimestampLondon

NewTimestampLondon create a timestamp with the right location for testing

func (*TimestampLondon) MarshalJSON

func (t *TimestampLondon) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. Time is return as "YYYY-MM-DD HH:mm:ss" or "YYYY-MM-DD" depending whether Timestamp.Short is true. time zone Europe/Paris

func (*TimestampLondon) UnmarshalJSON

func (t *TimestampLondon) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in "YYYY-MM-DD HH:mm:ss" or "YYYY-MM-DD". Time zone Europe/Paris

type TimestampParis

type TimestampParis timestamp

TimestampParis Paris time zone

func NewTimestampParis

func NewTimestampParis(t time.Time) *TimestampParis

NewTimestampParis create a timestamp with the right location for testing

func (*TimestampParis) MarshalJSON

func (t *TimestampParis) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface. Time is return as "YYYY-MM-DD HH:mm:ss" or "YYYY-MM-DD" depending whether Timestamp.Short is true. time zone Europe/Paris

func (*TimestampParis) UnmarshalJSON

func (t *TimestampParis) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in "YYYY-MM-DD HH:mm:ss" or "YYYY-MM-DD". Time zone Europe/Paris

type Transfer

type Transfer struct {
	Access
	TransferID                 *string         `json:"transferId,omitempty"`
	TransferStatus             *string         `json:"transferStatus,omitempty"`
	TransferTypeID             TransferType    `json:"transferTypeId,omitempty"`
	TransferTag                *string         `json:"transferTag,omitempty"`
	WalletID                   *string         `json:"walletId,omitempty"`
	WalletTypeID               *string         `json:"walletTypeId,omitempty"`
	BeneficiaryWalletID        *string         `json:"beneficiaryWalletId,omitempty"`
	BeneficiaryWalletTypeID    *string         `json:"beneficiaryWalletTypeId,omitempty"`
	TransferDate               *Date           `json:"transferDate,omitempty"`
	WalletEventName            *string         `json:"walletEventName,omitempty"`
	WalletAlias                *string         `json:"walletAlias,omitempty"`
	BeneficiaryWalletEventName *string         `json:"beneficiaryWalletEventName,omitempty"`
	BeneficiaryWalletAlias     *string         `json:"beneficiaryWalletAlias,omitempty"`
	Amount                     *float64        `json:"amount,string,omitempty"`
	Currency                   Currency        `json:"currency,omitempty"`
	Label                      *string         `json:"label,omitempty"`
	CreatedDate                *TimestampParis `json:"createdDate,omitempty"`
	ModifiedDate               *TimestampParis `json:"modifiedDate,omitempty"`
	TotalRows                  *int64          `json:"totalRows,string,omitempty"`
}

Transfer represents a transfer.

func (*Transfer) GetAmount

func (t *Transfer) GetAmount() float64

GetAmount returns the Amount field if it's non-nil, zero value otherwise.

func (*Transfer) GetBeneficiaryWalletAlias

func (t *Transfer) GetBeneficiaryWalletAlias() string

GetBeneficiaryWalletAlias returns the BeneficiaryWalletAlias field if it's non-nil, zero value otherwise.

func (*Transfer) GetBeneficiaryWalletEventName

func (t *Transfer) GetBeneficiaryWalletEventName() string

GetBeneficiaryWalletEventName returns the BeneficiaryWalletEventName field if it's non-nil, zero value otherwise.

func (*Transfer) GetBeneficiaryWalletID

func (t *Transfer) GetBeneficiaryWalletID() string

GetBeneficiaryWalletID returns the BeneficiaryWalletID field if it's non-nil, zero value otherwise.

func (*Transfer) GetBeneficiaryWalletTypeID

func (t *Transfer) GetBeneficiaryWalletTypeID() string

GetBeneficiaryWalletTypeID returns the BeneficiaryWalletTypeID field if it's non-nil, zero value otherwise.

func (*Transfer) GetCreatedDate

func (t *Transfer) GetCreatedDate() TimestampParis

GetCreatedDate returns the CreatedDate field if it's non-nil, zero value otherwise.

func (*Transfer) GetLabel

func (t *Transfer) GetLabel() string

GetLabel returns the Label field if it's non-nil, zero value otherwise.

func (*Transfer) GetModifiedDate

func (t *Transfer) GetModifiedDate() TimestampParis

GetModifiedDate returns the ModifiedDate field if it's non-nil, zero value otherwise.

func (*Transfer) GetTotalRows

func (t *Transfer) GetTotalRows() int64

GetTotalRows returns the TotalRows field if it's non-nil, zero value otherwise.

func (*Transfer) GetTransferDate

func (t *Transfer) GetTransferDate() Date

GetTransferDate returns the TransferDate field if it's non-nil, zero value otherwise.

func (*Transfer) GetTransferID

func (t *Transfer) GetTransferID() string

GetTransferID returns the TransferID field if it's non-nil, zero value otherwise.

func (*Transfer) GetTransferStatus

func (t *Transfer) GetTransferStatus() string

GetTransferStatus returns the TransferStatus field if it's non-nil, zero value otherwise.

func (*Transfer) GetTransferTag

func (t *Transfer) GetTransferTag() string

GetTransferTag returns the TransferTag field if it's non-nil, zero value otherwise.

func (*Transfer) GetWalletAlias

func (t *Transfer) GetWalletAlias() string

GetWalletAlias returns the WalletAlias field if it's non-nil, zero value otherwise.

func (*Transfer) GetWalletEventName

func (t *Transfer) GetWalletEventName() string

GetWalletEventName returns the WalletEventName field if it's non-nil, zero value otherwise.

func (*Transfer) GetWalletID

func (t *Transfer) GetWalletID() string

GetWalletID returns the WalletID field if it's non-nil, zero value otherwise.

func (*Transfer) GetWalletTypeID

func (t *Transfer) GetWalletTypeID() string

GetWalletTypeID returns the WalletTypeID field if it's non-nil, zero value otherwise.

type TransferCancelEvent

type TransferCancelEvent struct {
	TransferResponse
}

type TransferCreateEvent

type TransferCreateEvent struct {
	TransferResponse
}

type TransferListOptions

type TransferListOptions struct {
	UserID              string `url:"userId,omitempty"`
	BeneficiaryUserID   string `url:"beneficiaryUserId,omitempty"`
	WalletID            string `url:"walletId,omitempty"`
	BeneficiaryWalletID string `url:"beneficiaryWalletId,omitempty"`
	TransferStatus      string `url:"transferStatus,omitempty"`
	TransferTypeID      string `url:"transferTypeId,omitempty"`
	TransferTag         string `url:"transferTag,omitempty"`
	Label               string `url:"label,omitempty"`
	CreatedDateFrom     string `url:"createdDateFrom,omitempty"`
	CreatedDateTo       string `url:"createdDateTo,omitempty"`

	ListOptions
}

TransferListOptions specifies the optional parameters to the TransferService.List.

type TransferResponse

type TransferResponse struct {
	Transfers []*Transfer `json:"transfers"`
}

TransferResponse represents a list of transfers. It may contain only one item.

func (*TransferResponse) GetTransfers

func (t *TransferResponse) GetTransfers() []*Transfer

GetTransfers returns the Transfers field.

type TransferService

type TransferService service

TransferService handles communication with the transfer related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/transfer

func (*TransferService) Create

func (s *TransferService) Create(ctx context.Context, transfer *Transfer) (*Transfer, *http.Response, error)

Create creates a Treezor transfer. Required: WalletID, BeneficiaryWalletID,Amount,Currency(ISO 4217)

func (*TransferService) Delete

func (s *TransferService) Delete(ctx context.Context, transferID string) (*Transfer, *http.Response, error)

Delete deletes a transfer. Change transfer's status to CANCELED. A validated transfer can't be cancelled.

func (*TransferService) Get

func (s *TransferService) Get(ctx context.Context, transferID string) (*Transfer, *http.Response, error)

Get returns a transfer.

func (*TransferService) List

List the transfers for the authenticated user.s

type TransferType

type TransferType string

TransferType defines the type of transfer we're doing.

const (
	// Wallet2WalletTransfer is a transfer type used for peer-to-peer transaction.
	Wallet2WalletTransfer TransferType = "1"
	// ClientFeesTransfer is transfer type used for client fees.
	ClientFeesTransfer TransferType = "3"
	// CreditNoteTransfer is a transfer type used for credit note.
	CreditNoteTransfer TransferType = "4"
)

type TransferUpdateEvent

type TransferUpdateEvent struct {
	TransferResponse
}

type User

type User struct {
	Access
	UserID                     *string         `json:"userId,omitempty"`
	UserTypeID                 *string         `json:"userTypeId,omitempty"`
	UserStatus                 *string         `json:"userStatus,omitempty"`
	ParentUserID               *string         `json:"parentUserId,omitempty"`
	ParentType                 *string         `json:"parentType,omitempty"`
	ControllingPersonType      *string         `json:"controllingPersonType,omitempty"`
	EmployeeType               *string         `json:"employeeType,omitempty"`
	ClientID                   *string         `json:"clientId,omitempty"`
	UserTag                    *string         `json:"userTag,omitempty"`
	SpecifiedUSPerson          *string         `json:"specifiedUSPerson,omitempty"`
	Title                      *string         `json:"title,omitempty"`
	Firstname                  *string         `json:"firstname,omitempty"`
	Lastname                   *string         `json:"lastname,omitempty"`
	MiddleNames                *string         `json:"middleNames,omitempty"`
	Birthday                   *Date           `json:"birthday,omitempty"`
	Email                      *string         `json:"email,omitempty"`
	Address1                   *string         `json:"address1,omitempty"`
	Address2                   *string         `json:"address2,omitempty"`
	Address3                   *string         `json:"address3,omitempty"`
	Postcode                   *string         `json:"postcode,omitempty"`
	City                       *string         `json:"city,omitempty"`
	State                      *string         `json:"state,omitempty"`
	Country                    *string         `json:"country,omitempty"`
	CountryName                *string         `json:"countryName,omitempty"`
	Phone                      *string         `json:"phone,omitempty"`
	Mobile                     *string         `json:"mobile,omitempty"`
	Nationality                *string         `json:"nationality,omitempty"`
	NationalityOther           *string         `json:"nationalityOther,omitempty"`
	PlaceOfBirth               *string         `json:"placeOfBirth,omitempty"`
	BirthCountry               *string         `json:"birthCountry,omitempty"`
	Occupation                 *string         `json:"occupation,omitempty"`
	Position                   *string         `json:"position,omitempty"`
	IncomeRange                *string         `json:"incomeRange,omitempty"`
	PersonalAssets             *string         `json:"personalAssets,omitempty"`
	LegalName                  *string         `json:"legalName,omitempty"`
	LegalNameEmbossed          *string         `json:"legalNameEmbossed,omitempty"`
	LegalRegistrationNumber    *string         `json:"legalRegistrationNumber,omitempty"`
	LegalTvaNumber             *string         `json:"legalTvaNumber,omitempty"`
	LegalRegistrationDate      *Date           `json:"legalRegistrationDate,omitempty"`
	LegalForm                  *string         `json:"legalForm,omitempty"`
	LegalShareCapital          *string         `json:"legalShareCapital,omitempty"`
	LegalSector                *string         `json:"legalSector,omitempty"`
	LegalAnnualTurnOver        *string         `json:"legalAnnualTurnOver,omitempty"`
	LegalNetIncomeRange        *string         `json:"legalNetIncomeRange,omitempty"`
	LegalNumberOfEmployeeRange *string         `json:"legalNumberOfEmployeeRange,omitempty"`
	EffectiveBeneficiary       *string         `json:"effectiveBeneficiary,omitempty"`
	KycLevel                   *Level          `json:"kycLevel,string,omitempty"`
	KycReview                  *Review         `json:"kycReview,string,omitempty"`
	KycReviewComment           *string         `json:"kycReviewComment,omitempty"`
	IsFreezed                  *int64          `json:"isFreezed,string,omitempty"`
	Language                   *string         `json:"language,omitempty"`
	SepaCreditorIdentifier     *string         `json:"sepaCreditorIdentifier,omitempty"`
	CreatedDate                *TimestampParis `json:"createdDate,omitempty"`
	ModifiedDate               *TimestampParis `json:"modifiedDate,omitempty"`
	CodeStatus                 *string         `json:"codeStatus,omitempty"`
	TaxNumber                  *string         `json:"taxNumber,omitempty"`
	TaxResidence               *string         `json:"taxResidence,omitempty"`
	ActivityOutsideEu          *string         `json:"activityOutsideEu,omitempty"`
	EconomicSanctions          *string         `json:"economicSanctions,omitempty"`
	ResidentCountriesSanctions *string         `json:"residentCountriesSanctions,omitempty"`
	InvolvedSanctions          *string         `json:"involvedSanctions,omitempty"`
	SanctionsQuestionnaireDate *string         `json:"sanctionsQuestionnaireDate,omitempty"`
	InformationStatus          *string         `json:"informationStatus,omitempty"`
	EntityType                 *string         `json:"entityType,omitempty"`
	WalletCount                *int64          `json:"walletCount,string,omitempty"`
	PayinCount                 *int64          `json:"payinCount,string,omitempty"`
	TotalRows                  *int64          `json:"totalRows,string,omitempty"`
}

User represents a Treezor User.

func (*User) GetActivityOutsideEu

func (u *User) GetActivityOutsideEu() string

GetActivityOutsideEu returns the ActivityOutsideEu field if it's non-nil, zero value otherwise.

func (*User) GetAddress1

func (u *User) GetAddress1() string

GetAddress1 returns the Address1 field if it's non-nil, zero value otherwise.

func (*User) GetAddress2

func (u *User) GetAddress2() string

GetAddress2 returns the Address2 field if it's non-nil, zero value otherwise.

func (*User) GetAddress3

func (u *User) GetAddress3() string

GetAddress3 returns the Address3 field if it's non-nil, zero value otherwise.

func (*User) GetBirthCountry

func (u *User) GetBirthCountry() string

GetBirthCountry returns the BirthCountry field if it's non-nil, zero value otherwise.

func (*User) GetBirthday

func (u *User) GetBirthday() Date

GetBirthday returns the Birthday field if it's non-nil, zero value otherwise.

func (*User) GetCity

func (u *User) GetCity() string

GetCity returns the City field if it's non-nil, zero value otherwise.

func (*User) GetClientID

func (u *User) GetClientID() string

GetClientID returns the ClientID field if it's non-nil, zero value otherwise.

func (*User) GetCodeStatus

func (u *User) GetCodeStatus() string

GetCodeStatus returns the CodeStatus field if it's non-nil, zero value otherwise.

func (*User) GetControllingPersonType

func (u *User) GetControllingPersonType() string

GetControllingPersonType returns the ControllingPersonType field if it's non-nil, zero value otherwise.

func (*User) GetCountry

func (u *User) GetCountry() string

GetCountry returns the Country field if it's non-nil, zero value otherwise.

func (*User) GetCountryName

func (u *User) GetCountryName() string

GetCountryName returns the CountryName field if it's non-nil, zero value otherwise.

func (*User) GetCreatedDate

func (u *User) GetCreatedDate() TimestampParis

GetCreatedDate returns the CreatedDate field if it's non-nil, zero value otherwise.

func (*User) GetEconomicSanctions

func (u *User) GetEconomicSanctions() string

GetEconomicSanctions returns the EconomicSanctions field if it's non-nil, zero value otherwise.

func (*User) GetEffectiveBeneficiary

func (u *User) GetEffectiveBeneficiary() string

GetEffectiveBeneficiary returns the EffectiveBeneficiary field if it's non-nil, zero value otherwise.

func (*User) GetEmail

func (u *User) GetEmail() string

GetEmail returns the Email field if it's non-nil, zero value otherwise.

func (*User) GetEmployeeType

func (u *User) GetEmployeeType() string

GetEmployeeType returns the EmployeeType field if it's non-nil, zero value otherwise.

func (*User) GetEntityType

func (u *User) GetEntityType() string

GetEntityType returns the EntityType field if it's non-nil, zero value otherwise.

func (*User) GetFirstname

func (u *User) GetFirstname() string

GetFirstname returns the Firstname field if it's non-nil, zero value otherwise.

func (*User) GetIncomeRange

func (u *User) GetIncomeRange() string

GetIncomeRange returns the IncomeRange field if it's non-nil, zero value otherwise.

func (*User) GetInformationStatus

func (u *User) GetInformationStatus() string

GetInformationStatus returns the InformationStatus field if it's non-nil, zero value otherwise.

func (*User) GetInvolvedSanctions

func (u *User) GetInvolvedSanctions() string

GetInvolvedSanctions returns the InvolvedSanctions field if it's non-nil, zero value otherwise.

func (*User) GetIsFreezed

func (u *User) GetIsFreezed() int64

GetIsFreezed returns the IsFreezed field if it's non-nil, zero value otherwise.

func (*User) GetKycLevel

func (u *User) GetKycLevel() Level

GetKycLevel returns the KycLevel field if it's non-nil, zero value otherwise.

func (*User) GetKycReview

func (u *User) GetKycReview() Review

GetKycReview returns the KycReview field if it's non-nil, zero value otherwise.

func (*User) GetKycReviewComment

func (u *User) GetKycReviewComment() string

GetKycReviewComment returns the KycReviewComment field if it's non-nil, zero value otherwise.

func (*User) GetLanguage

func (u *User) GetLanguage() string

GetLanguage returns the Language field if it's non-nil, zero value otherwise.

func (*User) GetLastname

func (u *User) GetLastname() string

GetLastname returns the Lastname field if it's non-nil, zero value otherwise.

func (*User) GetLegalAnnualTurnOver

func (u *User) GetLegalAnnualTurnOver() string

GetLegalAnnualTurnOver returns the LegalAnnualTurnOver field if it's non-nil, zero value otherwise.

func (*User) GetLegalForm

func (u *User) GetLegalForm() string

GetLegalForm returns the LegalForm field if it's non-nil, zero value otherwise.

func (*User) GetLegalName

func (u *User) GetLegalName() string

GetLegalName returns the LegalName field if it's non-nil, zero value otherwise.

func (*User) GetLegalNameEmbossed

func (u *User) GetLegalNameEmbossed() string

GetLegalNameEmbossed returns the LegalNameEmbossed field if it's non-nil, zero value otherwise.

func (*User) GetLegalNetIncomeRange

func (u *User) GetLegalNetIncomeRange() string

GetLegalNetIncomeRange returns the LegalNetIncomeRange field if it's non-nil, zero value otherwise.

func (*User) GetLegalNumberOfEmployeeRange

func (u *User) GetLegalNumberOfEmployeeRange() string

GetLegalNumberOfEmployeeRange returns the LegalNumberOfEmployeeRange field if it's non-nil, zero value otherwise.

func (*User) GetLegalRegistrationDate

func (u *User) GetLegalRegistrationDate() Date

GetLegalRegistrationDate returns the LegalRegistrationDate field if it's non-nil, zero value otherwise.

func (*User) GetLegalRegistrationNumber

func (u *User) GetLegalRegistrationNumber() string

GetLegalRegistrationNumber returns the LegalRegistrationNumber field if it's non-nil, zero value otherwise.

func (*User) GetLegalSector

func (u *User) GetLegalSector() string

GetLegalSector returns the LegalSector field if it's non-nil, zero value otherwise.

func (*User) GetLegalShareCapital

func (u *User) GetLegalShareCapital() string

GetLegalShareCapital returns the LegalShareCapital field if it's non-nil, zero value otherwise.

func (*User) GetLegalTvaNumber

func (u *User) GetLegalTvaNumber() string

GetLegalTvaNumber returns the LegalTvaNumber field if it's non-nil, zero value otherwise.

func (*User) GetMiddleNames

func (u *User) GetMiddleNames() string

GetMiddleNames returns the MiddleNames field if it's non-nil, zero value otherwise.

func (*User) GetMobile

func (u *User) GetMobile() string

GetMobile returns the Mobile field if it's non-nil, zero value otherwise.

func (*User) GetModifiedDate

func (u *User) GetModifiedDate() TimestampParis

GetModifiedDate returns the ModifiedDate field if it's non-nil, zero value otherwise.

func (*User) GetNationality

func (u *User) GetNationality() string

GetNationality returns the Nationality field if it's non-nil, zero value otherwise.

func (*User) GetNationalityOther

func (u *User) GetNationalityOther() string

GetNationalityOther returns the NationalityOther field if it's non-nil, zero value otherwise.

func (*User) GetOccupation

func (u *User) GetOccupation() string

GetOccupation returns the Occupation field if it's non-nil, zero value otherwise.

func (*User) GetParentType

func (u *User) GetParentType() string

GetParentType returns the ParentType field if it's non-nil, zero value otherwise.

func (*User) GetParentUserID

func (u *User) GetParentUserID() string

GetParentUserID returns the ParentUserID field if it's non-nil, zero value otherwise.

func (*User) GetPayinCount

func (u *User) GetPayinCount() int64

GetPayinCount returns the PayinCount field if it's non-nil, zero value otherwise.

func (*User) GetPersonalAssets

func (u *User) GetPersonalAssets() string

GetPersonalAssets returns the PersonalAssets field if it's non-nil, zero value otherwise.

func (*User) GetPhone

func (u *User) GetPhone() string

GetPhone returns the Phone field if it's non-nil, zero value otherwise.

func (*User) GetPlaceOfBirth

func (u *User) GetPlaceOfBirth() string

GetPlaceOfBirth returns the PlaceOfBirth field if it's non-nil, zero value otherwise.

func (*User) GetPosition

func (u *User) GetPosition() string

GetPosition returns the Position field if it's non-nil, zero value otherwise.

func (*User) GetPostcode

func (u *User) GetPostcode() string

GetPostcode returns the Postcode field if it's non-nil, zero value otherwise.

func (*User) GetResidentCountriesSanctions

func (u *User) GetResidentCountriesSanctions() string

GetResidentCountriesSanctions returns the ResidentCountriesSanctions field if it's non-nil, zero value otherwise.

func (*User) GetSanctionsQuestionnaireDate

func (u *User) GetSanctionsQuestionnaireDate() string

GetSanctionsQuestionnaireDate returns the SanctionsQuestionnaireDate field if it's non-nil, zero value otherwise.

func (*User) GetSepaCreditorIdentifier

func (u *User) GetSepaCreditorIdentifier() string

GetSepaCreditorIdentifier returns the SepaCreditorIdentifier field if it's non-nil, zero value otherwise.

func (*User) GetSpecifiedUSPerson

func (u *User) GetSpecifiedUSPerson() string

GetSpecifiedUSPerson returns the SpecifiedUSPerson field if it's non-nil, zero value otherwise.

func (*User) GetState

func (u *User) GetState() string

GetState returns the State field if it's non-nil, zero value otherwise.

func (*User) GetTaxNumber

func (u *User) GetTaxNumber() string

GetTaxNumber returns the TaxNumber field if it's non-nil, zero value otherwise.

func (*User) GetTaxResidence

func (u *User) GetTaxResidence() string

GetTaxResidence returns the TaxResidence field if it's non-nil, zero value otherwise.

func (*User) GetTitle

func (u *User) GetTitle() string

GetTitle returns the Title field if it's non-nil, zero value otherwise.

func (*User) GetTotalRows

func (u *User) GetTotalRows() int64

GetTotalRows returns the TotalRows field if it's non-nil, zero value otherwise.

func (*User) GetUserID

func (u *User) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

func (*User) GetUserStatus

func (u *User) GetUserStatus() string

GetUserStatus returns the UserStatus field if it's non-nil, zero value otherwise.

func (*User) GetUserTag

func (u *User) GetUserTag() string

GetUserTag returns the UserTag field if it's non-nil, zero value otherwise.

func (*User) GetUserTypeID

func (u *User) GetUserTypeID() string

GetUserTypeID returns the UserTypeID field if it's non-nil, zero value otherwise.

func (*User) GetWalletCount

func (u *User) GetWalletCount() int64

GetWalletCount returns the WalletCount field if it's non-nil, zero value otherwise.

type UserCancelEvent

type UserCancelEvent struct {
	UserResponse
}

type UserCancelOptions

type UserCancelOptions struct {
	Origin Origin `url:"origin,omitempty"`
}

UserCancelOptions contains options for deletion of a user. Origin can be of value OPERATOR or USER.

type UserCreateEvent

type UserCreateEvent struct {
	UserResponse
}

type UserKYCRequestEvent

type UserKYCRequestEvent struct {
	UserResponse
}

type UserKYCReviewEvent

type UserKYCReviewEvent struct {
	UserResponse
}

type UserListOptions

type UserListOptions struct {
	ListOptions
}

UserListOptions contains options for listing users.

type UserResponse

type UserResponse struct {
	Users []*User `json:"users"`
}

UserResponse represents a list of users.

func (*UserResponse) GetUsers

func (u *UserResponse) GetUsers() []*User

GetUsers returns the Users field.

type UserService

type UserService service

UserService handles communication with the user related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/user

func (*UserService) Cancel

func (s *UserService) Cancel(ctx context.Context, userID string, opt *UserCancelOptions) (*User, *http.Response, error)

Cancel makes a User cancelled, meaning all future operation for that user will be refused.

func (*UserService) Create

func (s *UserService) Create(ctx context.Context, user *User) (*User, *http.Response, error)

Create creates a Treezor user.

func (*UserService) Edit

func (s *UserService) Edit(ctx context.Context, userID string, user *User) (*User, *http.Response, error)

Edit updates a user.

func (*UserService) Get

func (s *UserService) Get(ctx context.Context, userID string) (*User, *http.Response, error)

Get fetches a user from Treezor.

func (*UserService) List

List returns a list of users.

func (*UserService) RequestKYCLiveness

func (s *UserService) RequestKYCLiveness(ctx context.Context, treezorUserID string) (*Identification, *http.Response, error)

RequestKYCLiveness makes a kyc url request for the kycliveness process.

func (*UserService) ReviewKYC

func (s *UserService) ReviewKYC(ctx context.Context, userID string) (*User, *http.Response, error)

ReviewKYC asks Treezor to do a KYC review against that user.

func (*UserService) ReviewKYCLiveness

func (s *UserService) ReviewKYCLiveness(ctx context.Context, treezorUserID string) (*http.Response, error)

ReviewKYCLiveness asks Treezor to do a KYC review against that user.

type UserUpdateEvent

type UserUpdateEvent struct {
	UserResponse
}

type Wallet

type Wallet struct {
	Access
	WalletID          *string         `json:"walletId,omitempty"`
	WalletTypeID      *string         `json:"walletTypeId,omitempty"`
	WalletStatus      *string         `json:"walletStatus,omitempty"`
	WalletTag         *string         `json:"walletTag,omitempty"`
	UserID            *string         `json:"userId,omitempty"`
	Name              *string         `json:"eventName,omitempty"`
	Description       *string         `json:"eventMessage,omitempty"`
	Date              *Date           `json:"eventDate,omitempty"`
	PayinEndDate      *Date           `json:"eventPayinEndDate,omitempty"`
	PayinStartDate    *Date           `json:"eventPayinStartDate,omitempty"`
	Currency          Currency        `json:"currency,omitempty"`
	JointUserID       *string         `json:"jointUserId,omitempty"`
	Alias             *string         `json:"eventAlias,omitempty"`
	ContractSigned    *string         `json:"contractSigned,omitempty"`
	URLImage          *string         `json:"urlImage,omitempty"`
	CreatedDate       *TimestampParis `json:"createdDate,omitempty"`
	ModifiedDate      *TimestampParis `json:"modifiedDate,omitempty"`
	UserFirstname     *string         `json:"userFirstname,omitempty"`
	UserLastname      *string         `json:"userLastname,omitempty"`
	CodeStatus        *string         `json:"codeStatus,omitempty"`
	TariffID          *string         `json:"tariffId,omitempty"`
	InformationStatus *string         `json:"informationStatus,omitempty"`
	PayinCount        *int64          `json:"payinCount,string,omitempty"`
	PayoutCount       *int64          `json:"payoutCount,string,omitempty"`
	TransferCount     *int64          `json:"transferCount,string,omitempty"`
	Solde             *float64        `json:"solde,string,omitempty"`
	AuthorizedBalance *float64        `json:"authorizedBalance,string,omitempty"`
	BIC               *string         `json:"bic,omitempty"`
	IBAN              *string         `json:"iban,omitempty"`
	TotalRows         *int64          `json:"totalRows,omitempty"`
}

Wallet represents a Treezor wallet.

func (*Wallet) GetAlias

func (w *Wallet) GetAlias() string

GetAlias returns the Alias field if it's non-nil, zero value otherwise.

func (*Wallet) GetAuthorizedBalance

func (w *Wallet) GetAuthorizedBalance() float64

GetAuthorizedBalance returns the AuthorizedBalance field if it's non-nil, zero value otherwise.

func (*Wallet) GetBIC

func (w *Wallet) GetBIC() string

GetBIC returns the BIC field if it's non-nil, zero value otherwise.

func (*Wallet) GetCodeStatus

func (w *Wallet) GetCodeStatus() string

GetCodeStatus returns the CodeStatus field if it's non-nil, zero value otherwise.

func (*Wallet) GetContractSigned

func (w *Wallet) GetContractSigned() string

GetContractSigned returns the ContractSigned field if it's non-nil, zero value otherwise.

func (*Wallet) GetCreatedDate

func (w *Wallet) GetCreatedDate() TimestampParis

GetCreatedDate returns the CreatedDate field if it's non-nil, zero value otherwise.

func (*Wallet) GetDate

func (w *Wallet) GetDate() Date

GetDate returns the Date field if it's non-nil, zero value otherwise.

func (*Wallet) GetDescription

func (w *Wallet) GetDescription() string

GetDescription returns the Description field if it's non-nil, zero value otherwise.

func (*Wallet) GetIBAN

func (w *Wallet) GetIBAN() string

GetIBAN returns the IBAN field if it's non-nil, zero value otherwise.

func (*Wallet) GetInformationStatus

func (w *Wallet) GetInformationStatus() string

GetInformationStatus returns the InformationStatus field if it's non-nil, zero value otherwise.

func (*Wallet) GetJointUserID

func (w *Wallet) GetJointUserID() string

GetJointUserID returns the JointUserID field if it's non-nil, zero value otherwise.

func (*Wallet) GetModifiedDate

func (w *Wallet) GetModifiedDate() TimestampParis

GetModifiedDate returns the ModifiedDate field if it's non-nil, zero value otherwise.

func (*Wallet) GetName

func (w *Wallet) GetName() string

GetName returns the Name field if it's non-nil, zero value otherwise.

func (*Wallet) GetPayinCount

func (w *Wallet) GetPayinCount() int64

GetPayinCount returns the PayinCount field if it's non-nil, zero value otherwise.

func (*Wallet) GetPayinEndDate

func (w *Wallet) GetPayinEndDate() Date

GetPayinEndDate returns the PayinEndDate field if it's non-nil, zero value otherwise.

func (*Wallet) GetPayinStartDate

func (w *Wallet) GetPayinStartDate() Date

GetPayinStartDate returns the PayinStartDate field if it's non-nil, zero value otherwise.

func (*Wallet) GetPayoutCount

func (w *Wallet) GetPayoutCount() int64

GetPayoutCount returns the PayoutCount field if it's non-nil, zero value otherwise.

func (*Wallet) GetSolde

func (w *Wallet) GetSolde() float64

GetSolde returns the Solde field if it's non-nil, zero value otherwise.

func (*Wallet) GetTariffID

func (w *Wallet) GetTariffID() string

GetTariffID returns the TariffID field if it's non-nil, zero value otherwise.

func (*Wallet) GetTotalRows

func (w *Wallet) GetTotalRows() int64

GetTotalRows returns the TotalRows field if it's non-nil, zero value otherwise.

func (*Wallet) GetTransferCount

func (w *Wallet) GetTransferCount() int64

GetTransferCount returns the TransferCount field if it's non-nil, zero value otherwise.

func (*Wallet) GetURLImage

func (w *Wallet) GetURLImage() string

GetURLImage returns the URLImage field if it's non-nil, zero value otherwise.

func (*Wallet) GetUserFirstname

func (w *Wallet) GetUserFirstname() string

GetUserFirstname returns the UserFirstname field if it's non-nil, zero value otherwise.

func (*Wallet) GetUserID

func (w *Wallet) GetUserID() string

GetUserID returns the UserID field if it's non-nil, zero value otherwise.

func (*Wallet) GetUserLastname

func (w *Wallet) GetUserLastname() string

GetUserLastname returns the UserLastname field if it's non-nil, zero value otherwise.

func (*Wallet) GetWalletID

func (w *Wallet) GetWalletID() string

GetWalletID returns the WalletID field if it's non-nil, zero value otherwise.

func (*Wallet) GetWalletStatus

func (w *Wallet) GetWalletStatus() string

GetWalletStatus returns the WalletStatus field if it's non-nil, zero value otherwise.

func (*Wallet) GetWalletTag

func (w *Wallet) GetWalletTag() string

GetWalletTag returns the WalletTag field if it's non-nil, zero value otherwise.

func (*Wallet) GetWalletTypeID

func (w *Wallet) GetWalletTypeID() string

GetWalletTypeID returns the WalletTypeID field if it's non-nil, zero value otherwise.

type WalletCancelEvent

type WalletCancelEvent struct {
	WalletResponse
}

type WalletCancelOptions

type WalletCancelOptions struct {
	Origin Origin `url:"origin,omitempty"`
}

WalletCancelOptions contains options for deletion of a wallet. Origin can be of value OPERATOR or USER.

type WalletCreateEvent

type WalletCreateEvent struct {
	WalletResponse
}

type WalletListOptions

type WalletListOptions struct {
	ListOptions
}

WalletListOptions contains options for listing wallets.

type WalletResponse

type WalletResponse struct {
	Wallets []*Wallet `json:"wallets"`
}

WalletResponse represents a list of wallets. It may contain only one item.

func (*WalletResponse) GetWallets

func (w *WalletResponse) GetWallets() []*Wallet

GetWallets returns the Wallets field.

type WalletService

type WalletService service

WalletService handles communication with the wallet related methods of the Treezor API.

Treezor API docs: https://www.treezor.com/api-documentation/#/wallet

func (*WalletService) Cancel

func (s *WalletService) Cancel(ctx context.Context, walletID string, opt *WalletCancelOptions) (*Wallet, *http.Response, error)

Cancel makes a User cancelled, meaning all future operation for that wallet will be refused.

func (*WalletService) Create

func (s *WalletService) Create(ctx context.Context, wallet *Wallet) (*Wallet, *http.Response, error)

Create creates a Treezor wallet.

func (*WalletService) Edit

func (s *WalletService) Edit(ctx context.Context, walletID string, wallet *Wallet) (*Wallet, *http.Response, error)

Edit updates a wallet.

func (*WalletService) Get

func (s *WalletService) Get(ctx context.Context, walletID string) (*Wallet, *http.Response, error)

Get fetches a wallet from Treezor.

func (*WalletService) List

List returns a list of wallets.

type WalletUpdateEvent

type WalletUpdateEvent struct {
	WalletResponse
}

Jump to

Keyboard shortcuts

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