accounts

package
v0.0.0-...-ff628f3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScheduleFrequencyDailyRequest

func NewScheduleFrequencyDailyRequest() scheduleFrequencyDaily

func NewScheduleFrequencyMonthlyRequest

func NewScheduleFrequencyMonthlyRequest(days []int) scheduleFrequencyMonthly

func NewScheduleFrequencyWeeklyRequest

func NewScheduleFrequencyWeeklyRequest(days []DaySchedule) scheduleFrequencyWeekly

Types

type AccountHolder

type AccountHolder struct {
	Type              AccountHolderType           `json:"type,omitempty"`
	FirstName         string                      `json:"first_name,omitempty"`
	LastName          string                      `json:"last_name,omitempty"`
	CompanyName       string                      `json:"company_name,omitempty"`
	TaxId             string                      `json:"tax_id,omitempty"`
	DateOfBirth       *DateOfBirth                `json:"date_of_birth,omitempty"`
	CountryOfBirth    common.Country              `json:"country_of_birth,omitempty"`
	ResidentialStatus string                      `json:"residential_status,omitempty"`
	BillingAddress    *common.Address             `json:"billing_address,omitempty"`
	Phone             *common.Phone               `json:"phone,omitempty"`
	Identification    AccountHolderIdentification `json:"identification,omitempty"`
	Email             string                      `json:"email,omitempty"`
}

type AccountHolderIdentification

type AccountHolderIdentification struct {
	Type           common.AccountHolderIdentificationType `json:"type,omitempty"`
	Number         string                                 `json:"number,omitempty"`
	IssuingCountry common.Country                         `json:"issuing_country,omitempty"`
}

type AccountHolderType

type AccountHolderType string
const (
	IndividualType AccountHolderType = "individual"
	Corporate      AccountHolderType = "corporate"
	Government     AccountHolderType = "government"
)

type BusinessType

type BusinessType string
const (
	GeneralPartnership        BusinessType = "general_partnership"
	LimitedPartnership        BusinessType = "limited_partnership"
	PublicLimitedCompany      BusinessType = "public_limited_company"
	LimitedCompany            BusinessType = "limited_company"
	ProfessionalAssociation   BusinessType = "professional_association"
	UnincorporatedAssociation BusinessType = "unincorporated_association"
	AutoEntrepreneur          BusinessType = "auto_entrepreneur"
)

type Capabilities

type Capabilities struct {
	Payments *Payments `json:"payments,omitempty"`
	Payouts  *Payouts  `json:"payouts,omitempty"`
}

type Client

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

func NewClient

func NewClient(
	configuration *configuration.Configuration,
	apiClient client.HttpClient,
	filesClient client.HttpClient,
) *Client

func (*Client) CreateEntity

func (c *Client) CreateEntity(request OnboardEntityRequest) (*OnboardEntityResponse, error)

func (*Client) CreatePaymentInstrument

func (c *Client) CreatePaymentInstrument(
	entityId string,
	request PaymentInstrumentRequest,
) (*common.IdResponse, error)

func (*Client) CreatePaymentInstruments deprecated

func (c *Client) CreatePaymentInstruments(
	entityId string,
	request PaymentInstrument,
) (*common.MetadataResponse, error)

Deprecated: Use CreatePaymentInstrumentIdResponse for CreatePaymentInstrument instead.

func (*Client) GetEntity

func (c *Client) GetEntity(entityId string) (*OnboardEntityDetails, error)

func (*Client) QueryPaymentInstruments

func (c *Client) QueryPaymentInstruments(
	entityId string,
	query PaymentInstrumentsQuery,
) (*PaymentInstrumentQueryResponse, error)

func (*Client) RetrievePaymentInstrumentDetails

func (c *Client) RetrievePaymentInstrumentDetails(
	entityId string,
	paymentInstrumentId string,
) (*PaymentInstrumentDetailsResponse, error)

func (*Client) RetrievePayoutSchedule

func (c *Client) RetrievePayoutSchedule(entityId string) (*PayoutSchedule, error)

func (*Client) SubmitFile

func (c *Client) SubmitFile(file File) (*common.IdResponse, error)

func (*Client) UpdateEntity

func (c *Client) UpdateEntity(
	entityId string,
	request OnboardEntityRequest,
) (*OnboardEntityResponse, error)

func (*Client) UpdatePaymentInstrumentDetails

func (c *Client) UpdatePaymentInstrumentDetails(
	entityId, instrumentId string,
	request UpdatePaymentInstrumentRequest,
) (*common.IdResponse, error)

func (*Client) UpdatePayoutSchedule

func (c *Client) UpdatePayoutSchedule(
	entityId string,
	currency common.Currency,
	updateSchedule CurrencySchedule,
) (*common.IdResponse, error)

type Company

type Company struct {
	BusinessRegistrationNumber string                  `json:"business_registration_number,omitempty"`
	BusinessType               BusinessType            `json:"business_type,omitempty"`
	LegalName                  string                  `json:"legal_name,omitempty"`
	TradingName                string                  `json:"trading_name,omitempty"`
	PrincipalAddress           *common.Address         `json:"principal_address,omitempty"`
	RegisteredAddress          *common.Address         `json:"registered_address,omitempty"`
	Document                   *EntityDocument         `json:"document,omitempty"`
	Representatives            []Representative        `json:"representatives,omitempty"`
	FinancialDetails           *EntityFinancialDetails `json:"financial_details,omitempty"`
}

type ContactDetails

type ContactDetails struct {
	Phone                *Phone                `json:"phone,omitempty"`
	EntityEmailAddresses *EntityEmailAddresses `json:"email_addresses,omitempty"`
}

type CurrencySchedule

type CurrencySchedule struct {
	Enabled    bool       `json:"enabled,omitempty"`
	Threshold  int        `json:"threshold,omitempty"`
	Recurrence Recurrence `json:"recurrence,omitempty"`
}

type DateOfBirth

type DateOfBirth struct {
	Day   int `json:"day,omitempty"`
	Month int `json:"month,omitempty"`
	Year  int `json:"year,omitempty"`
}

type DaySchedule

type DaySchedule string
const (
	Monday    DaySchedule = "Monday"
	Tuesday   DaySchedule = "Tuesday"
	Wednesday DaySchedule = "Wednesday"
	Thursday  DaySchedule = "Thursday"
	Friday    DaySchedule = "Friday"
	Saturday  DaySchedule = "Saturday"
	Sunday    DaySchedule = "Sunday"
)

type Document

type Document struct {
	Type  common.DocumentType `json:"type,omitempty"`
	Front string              `json:"front,omitempty"`
	Back  string              `json:"back,omitempty"`
}

type EntityDocument

type EntityDocument struct {
	Type   string `json:"type,omitempty"`
	FileId string `json:"file_id,omitempty"`
}

type EntityEmailAddresses

type EntityEmailAddresses struct {
	Primary string `json:"primary,omitempty"`
}

type EntityFinancialDetails

type EntityFinancialDetails struct {
	AnnualProcessingVolume  int64                     `json:"annual_processing_volume,omitempty"`
	AverageTransactionValue int64                     `json:"average_transaction_value,omitempty"`
	HighestTransactionValue int64                     `json:"highest_transaction_value,omitempty"`
	Documents               *EntityFinancialDocuments `json:"documents,omitempty"`
}

type EntityFinancialDocuments

type EntityFinancialDocuments struct {
	BankStatement      *EntityDocument `json:"bank_statement,omitempty"`
	FinancialStatement *EntityDocument `json:"financial_statement,omitempty"`
}

type File

type File struct {
	File    string
	Purpose common.Purpose
}

func (*File) GetFieldName

func (f *File) GetFieldName() string

func (*File) GetFile

func (f *File) GetFile() string

func (*File) GetPurpose

func (f *File) GetPurpose() common.Purpose

type Frequency

type Frequency string
const (
	Weekly  Frequency = "Weekly"
	Daily   Frequency = "Daily"
	Monthly Frequency = "Monthly"
)

type Headers

type Headers struct {
	IfMatch string `json:"if-match,omitempty"`
}

type Identification

type Identification struct {
	NationalIdNumber string    `json:"national_id_number,omitempty"`
	Document         *Document `json:"document,omitempty"`
}

type Individual

type Individual struct {
	FirstName         string          `json:"first_name,omitempty"`
	MiddleName        string          `json:"middle_name,omitempty"`
	LastName          string          `json:"last_name,omitempty"`
	TradingName       string          `json:"trading_name,omitempty"`
	NationalTaxId     string          `json:"national_tax_id,omitempty"`
	RegisteredAddress *common.Address `json:"registered_address,omitempty"`
	DateOfBirth       *DateOfBirth    `json:"date_of_birth,omitempty"`
	PlaceOfBirth      *PlaceOfBirth   `json:"place_of_birth,omitempty"`
	Identification    *Identification `json:"identification,omitempty"`
}

type Instrument

type Instrument struct {
	Id       string              `json:"id,omitempty"`
	Label    string              `json:"label,omitempty"`
	Status   InstrumentStatus    `json:"status,omitempty"`
	Document *InstrumentDocument `json:"document,omitempty"`
}

type InstrumentDetail

type InstrumentDetail string

type InstrumentDetails

type InstrumentDetails interface {
	GetType() string
}

type InstrumentDetailsCardToken

type InstrumentDetailsCardToken struct {
	Token string `json:"token,omitempty"`
}

func (*InstrumentDetailsCardToken) GetType

func (s *InstrumentDetailsCardToken) GetType() string

type InstrumentDetailsFasterPayments

type InstrumentDetailsFasterPayments struct {
	AccountNumber string `json:"account_number,omitempty"`
	BankCode      string `json:"bank_code,omitempty"`
}

func (*InstrumentDetailsFasterPayments) GetType

type InstrumentDetailsSepa

type InstrumentDetailsSepa struct {
	Iban     string `json:"iban,omitempty"`
	SwiftBic string `json:"swift_bic,omitempty"`
}

func (*InstrumentDetailsSepa) GetType

func (s *InstrumentDetailsSepa) GetType() string

type InstrumentDocument

type InstrumentDocument struct {
	Type   string `json:"type,omitempty"`
	FileId string `json:"file_id,omitempty"`
}

type InstrumentStatus

type InstrumentStatus string
const (
	Verified          InstrumentStatus = "verified"
	Unverified        InstrumentStatus = "unverified"
	InstrumentPending InstrumentStatus = "pending"
)

type OnboardEntityDetails

type OnboardEntityDetails struct {
	HttpMetadata    common.HttpMetadata `json:"http_metadata,omitempty"`
	Id              string              `json:"id,omitempty"`
	Reference       string              `json:"reference,omitempty"`
	Capabilities    *Capabilities       `json:"capabilities,omitempty"`
	Status          OnboardingStatus    `json:"status,omitempty"`
	RequirementsDue []RequirementsDue   `json:"requirements_due,omitempty"`
	ContactDetails  *ContactDetails     `json:"contact_details,omitempty"`
	Profile         *Profile            `json:"profile,omitempty"`
	Company         *Company            `json:"company,omitempty"`
	Individual      *Individual         `json:"individual,omitempty"`
	Instruments     []Instrument        `json:"instruments,omitempty"`
}

type OnboardEntityRequest

type OnboardEntityRequest struct {
	Reference      string          `json:"reference,omitempty"`
	ContactDetails *ContactDetails `json:"contact_details,omitempty"`
	Profile        *Profile        `json:"profile,omitempty"`
	Company        *Company        `json:"company,omitempty"`
	Individual     *Individual     `json:"individual,omitempty"`
}

type OnboardEntityResponse

type OnboardEntityResponse struct {
	HttpMetadata    common.HttpMetadata `json:"http_metadata,omitempty"`
	Id              string              `json:"id,omitempty"`
	Reference       string              `json:"reference,omitempty"`
	Capabilities    *Capabilities       `json:"capabilities,omitempty"`
	Status          OnboardingStatus    `json:"status,omitempty"`
	RequirementsDue []RequirementsDue   `json:"requirements_due,omitempty"`
}

type OnboardingStatus

type OnboardingStatus string
const (
	Active         OnboardingStatus = "active"
	Pending        OnboardingStatus = "pending"
	Restricted     OnboardingStatus = "restricted"
	RequirementDue OnboardingStatus = "requirements_due"
	Inactive       OnboardingStatus = "inactive"
	Rejected       OnboardingStatus = "rejected"
)

type PaymentInstrument

type PaymentInstrument struct {
	Type          common.InstrumentType `json:"type,omitempty"`
	Label         string                `json:"label,omitempty"`
	AccountType   common.AccountType    `json:"account_type,omitempty"`
	AccountNumber string                `json:"account_number,omitempty"`
	BankCode      string                `json:"bank_code,omitempty"`
	BranchCode    string                `json:"branch_code,omitempty"`
	Iban          string                `json:"iban,omitempty"`
	Bban          string                `json:"bban,omitempty"`
	SwiftBic      string                `json:"swift_bic,omitempty"`
	Currency      common.Currency       `json:"currency,omitempty"`
	Country       common.Country        `json:"country,omitempty"`
	Document      *InstrumentDocument   `json:"document,omitempty"`
	AccountHolder *AccountHolder        `json:"account_holder,omitempty"`
	Bank          *common.BankDetails   `json:"bank,omitempty"`
}

func NewAccountsPaymentInstrument

func NewAccountsPaymentInstrument() *PaymentInstrument

type PaymentInstrumentDetailsResponse

type PaymentInstrumentDetailsResponse struct {
	HttpMetadata       common.HttpMetadata
	Id                 string                 `json:"id,omitempty"`
	Status             InstrumentStatus       `json:"status,omitempty"`
	InstrumentId       string                 `json:"instrument_id,omitempty"`
	Label              string                 `json:"label,omitempty"`
	Type               common.InstrumentType  `json:"type,omitempty"`
	Currency           common.Currency        `json:"currency,omitempty"`
	Country            common.Country         `json:"country,omitempty"`
	DefaultDestination bool                   `json:"default,omitempty"`
	Document           *InstrumentDocument    `json:"document,omitempty"`
	Links              map[string]common.Link `json:"_links"`
}

type PaymentInstrumentQueryResponse

type PaymentInstrumentQueryResponse struct {
	HttpMetadata common.HttpMetadata
	Data         []PaymentInstrumentDetailsResponse `json:"data,omitempty"`
}

type PaymentInstrumentRequest

type PaymentInstrumentRequest struct {
	Label              string                `json:"label,omitempty"`
	Type               common.InstrumentType `json:"type,omitempty"`
	Currency           common.Currency       `json:"currency,omitempty"`
	Country            common.Country        `json:"country,omitempty"`
	DefaultDestination bool                  `json:"default,omitempty"`
	Document           *InstrumentDocument   `json:"document"`
	InstrumentDetails  InstrumentDetails     `json:"instrument_details,omitempty"`
}

type PaymentInstrumentsQuery

type PaymentInstrumentsQuery struct {
	Status InstrumentStatus `json:"status,omitempty"`
}

type Payments

type Payments struct {
	Available bool `json:"available,omitempty"`
	Enabled   bool `json:"enabled,omitempty"`
}

type PayoutSchedule

type PayoutSchedule struct {
	HttpMetadata common.HttpMetadata `json:"http_metadata,omitempty"`
	Currency     map[common.Currency]CurrencySchedule
	Links        map[string]common.Link `json:"_links"`
}

func (*PayoutSchedule) UnmarshalJSON

func (p *PayoutSchedule) UnmarshalJSON(data []byte) error

type Payouts

type Payouts struct {
	Available bool `json:"available,omitempty"`
	Enabled   bool `json:"enabled,omitempty"`
}

type Phone

type Phone struct {
	Number string `json:"number,omitempty"`
}

type PlaceOfBirth

type PlaceOfBirth struct {
	Country common.Country `json:"country,omitempty"`
}

type Profile

type Profile struct {
	Urls                   []string        `json:"urls,omitempty"`
	Mccs                   []string        `json:"mccs,omitempty"`
	DefaultHoldingCurrency common.Currency `json:"default_holding_currency,omitempty"`
}

type Recurrence

type Recurrence interface {
	GetSchedule() Frequency
}

type Representative

type Representative struct {
	FirstName      string          `json:"first_name,omitempty"`
	MiddleName     string          `json:"middle_name,omitempty"`
	LastName       string          `json:"last_name,omitempty"`
	Address        *common.Address `json:"address,omitempty"`
	Identification *Identification `json:"identification,omitempty"`
	Phone          *Phone          `json:"phone,omitempty"`
	DateOfBirth    *DateOfBirth    `json:"date_of_birth,omitempty"`
	PlaceOfBirth   *PlaceOfBirth   `json:"place_of_birth,omitempty"`
	Roles          []string        `json:"roles,omitempty"`
}

type RequirementsDue

type RequirementsDue struct {
	Field  string `json:"field,omitempty"`
	Reason string `json:"reason,omitempty"`
}

type UpdatePaymentInstrumentRequest

type UpdatePaymentInstrumentRequest struct {
	Label   string  `json:"label,omitempty"`
	Default bool    `json:"default,omitempty"`
	Headers Headers `json:"headers,omitempty"`
}

Jump to

Keyboard shortcuts

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