model

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package model defines object and payload models

Index

Constants

View Source
const (
	// BaseURL is the definition of ovalfi base url
	BaseURL = "https://sandbox-api.ovalfi-app.com/api/"

	// PublicKey sample sandbox environment signature
	PublicKey = "YbAO71rFXyWp0WJq-_yH7AFV6cZ7P71V53Y=" //"_Wjz3hGNJ8h1FwjJhNHnHXJJmT9Dkg=="  // "XC-WlyMxbC7MdS-mlzZ0G1tBBUXu"

	// BearerToken sample sandbox environment bearer token
	BearerToken = "" /* 160-byte string literal not displayed */

	// LogStrRequest log string key
	LogStrRequest = "request"

	// LogStrResponse log string key
	LogStrResponse = "response"

	// LogStrParams log string key
	LogStrParams = "parameters"

	// LogStrForm
	LogStrForm = "form"

	// LogErrorCode log error_code
	LogErrorCode = "error_code"

	// RequestIDContextKey contact that holds the RequestID context key for
	RequestIDContextKey Key = "api_RequestIDContextKey"
	// RequestIDHeaderKey a constant for the request id header key
	RequestIDHeaderKey string = "X-REQUEST-ID"
)

Variables

View Source
var (
	// ErrNetworkError when something goes wrong with the API call
	ErrNetworkError = errors.New("network error")
)

Functions

func ParseError added in v0.2.4

func ParseError(errMsg string) error

ParseError parses error message to a more specific format

Types

type AccountDetails added in v0.2.8

type AccountDetails struct {
	City          string `json:"city"`
	Country       string `json:"country"`
	BankCode      string `json:"bank_code"`
	BankName      string `json:"bank_name"`
	District      string `json:"district"`
	SwiftCode     string `json:"swift_code"`
	BankBranch    string `json:"bank_branch"`
	IsWithinUS    string `json:"is_within_us"`
	PostalCode    string `json:"postal_code"`
	AccountName   string `json:"account_name"`
	BankAddress   string `json:"bank_address"`
	AccountNumber string `json:"account_number"`
	RoutingNumber string `json:"routing_number"`
}

AccountDetails schema for account details

type AccountResolveRequest added in v0.1.4

type AccountResolveRequest struct {
	BankCode      string `json:"bank_code"`
	AccountNumber string `json:"account_number"`
}

AccountResolveRequest schema for account resolve request

type AllBeneficiariesResponse added in v0.2.9

type AllBeneficiariesResponse struct {
	Items *[]TransferBeneficiary `json:"items"`
	Page  PageInfo               `json:"page"`
}

AllBeneficiariesResponse schema for all beneficiaries response

type AllCustomersResponse added in v0.2.9

type AllCustomersResponse struct {
	Items []Customer `json:"items"`
	Page  PageInfo   `json:"page"`
}

AllCustomersResponse schema for all customers response

type AllPayoutsResponse added in v0.2.9

type AllPayoutsResponse struct {
	Items []PayoutDetails `json:"items"`
	Page  PageInfo        `json:"page"`
}

AllPayoutsResponse schema for all payouts response

type AllSwapsResponse added in v0.2.9

type AllSwapsResponse struct {
	Items []CurrencySwap `json:"items"`
	Page  PageInfo       `json:"page"`
}

AllSwapsResponse schema for all currency swaps response

type AllTransactionsResponse added in v0.2.9

type AllTransactionsResponse struct {
	Items struct {
		Transactions []*Transaction `json:"transactions"`
	} `json:"items"`
	Page PageInfo `json:"page"`
}

AllTransactionsResponse schema for all transactions response

type AllTransfersResponse added in v0.2.9

type AllTransfersResponse struct {
	Items []TerminalTransfer `json:"items"`
	Page  PageInfo           `json:"page"`
}

AllTransfersResponse schema for all transfers response

type BankAccount added in v0.2.9

type BankAccount struct {
	ID                uuid.UUID           `json:"id"`
	CustomerID        uuid.UUID           `json:"customer_id"`
	BusinessID        uuid.UUID           `json:"business_id"`
	AccountID         string              `json:"account_id"`
	AccountDetails    TransferInstruction `json:"account_details"`
	BusinessReference string              `json:"reference"`
	Currency          string              `json:"currency"`
	CreatedAt         time.Time           `json:"created_at"`
	UpdatedTime       *time.Time          `json:"updated_at"`
}

BankAccount schema for bank account

type BankCode added in v0.2.9

type BankCode struct {
	BankName string `json:"name"`
	Code     string `json:"code"`
}

BankCode schema for bank code

type BankDetails

type BankDetails struct {
	AccountNumber string `json:"account_number"`
	AccountName   string `json:"account_name"`
	RoutingNumber string `json:"routing_number,omitempty"`
	SwiftCode     string `json:"swift_code,omitempty"`
	BankName      string `json:"bank_name"`
	BankCode      string `json:"bank_code,omitempty"`
	BankBranch    string `json:"bank_branch,omitempty"`
	Country       string `json:"country"`
	City          string `json:"city,omitempty"`
	BankAddress   string `json:"bank_address,omitempty"`
	District      string `json:"district,omitempty"`
	PostalCode    string `json:"postal_code,omitempty"`
	IsWithinUS    string `json:"is_within_us"`
}

BankDetails schema for bank details

type BulkPayoutConfig added in v0.2.9

type BulkPayoutConfig struct {
	Provider                 string  `json:"provider"`
	MinAmountPerPayout       float64 `json:"min_amount_per_payout"`
	MinCountOfPayout         int     `json:"min_count_of_payout"`
	MaxAmountPerPayout       float64 `json:"max_amount_per_payout"`
	MaxCountOfPayout         int     `json:"max_count_of_payout"`
	DoNameLookup             bool    `json:"do_name_lookup"`
	NamePercentageMatch      int     `json:"name_percentage_match"`
	FeePercentage            float64 `json:"fee_percentage"`
	FeeFlat                  float64 `json:"fee_flat"`
	FeeCap                   float64 `json:"fee_cap"`
	MaxPayoutPerDayPerPerson int64   `json:"max_payout_per_day_per_person"`
	AllowRecurring           bool    `json:"allow_recurring"`
}

BulkPayoutConfig schema for payout config

type BulkPayoutRecipientAccount added in v0.2.9

type BulkPayoutRecipientAccount struct {
	Amount      float64                    `json:"amount"`
	Destination TransferBeneficiaryDetails `json:"destination"`
	Remarks     string                     `json:"remarks"`
}

BulkPayoutRecipientAccount schema for payout recipient account

type CancelPayoutRequest added in v0.2.9

type CancelPayoutRequest struct {
	BulkPayoutID string `json:"payout_id"`
	Reason       string `json:"reason"`
}

CancelPayoutRequest schema for cancel payout request

type CreateBeneficiaryRequest added in v0.2.9

type CreateBeneficiaryRequest struct {
	PersonalDetails  *PersonalDetails  `json:"personal_details,omitempty"`
	BankDetails      BankDetails       `json:"bank_details"`
	IntermediaryBank *IntermediaryBank `json:"intermediary_bank,omitempty"`
	Currency         string            `json:"destination_currency"`
	Nickname         *string           `json:"nickname,omitempty"`
}

CreateBeneficiaryRequest schema for create beneficiary request

type CreateCustomerRequest

type CreateCustomerRequest struct {
	Name             string       `json:"name"`
	Email            string       `json:"email"`
	Reference        string       `json:"reference"`
	MobileNumber     string       `json:"mobile_number"`
	Type             CustomerType `json:"type"`
	YieldOfferingIDs []uuid.UUID  `json:"yield_offering_ids"`
}

CreateCustomerRequest schema for create customer request

type CurrencySwap added in v0.2.9

type CurrencySwap struct {
	ID           uuid.UUID  `json:"id"`
	BusinessID   uuid.UUID  `json:"business_id"`
	FromAmount   Money      `json:"from"`
	ToAmount     Money      `json:"to"`
	ExchangeRate float64    `json:"rate"`
	Markup       Money      `json:"markup"`
	Status       string     `json:"status"`
	FeeAmount    Money      `json:"fee"`
	CompletedAt  *time.Time `json:"completed_at"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    *time.Time `json:"updated_at"`
}

CurrencySwap schema for currency swap

type Customer

type Customer struct {
	ID               string      `json:"id"`
	Name             string      `json:"customer_name"`
	MobileNumber     string      `json:"mobile_number"`
	Email            string      `json:"email"`
	Channel          string      `json:"channel"`
	Reference        string      `json:"reference"`
	YieldOfferingIDs []uuid.UUID `json:"api_yield_offering_ids"`
	UpdatedAt        *time.Time  `json:"updated_at"`
	CreatedAt        string      `json:"created_at"`
}

Customer schema for customer

type CustomerBalance added in v0.2.9

type CustomerBalance struct {
	YieldOfferingID uuid.UUID `json:"yield_offering_id"`
	Name            string    `json:"name"`
	Currency        string    `json:"currency"`
	Amount          float64   `json:"balance"`
}

CustomerBalance schema for customer balance

type CustomerBalances added in v0.2.9

type CustomerBalances struct {
	CustomerID   uuid.UUID          `json:"customer_id"`
	TotalBalance float64            `json:"total_balance"`
	Detail       []*CustomerBalance `json:"detail"`
}

CustomerBalances schema for customer balances

type CustomerType added in v0.2.8

type CustomerType string

CustomerType customerType string

const (
	// CustomerTypeIndividual represent individual customer type
	CustomerTypeIndividual CustomerType = "individual"
	// CustomerTypeBusiness represent business customer type
	CustomerTypeBusiness CustomerType = "business"
)

type DateBetween added in v0.2.9

type DateBetween struct {
	From string `json:"from"`
	To   string `json:"to"`
}

DateBetween schema for date range

type Deposit

type Deposit struct {
	ID                uuid.UUID  `json:"id"`
	CustomerID        uuid.UUID  `json:"customer_id"`
	BusinessID        uuid.UUID  `json:"business_id"`
	Name              string     `json:"name"`
	Email             string     `json:"email"`
	Reference         string     `json:"reference"`
	Currency          string     `json:"currency"`
	Amount            float64    `json:"amount"`
	AmountDeposited   float64    `json:"deposited_amount"`
	DepositedCurrency string     `json:"deposited_currency"`
	Channel           string     `json:"channel"`
	CreatedAt         time.Time  `json:"created_at"`
	SettledAt         *time.Time `json:"settled_at"`
	BalanceBefore     float64    `json:"balance_before"`
	BalanceAfter      float64    `json:"balance_after"`
	DepositBeforeID   uuid.UUID  `json:"deposit_before_id"`
	Status            string     `json:"status"`
	CancelReason      *string    `json:"cancel_reason"`
	YieldOfferingID   uuid.UUID  `json:"yield_offering_id"`
}

Deposit schema for deposit

type DepositBatchResponse

type DepositBatchResponse struct {
	Deposits map[string]struct {
		Deposits    []*Deposit `json:"deposits"`
		TotalAmount float64    `json:"total_amount"`
	} `json:"deposits"`
	TotalAmount float64 `json:"total_amount"`
}

DepositBatchResponse schema for deposit batch response

type Destination

type Destination struct {
	BankDetails      BankDetails      `json:"bankDetails"`
	PersonalDetails  PersonalDetails  `json:"personalDetails"`
	IntermediaryBank IntermediaryBank `json:"intermediaryBank"`
}

Destination for a transfer

type ErrorData added in v0.2.4

type ErrorData struct {
	ID      string `json:"id"`
	Details string `json:"details"`
	Message string `json:"message"`
}

ErrorData struct

type ErrorResponse added in v0.2.4

type ErrorResponse struct {
	Status  int       `json:"status"`
	Data    string    `json:"data"`
	Message string    `json:"message"`
	Error   ErrorData `json:"error"`
}

ErrorResponse object

func GetErrorDetails added in v0.2.4

func GetErrorDetails(errMsg string) (ErrorResponse, error)

GetErrorDetails to unmarshal the err response gotten from api-service

type ExchangeRateDetails added in v0.1.2

type ExchangeRateDetails struct {
	ExchangeRate     float64 `json:"exchange_rate"`
	FeeFlat          float64 `json:"flat_fee"`
	FeePercentage    float64 `json:"fee_percentage"`
	FeeAmount        float64 `json:"fee_amount"`
	AmountReceivable float64 `json:"amount_receivable"`
}

ExchangeRateDetails schema for exchange rate details

type FeeType added in v0.2.0

type FeeType string

FeeType feeType string

const (
	// FeeTypePercentage represent percentage fee type
	FeeTypePercentage FeeType = "percentage"

	// FeeTypeAmount represent amount fee type
	FeeTypeAmount FeeType = "amount"
)

type FeeWithdrawalRequest added in v0.2.0

type FeeWithdrawalRequest struct {
	CustomerID          string  `json:"customer_id"`
	Reference           string  `json:"reference"`
	WithdrawalReference string  `json:"withdrawal_reference"`
	Reason              string  `json:"reason"`
	FeeType             FeeType `json:"fee_type"`
	Amount              float64 `json:"amount,omitempty"`
	Percentage          float64 `json:"percentage,omitempty"`
	YieldOfferingID     string  `json:"yield_offering_id"`
}

FeeWithdrawalRequest schema for fee withdrawal request

type FeeWithdrawalResponse added in v0.2.9

type FeeWithdrawalResponse struct {
	ID                  uuid.UUID `json:"id"`
	CustomerID          uuid.UUID `json:"customer_id"`
	Reference           string    `json:"reference"`
	WithdrawalReference string    `json:"withdrawal_reference"`
	Reason              string    `json:"reason"`
	FeeType             FeeType   `json:"fee_type"`
	Amount              float64   `json:"amount"`
	Percentage          float64   `json:"percentage"`
	YieldOfferingID     uuid.UUID `json:"yield_offering_id"`
}

FeeWithdrawalResponse schema for fee withdrawal response

type FundTransferAction added in v0.0.7

type FundTransferAction string

FundTransferAction transferAction type string

const (
	// Credit represent credit transfer action
	Credit FundTransferAction = "credit"

	// Debit represent debit transfer action
	Debit FundTransferAction = "debit"
)

type FundTransferRequest added in v0.0.7

type FundTransferRequest struct {
	CustomerID      string             `json:"customer_id"`
	Reference       string             `json:"reference"`
	Amount          float64            `json:"amount"`
	Action          FundTransferAction `json:"action"`
	YieldOfferingID string             `json:"yield_offering_id"`
}

FundTransferRequest schema for func transfer request

type GenerateBankAccountRequest added in v0.2.9

type GenerateBankAccountRequest struct {
	CustomerID string `json:"customer_id"`
	Currency   string `json:"currency"`
	Reference  string `json:"reference"`

	BVN         *string `json:"bvn,omitempty"`
	PhoneNumber *string `json:"phone_number,omitempty"`

	DocumentType      *string `json:"document_type,omitempty"`
	Number            *string `json:"document_number,omitempty"`
	IssuedCountryCode *string `json:"issued_country_code,omitempty"`
	IssuedBy          *string `json:"issued_by,omitempty"`
	IssuedDate        *string `json:"issued_date,omitempty"`
	ExpirationDate    *string `json:"expiration_date,omitempty"`
	Country           *string `json:"country,omitempty"`
	ZipCode           *string `json:"zip_code,omitempty"`
	City              *string `json:"city,omitempty"`
	Street            *string `json:"street,omitempty"`
	State             *string `json:"state,omitempty"`
	DateOfBirth       *string `json:"date_of_birth,omitempty"`
}

GenerateBankAccountRequest schema for generate bank account request

type GenericResponse added in v0.2.9

type GenericResponse struct {
	Code    int         `json:"status"`
	Data    interface{} `json:"data"`
	Message *string     `json:"message"`
	Error   *ErrorData  `json:"error"`
}

GenericResponse response wrapper

type InitiateBulkPayoutRequest added in v0.2.9

type InitiateBulkPayoutRequest struct {
	Currency        string                       `json:"currency"`
	Remarks         string                       `json:"remarks,omitempty"`
	Accounts        []BulkPayoutRecipientAccount `json:"accounts,omitempty"`
	BeneficiaryType PayoutType                   `json:"beneficiary_type"`
	BeneficiaryID   *string                      `json:"beneficiary_id,omitempty"`
	Amount          *float64                     `json:"amount,omitempty"`
}

InitiateBulkPayoutRequest schema for payout request

type InitiateCurrencySwapRequest added in v0.2.9

type InitiateCurrencySwapRequest struct {
	FromCurrency string  `json:"from_currency"`
	ToCurrency   string  `json:"to_currency"`
	Amount       float64 `json:"amount"`
}

InitiateCurrencySwapRequest schema for currency swap request

type InitiateDepositRequest

type InitiateDepositRequest struct {
	CustomerID      string  `json:"customer_id"`
	Reference       string  `json:"reference"`
	Amount          float64 `json:"amount"`
	YieldOfferingID string  `json:"yield_offering_id"`
}

InitiateDepositRequest schema for initiate deposit request

type InitiateTerminalTransferRequest added in v0.2.9

type InitiateTerminalTransferRequest struct {
	Amount              float64              `json:"amount"`
	SourceCurrency      string               `json:"source_currency"`
	DestinationCurrency string               `json:"destination_currency"`
	UseBalance          string               `json:"use_balance"`
	BeneficiaryID       *string              `json:"beneficiary_id,omitempty"`
	Destination         *TransferDestination `json:"destination,omitempty"`
	Note                *string              `json:"note,omitempty"`
	Reason              string               `json:"reason"`
}

InitiateTerminalTransferRequest schema for initiate terminal transfer request

type InitiateTransferRequest

type InitiateTransferRequest struct {
	CustomerID  string              `json:"customer_id"`
	Amount      float64             `json:"amount"`
	Currency    string              `json:"currency"`
	Destination TransferDestination `json:"destination"`
	Note        string              `json:"note,omitempty"`
	Reason      string              `json:"reason"`
	Reference   string              `json:"reference"`
}

InitiateTransferRequest schema for initiate transfer request

type IntermediaryBank

type IntermediaryBank struct {
	BankName    string `json:"bank_name,omitempty"`
	BankAddress string `json:"bank_address,omitempty"`
	Reference   string `json:"reference,omitempty"`
	SwiftCode   string `json:"swift_code"`
}

IntermediaryBank schema for intermediary bank

type IntraTransferRequest added in v0.1.5

type IntraTransferRequest struct {
	Reference string        `json:"reference"`
	Amount    float64       `json:"amount"`
	Sender    TransferParty `json:"sender"`
	Receiver  TransferParty `json:"receiver"`
}

IntraTransferRequest schema for intra transfer request

type IntraTransferResponse added in v0.1.5

type IntraTransferResponse struct {
	ID        uuid.UUID     `json:"id"`
	Reference string        `json:"reference"`
	Amount    float64       `json:"amount"`
	Sender    TransferParty `json:"sender"`
	Receiver  TransferParty `json:"receiver"`
}

IntraTransferResponse schema for intra transfer response

type Key added in v0.2.5

type Key string

Key is a middleware key sting value

type MockCustomerDepositRequest added in v0.2.9

type MockCustomerDepositRequest struct {
	CustomerID string  `json:"customer_id"`
	Amount     float64 `json:"amount"`
	Currency   string  `json:"currency"`
}

MockCustomerDepositRequest schema for customer mock deposit request

type Money added in v0.2.8

type Money struct {
	// Currency is string value of the currency
	Currency string `json:"currency"`
	// Symbol is string value of the currency
	Symbol string ` json:"symbol" gorm:"-"`
	// Amount is the value of the amount
	Amount float64 `json:"amount"`
}

Money schema for money

type Page added in v0.0.7

type Page struct {
	Number            *int   `json:"number"`
	Size              *int   `json:"size"`
	SortBy            string `json:"sort_by"`
	SortDirectionDesc *bool  `json:"sort_direction_desc"`
}

Page schema for pagination request

type PageInfo added in v0.2.9

type PageInfo struct {
	Page            int64 `json:"page"`
	Size            int64 `json:"size"`
	HasNextPage     bool  `json:"has_next_age"`
	HasPreviousPage bool  `json:"has_previous_age"`
	TotalCount      int64 `json:"total_count"`
}

PageInfo schema for page info

type PayoutAccount added in v0.2.8

type PayoutAccount struct {
	ID           uuid.UUID      `json:"id"`
	BusinessID   uuid.UUID      `json:"business_id"`
	BulkPayoutID uuid.UUID      `json:"bulk_payout_id"`
	Name         string         `json:"name"`
	Details      AccountDetails `json:"details"`
	Amount       Money          `json:"amount"`
	Status       string         `json:"status"`
	LookupInfo   string         `json:"lookup_info"`
	Remarks      string         `json:"remarks"`
	CompletedAt  *string        `json:"completed_at"`
	CreatedAt    time.Time      `json:"created_at"`
	UpdatedAt    time.Time      `json:"updated_at"`
}

PayoutAccount schema for payout account

type PayoutDetails added in v0.2.8

type PayoutDetails struct {
	ID           uuid.UUID  `json:"id"`
	BusinessID   uuid.UUID  `json:"business_id"`
	Status       string     `json:"status"`
	Count        int        `json:"count"`
	Currency     string     `json:"currency"`
	TotalAmount  int        `json:"total_amount"`
	Fee          Money      `json:"fee"`
	Remarks      string     `json:"remarks"`
	CancelReason *string    `json:"cancel_reason"`
	CompletedAt  *time.Time `json:"completed_at"`
	CreatedAt    time.Time  `json:"created_at"`
	UpdatedAt    time.Time  `json:"updated_at"`
}

PayoutDetails schema for payout details

type PayoutResponse added in v0.2.8

type PayoutResponse struct {
	Items      PayoutDetails   `json:"items"`
	Attributes []PayoutAccount `json:"attributes"`
}

PayoutResponse schema for payout response

type PayoutType added in v0.2.9

type PayoutType string

PayoutType payoutType string

const (
	// SinglePayout represent single payout type
	SinglePayout PayoutType = "single"

	// MultiplePayout represent multiple payout type
	MultiplePayout PayoutType = "multiple"
)

type PersonalDetails

type PersonalDetails struct {
	Name        string `json:"name"`
	Country     string `json:"country"`
	City        string `json:"city"`
	Address     string `json:"address"`
	District    string `json:"district,omitempty"`
	PostalCode  string `json:"postal_code,omitempty"`
	Email       string `json:"email,omitempty"`
	PhoneNumber string `json:"phone_number,omitempty"`
}

PersonalDetails schema for personal details

type Settlement added in v0.2.9

type Settlement struct {
	ID                uuid.UUID       `json:"id"`
	Status            string          `json:"status"`
	BatchDate         *postgres.Jsonb `json:"batch_date"`
	TransactionAmount float64         `json:"transaction_amount"`
	BatchAmount       float64         `json:"batch_amount"`
	Currency          string          `json:"currency"`
	InitiatedAt       time.Time       `json:"initiated_at"`
	CompletedTime     *time.Time      `json:"completed_at"`
	TransactionType   string          `json:"transaction_type"`
}

Settlement schema for settlement

type TerminalTransfer added in v0.2.9

type TerminalTransfer struct {
	ID                 uuid.UUID      `json:"id"`
	BusinessID         uuid.UUID      `json:"business_id"`
	Type               string         `json:"type"`
	Amount             Money          `json:"amount"`
	Deposit            Money          `json:"deposited_amount"`
	Transfer           Money          `json:"transferred_amount"`
	SourceCurrency     string         `json:"source_currency"`
	Fee                Money          `json:"fee"`
	FeePercentage      float64        `json:"fee_percentage"`
	FeeFlat            float64        `json:"fee_flat"`
	Status             string         `json:"status"`
	ComplianceStatus   string         `json:"compliance_status"`
	BeneficiaryDetails postgres.Jsonb `json:"beneficiary_details"`
	Note               *string        `json:"note"`
	Reason             string         `json:"reason"`
	Reference          *string        `json:"reference"`
	Modified           bool           `json:"modified"`
	NeedDocumentUpload bool           `json:"need_document_upload"`
	MarkupValue        float64        `json:"markup_value"`
	CancelReason       *string        `json:"cancel_reason"`
	CompletedAt        *time.Time     `json:"completed_at"`
	CreatedAt          time.Time      `json:"created_at"`
	UpdatedAt          *time.Time     `json:"updated_at"`
	IsDateUpdated      bool           `json:"is_date_updated"`
	ComplianceNotes    *string        `json:"compliance_notes"`
}

TerminalTransfer schema for terminal transfer

type Transaction

type Transaction struct {
	ID              string      `json:"id"`
	BusinessID      string      `json:"businessID"`
	CustomerID      string      `json:"customerID"`
	YieldOfferingID string      `json:"yieldOfferingID"`
	Type            string      `json:"type"`
	Amount          float64     `json:"amount"`
	Currency        string      `json:"currency"`
	Reference       string      `json:"reference"`
	Status          string      `json:"status"`
	Destination     Destination `json:"destination"`
	CompletedAt     string      `json:"completedAt"`
	CreatedAt       string      `json:"createdAt"`
	BatchDate       string      `json:"batchDate"`
}

Transaction schema for transaction

type Transfer

type Transfer struct {
	ID              uuid.UUID      `json:"id"`
	Name            string         `json:"name"`
	Email           string         `json:"email"`
	CustomerID      uuid.UUID      `json:"customer_id"`
	Amount          float64        `json:"amount"`
	Currency        string         `json:"currency"`
	Destination     postgres.Jsonb `json:"destination"`
	Note            *string        `json:"note"`
	Reason          string         `json:"reason"`
	CreatedAt       time.Time      `json:"created_at"`
	CompletedAt     sql.NullTime   `json:"completed_at"`
	UpdatedAt       sql.NullTime   `json:"updated_at"`
	BatchDate       time.Time      `json:"batch_date"`
	Status          string         `json:"status"`
	Reference       string         `json:"reference"`
	CancelReason    *string        `json:"cancel_reason"`
	TransactionType string         `json:"type"`
}

Transfer schema for customer transfer

type TransferBeneficiary added in v0.2.9

type TransferBeneficiary struct {
	ID                  uuid.UUID      `json:"id"`
	BusinessID          uuid.UUID      `json:"business_id"`
	Name                string         `json:"name"`
	Reference           string         `json:"reference"`
	Details             postgres.Jsonb `json:"details"`
	DestinationCurrency string         `json:"currency"`
	ComplianceStatus    string         `json:"compliance_status"`
	Nickname            string         `json:"nickname"`
	CreatedAt           time.Time      `json:"created_at"`
	UpdatedAt           *time.Time     `json:"updated_at"`
}

TransferBeneficiary schema for transfer beneficiary

type TransferBeneficiaryDetails added in v0.2.9

type TransferBeneficiaryDetails struct {
	BankDetails         *BankDetails      `json:"bank_details,omitempty"`
	IntermediaryBank    *IntermediaryBank `json:"intermediary_bank,omitempty"`
	PersonalDetails     *PersonalDetails  `json:"personal_details,omitempty"`
	WalletDetails       *WalletDetails    `json:"wallet_details,omitempty"`
	FundsTransferMethod map[string]string `json:"funds_transfer_method"`
}

TransferBeneficiaryDetails schema for transfer beneficiary details

type TransferDestination

type TransferDestination struct {
	Type            string          `json:"type"`
	BankDetails     BankDetails     `json:"bank_details"`
	PersonalDetails PersonalDetails `json:"personal_details"`
}

TransferDestination schema for transfer destination

type TransferInstruction added in v0.2.7

type TransferInstruction struct {
	IBAN               string `json:"iban"`
	SortCode           string `json:"sort_code"`
	Notes              string `json:"notes"`
	BankPhone          string `json:"bank_phone"`
	Reference          string `json:"reference"`
	SwiftCode          string `json:"swift_code"`
	BankAddress        string `json:"bank_address"`
	AccountName        string `json:"account_name"`
	AccountNumber      string `json:"account_number"`
	BankName           string `json:"bank_name"`
	BankCode           string `json:"bank_code"`
	RoutingNumber      string `json:"routing_number"`
	BeneficiaryAddress string `json:"beneficiary_address"`
}

TransferInstruction schema for transfer instruction

type TransferParty added in v0.1.5

type TransferParty struct {
	CustomerID      string `json:"customer_id"`
	YieldOfferingID string `json:"yield_offering_id"`
}

TransferParty schema for transfer response

type TransferResponse added in v0.2.9

type TransferResponse struct {
	ID              uuid.UUID               `json:"id"`
	TransferRequest InitiateTransferRequest `json:"transfer_request"`
	CreatedAt       time.Time               `json:"created_at"`
	Status          string                  `json:"status"`
}

TransferResponse schema for transfer response

type UpdateCustomerRequest

type UpdateCustomerRequest struct {
	CustomerID       string      `json:"customer_id"`
	Name             string      `json:"name"`
	Email            string      `json:"email"`
	Reference        string      `json:"reference"`
	MobileNumber     string      `json:"mobile_number"`
	YieldOfferingIDs []uuid.UUID `json:"yield_offering_ids"`
}

UpdateCustomerRequest schema for update customer request

type WalletDetails added in v0.2.9

type WalletDetails struct {
	WalletTag     *string `json:"wallet_tag,omitempty"`
	AssetType     string  `json:"asset_type,omitempty"`
	WalletAddress string  `json:"wallet_address"`
	Network       string  `json:"network"`
}

WalletDetails schema for wallet details

type Withdrawal added in v0.0.3

type Withdrawal struct {
	ID                 uuid.UUID       `json:"id"`
	CustomerID         uuid.UUID       `json:"customer_id"`
	Name               string          `json:"name"`
	Email              string          `json:"email"`
	Reference          string          `json:"reference"`
	Amount             float64         `json:"amount"`
	Channel            string          `json:"channel"`
	Currency           string          `json:"currency"`
	CreatedAt          time.Time       `json:"created_at"`
	CompletedAt        *time.Time      `json:"completed_at"`
	UpdatedAt          *time.Time      `json:"updated_at"`
	BatchDate          string          `json:"batch_date"`
	Status             string          `json:"status"`
	WithdrawalAmount   *float64        `json:"withdrawal_amount"`
	WithdrawalCurrency *string         `json:"withdrawal_currency"`
	WithdrawalDetail   *postgres.Jsonb `json:"payout_detail"`
	CancelReason       *string         `json:"cancel_reason"`
	YieldOfferingID    uuid.UUID       `json:"yield_offering_id"`
}

Withdrawal schema for withdrawal

type WithdrawalRequest added in v0.1.5

type WithdrawalRequest struct {
	CustomerID      string  `json:"customer_id"`
	Reference       string  `json:"reference"`
	Amount          float64 `json:"amount"`
	YieldOfferingID string  `json:"yield_offering_id"`
	PayoutCurrency  *string `json:"payout_currency,omitempty"`
	WalletDetail    struct {
		Asset   string `json:"asset"`
		Network string `json:"network"`
		Address string `json:"address"`
	} `json:"wallet_detail,omitempty"`
	BankDetail struct {
		BankCode      string `json:"bank_code"`
		AccountNumber string `json:"account_number"`
	} `json:"bank_detail,omitempty"`
}

WithdrawalRequest schema for withdrawal request

Directories

Path Synopsis
Package example holds sample models for requests
Package example holds sample models for requests

Jump to

Keyboard shortcuts

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