common

package
v1.1.1305 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 60 * time.Second

DefaultTimeout for HTTP Requests

View Source
const LibraryVersion = "0.0.1"

LibraryVersion lists current sleet version following Semantic Versioning

Variables

View Source
var CURRENCIES = map[Code]sleet.Currency{}/* 166 elements not displayed */

CURRENCIES maps the precision to the currency symbol used for lookups for some PsP providers that rely on these values for amount calculation One example is Braintree which uses its own amount structure requiring the precision of a currency

Functions

func BPtr added in v1.1.707

func BPtr(b bool) *bool

BPtr returns a pointer to the bool value b

func ConvertUnitOfMeasurementToCode added in v1.1.550

func ConvertUnitOfMeasurementToCode(unit string) string

ConvertUnitOfMeasurementToCode returns the codified version of the unit of measurement per https://www.namm.org/standards/implementation-guide-/codes-tables/unit-measurement-uom-codes (not yet finalized). If no code is found, we return the code for "each" as our best guess.

func DefaultHttpClient

func DefaultHttpClient() *http.Client

DefaultHttpClient returns an http client with defaultTimeout specified above

func SPtr added in v1.0.252

func SPtr(s string) *string

SPtr returns a pointer to the string value s

func SafeStr

func SafeStr(s *string) string

SafeStr safely dereferences a string pointer and returns its value if it is non-nil, or the empty string if it is nil.

func UserAgent

func UserAgent() string

UserAgent specifies the Sleet library and version for PsPs that require this header

Types

type Code added in v1.1.550

type Code string

Code represents ISO 4217 Currency Codes

const (
	AED Code = "AED"
	AFN Code = "AFN"
	ALL Code = "ALL"
	AMD Code = "AMD"
	ANG Code = "ANG"
	AOA Code = "AOA"
	ARS Code = "ARS"
	AUD Code = "AUD"
	AWG Code = "AWG"
	AZN Code = "AZN"
	BAM Code = "BAM"
	BBD Code = "BBD"
	BDT Code = "BDT"
	BGN Code = "BGN"
	BHD Code = "BHD"
	BIF Code = "BIF"
	BMD Code = "BMD"
	BND Code = "BND"
	BOB Code = "BOB"
	BOV Code = "BOV"
	BRL Code = "BRL"
	BSD Code = "BSD"
	BTN Code = "BTN"
	BWP Code = "BWP"
	BYN Code = "BYN"
	BZD Code = "BZD"
	CAD Code = "CAD"
	CDF Code = "CDF"
	CHE Code = "CHE"
	CHF Code = "CHF"
	CHW Code = "CHW"
	CLF Code = "CLF"
	CLP Code = "CLP"
	CNY Code = "CNY"
	COP Code = "COP"
	COU Code = "COU"
	CRC Code = "CRC"
	CUC Code = "CUC"
	CUP Code = "CUP"
	CVE Code = "CVE"
	CZK Code = "CZK"
	DJF Code = "DJF"
	DKK Code = "DKK"
	DOP Code = "DOP"
	DZD Code = "DZD"
	EGP Code = "EGP"
	ERN Code = "ERN"
	ETB Code = "ETB"
	EUR Code = "EUR"
	FJD Code = "FJD"
	FKP Code = "FKP"
	GBP Code = "GBP"
	GEL Code = "GEL"
	GHS Code = "GHS"
	GIP Code = "GIP"
	GMD Code = "GMD"
	GNF Code = "GNF"
	GTQ Code = "GTQ"
	GYD Code = "GYD"
	HKD Code = "HKD"
	HNL Code = "HNL"
	HRK Code = "HRK"
	HTG Code = "HTG"
	HUF Code = "HUF"
	IDR Code = "IDR"
	ILS Code = "ILS"
	INR Code = "INR"
	IQD Code = "IQD"
	IRR Code = "IRR"
	ISK Code = "ISK"
	JMD Code = "JMD"
	JOD Code = "JOD"
	JPY Code = "JPY"
	KES Code = "KES"
	KGS Code = "KGS"
	KHR Code = "KHR"
	KMF Code = "KMF"
	KPW Code = "KPW"
	KRW Code = "KRW"
	KWD Code = "KWD"
	KYD Code = "KYD"
	KZT Code = "KZT"
	LAK Code = "LAK"
	LBP Code = "LBP"
	LKR Code = "LKR"
	LRD Code = "LRD"
	LSL Code = "LSL"
	LYD Code = "LYD"
	MAD Code = "MAD"
	MDL Code = "MDL"
	MGA Code = "MGA"
	MKD Code = "MKD"
	MMK Code = "MMK"
	MNT Code = "MNT"
	MOP Code = "MOP"
	MRU Code = "MRU"
	MUR Code = "MUR"
	MVR Code = "MVR"
	MWK Code = "MWK"
	MXN Code = "MXN"
	MXV Code = "MXV"
	MYR Code = "MYR"
	MZN Code = "MZN"
	NAD Code = "NAD"
	NGN Code = "NGN"
	NIO Code = "NIO"
	NOK Code = "NOK"
	NPR Code = "NPR"
	NZD Code = "NZD"
	OMR Code = "OMR"
	PAB Code = "PAB"
	PEN Code = "PEN"
	PGK Code = "PGK"
	PHP Code = "PHP"
	PKR Code = "PKR"
	PLN Code = "PLN"
	PYG Code = "PYG"
	QAR Code = "QAR"
	RON Code = "RON"
	RSD Code = "RSD"
	RUB Code = "RUB"
	RWF Code = "RWF"
	SAR Code = "SAR"
	SBD Code = "SBD"
	SCR Code = "SCR"
	SDG Code = "SDG"
	SEK Code = "SEK"
	SGD Code = "SGD"
	SHP Code = "SHP"
	SLL Code = "SLL"
	SOS Code = "SOS"
	SRD Code = "SRD"
	SSP Code = "SSP"
	STN Code = "STN"
	SVC Code = "SVC"
	SYP Code = "SYP"
	SZL Code = "SZL"
	THB Code = "THB"
	TJS Code = "TJS"
	TMT Code = "TMT"
	TND Code = "TND"
	TOP Code = "TOP"
	TRY Code = "TRY"
	TTD Code = "TTD"
	TWD Code = "TWD"
	TZS Code = "TZS"
	UAH Code = "UAH"
	UGX Code = "UGX"
	USD Code = "USD"
	USN Code = "USN"
	UYI Code = "UYI"
	UYU Code = "UYU"
	UYW Code = "UYW"
	UZS Code = "UZS"
	VES Code = "VES"
	VND Code = "VND"
	VUV Code = "VUV"
	WST Code = "WST"
	XAF Code = "XAF"
	XAG Code = "XAG"
	XAU Code = "XAU"
	XBA Code = "XBA"
	XBB Code = "XBB"
	XBC Code = "XBC"
	XBD Code = "XBD"
	XCD Code = "XCD"
	XDR Code = "XDR"
	XOF Code = "XOF"
	XPD Code = "XPD"
	XPF Code = "XPF"
	XPT Code = "XPT"
	XSU Code = "XSU"
	XTS Code = "XTS"
	XUA Code = "XUA"
	XXX Code = "XXX"
	YER Code = "YER"
	ZAR Code = "ZAR"
	ZMW Code = "ZMW"
	ZWL Code = "ZWL"
)

ISO 4217 Code List

func GetCode added in v1.1.550

func GetCode(code string) (Code, error)

GetCode converts a symbol string into the strongly typed Code

func (Code) String added in v1.1.550

func (c Code) String() string

type Environment added in v1.0.317

type Environment string

Environment provides a common way of interacting with Sleet's PsP Sandbox refers to non-live, typically test accounts and Production to live accounts Done at the Sleet level to avoid clients having to import Payment specific data

const (
	Sandbox    Environment = "sandbox"
	Production Environment = "production"
)

Only sandbox and production environments are supported

Jump to

Keyboard shortcuts

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