visa

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rate added in v0.2.0

func Rate(from, to string) (float64, error)

Types

type OriginalValues

type OriginalValues struct {
	FromCurrency              string        `json:"fromCurrency"`
	FromCurrencyName          string        `json:"fromCurrencyName"`
	ToCurrency                string        `json:"toCurrency"`
	ToCurrencyName            string        `json:"toCurrencyName"`
	AsOfDate                  int           `json:"asOfDate"`
	FromAmount                string        `json:"fromAmount"`
	ToAmountWithVisaRate      string        `json:"toAmountWithVisaRate"`
	ToAmountWithAdditionalFee string        `json:"toAmountWithAdditionalFee"`
	FxRateVisa                string        `json:"fxRateVisa"`
	FxRateWithAdditionalFee   string        `json:"fxRateWithAdditionalFee"`
	LastUpdatedVisaRate       int           `json:"lastUpdatedVisaRate"`
	Benchmarks                []interface{} `json:"benchmarks"`
}

type RatesRequest

type RatesRequest struct {
	Amount           float64   `json:"amount"`
	Fee              float64   `json:"fee,omitempty"`
	UTCConvertedDate time.Time `json:"utcConvertedDate,omitempty"`
	ExchangeDate     time.Time `json:"exchangedate,omitempty"`
	FromCurr         string    `json:"fromCurr"`
	ToCurr           string    `json:"toCurr"`
}

func (*RatesRequest) Values

func (o *RatesRequest) Values() url.Values

type RatesResponse

type RatesResponse struct {
	OriginalValues          OriginalValues `json:"originalValues"`
	ConversionAmountValue   string         `json:"conversionAmountValue"`
	ConversionBankFee       string         `json:"conversionBankFee"`
	ConversionInputDate     string         `json:"conversionInputDate"`
	ConversionFromCurrency  string         `json:"conversionFromCurrency"`
	ConversionToCurrency    string         `json:"conversionToCurrency"`
	FromCurrencyName        string         `json:"fromCurrencyName"`
	ToCurrencyName          string         `json:"toCurrencyName"`
	ConvertedAmount         string         `json:"convertedAmount"`
	BenchMarkAmount         string         `json:"benchMarkAmount"`
	FxRateWithAdditionalFee string         `json:"fxRateWithAdditionalFee"`
	ReverseAmount           string         `json:"reverseAmount"`
	DisclaimerDate          string         `json:"disclaimerDate"`
	Status                  string         `json:"status"`
}
{
	"originalValues":{
	   "fromCurrency":"USD",
	   "fromCurrencyName":"United States Dollar",
	   "toCurrency":"TWD",
	   "toCurrencyName":"New Taiwan Dollar",
	   "asOfDate":1682899200,
	   "fromAmount":"100000",
	   "toAmountWithVisaRate":"3074900",
	   "toAmountWithAdditionalFee":"3074900",
	   "fxRateVisa":"30.749",
	   "fxRateWithAdditionalFee":"30.749",
	   "lastUpdatedVisaRate":1682725860,
	   "benchmarks":[]
	},
	"conversionAmountValue":"100000",
	"conversionBankFee":"0.0",
	"conversionInputDate":"05/01/2023",
	"conversionFromCurrency":"TWD",
	"conversionToCurrency":"USD",
	"fromCurrencyName":"United States Dollar",
	"toCurrencyName":"New Taiwan Dollar",
	"convertedAmount":"3,074,900.000000",
	"benchMarkAmount":"",
	"fxRateWithAdditionalFee":"30.749",
	"reverseAmount":"0.032521",
	"disclaimerDate":"May 1, 2023",
	"status":"success"
}

type RestClient

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

func NewRestClient

func NewRestClient() *RestClient

func (*RestClient) NewRequest

func (c *RestClient) NewRequest(ctx context.Context, method string, refURL string, params url.Values) (*http.Request, error)

Jump to

Keyboard shortcuts

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