Documentation
¶
Index ¶
- Variables
- func CheckResponse(r *http.Response) error
- func CreateFormFile(w *multipart.Writer, data io.Reader, fieldname, filename string) (io.Writer, error)
- func GetFileContentType(file io.Reader) (string, error)
- type BoolToNumber
- type Client
- func (c *Client) BaseURL() url.URL
- func (c *Client) Charset() string
- func (c *Client) Debug() bool
- func (c *Client) Do(req *http.Request, responseBody interface{}) (*http.Response, error)
- func (c *Client) GetEndpointURL(relative string, pathParams PathParams) url.URL
- func (c *Client) MediaType() string
- func (c *Client) NewRequest(ctx context.Context, req Request) (*http.Request, error)
- func (c *Client) NewSendFilesFormParams() *SendFilesFormParams
- func (c *Client) NewSendFilesPathParams() *SendFilesPathParams
- func (c *Client) NewSendFilesQueryParams() *SendFilesQueryParams
- func (c *Client) NewSendFilesRequest() SendFilesRequest
- func (s *Client) NewSendFilesRequestBody() SendFilesRequestBody
- func (c *Client) PMSCode() string
- func (c *Client) SetBaseURL(baseURL url.URL)
- func (c *Client) SetCharset(charset string)
- func (c *Client) SetDebug(debug bool)
- func (c *Client) SetDisallowUnknownFields(disallowUnknownFields bool)
- func (c *Client) SetMediaType(mediaType string)
- func (c *Client) SetPMSCode(pmsCode string)
- func (c *Client) SetUserAgent(userAgent string)
- func (c *Client) Unmarshal(r io.Reader, vv ...interface{}) error
- func (c *Client) UserAgent() string
- type Date
- type DateTime
- type ErrorResponse
- type Errors
- type FileMetaData
- type Form
- type FormFile
- type IntString
- type Oauth2Config
- type Oauth2PasswordConfig
- type PathParams
- type QueryParams
- type Request
- type RequestCompletionCallback
- type SendFilesFormParams
- type SendFilesPathParams
- type SendFilesQueryParams
- type SendFilesRequest
- func (r *SendFilesRequest) Do() (SendFilesResponseBody, error)
- func (r *SendFilesRequest) FormParams() *SendFilesFormParams
- func (r *SendFilesRequest) FormParamsInterface() Form
- func (r *SendFilesRequest) Method() string
- func (r *SendFilesRequest) NewResponseBody() *SendFilesResponseBody
- func (r *SendFilesRequest) PathParams() *SendFilesPathParams
- func (r *SendFilesRequest) PathParamsInterface() PathParams
- func (r *SendFilesRequest) QueryParams() *SendFilesQueryParams
- func (r *SendFilesRequest) RequestBody() *SendFilesRequestBody
- func (r *SendFilesRequest) RequestBodyInterface() interface{}
- func (r *SendFilesRequest) SetMethod(method string)
- func (r *SendFilesRequest) SetRequestBody(body SendFilesRequestBody)
- func (r *SendFilesRequest) URL() *url.URL
- type SendFilesRequestBody
- type SendFilesResponse
- type SendFilesResponseBody
- type StatusErrorResponse
- type StringFloat
- type StringInt
- type Time
- type TransactionDatasetRow
- type TransactionDatasetRows
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
var (
BaseURL = url.URL{
Scheme: "https",
Host: "api.fourth.com",
Path: "api/eposgateway",
}
)
Functions ¶
func CheckResponse ¶
CheckResponse checks the Client response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. Client 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 CreateFormFile ¶
Types ¶
type BoolToNumber ¶
type BoolToNumber bool
func (BoolToNumber) MarshalSchema ¶
func (b BoolToNumber) MarshalSchema() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages communication with InvoiceXpress Client
func (*Client) Do ¶
Do sends an Client request and returns the Client response. The Client response is json decoded and stored in the value pointed to by v, or returned as an error if an Client error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.
func (*Client) GetEndpointURL ¶
func (c *Client) GetEndpointURL(relative string, pathParams PathParams) url.URL
func (*Client) NewRequest ¶
func (*Client) NewSendFilesFormParams ¶
func (c *Client) NewSendFilesFormParams() *SendFilesFormParams
func (*Client) NewSendFilesPathParams ¶
func (c *Client) NewSendFilesPathParams() *SendFilesPathParams
func (*Client) NewSendFilesQueryParams ¶
func (c *Client) NewSendFilesQueryParams() *SendFilesQueryParams
func (*Client) NewSendFilesRequest ¶
func (c *Client) NewSendFilesRequest() SendFilesRequest
func (*Client) NewSendFilesRequestBody ¶
func (s *Client) NewSendFilesRequestBody() SendFilesRequestBody
func (*Client) SetBaseURL ¶
func (*Client) SetCharset ¶
func (*Client) SetDisallowUnknownFields ¶
func (*Client) SetMediaType ¶
func (*Client) SetPMSCode ¶
func (*Client) SetUserAgent ¶
type ErrorResponse ¶
type ErrorResponse struct { // HTTP response that caused this error Response *http.Response ValidationErrors []ValidationError Errors Errors `json:"errors"` Message string `json:"message"` Type string `json:"type"` Title string `json:"title"` Status int `json:"status"` TraceID string `json:"traceId"` }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
func (*ErrorResponse) UnmarshalJSON ¶
func (r *ErrorResponse) UnmarshalJSON(data []byte) error
type FileMetaData ¶
type Oauth2Config ¶
func NewOauth2Config ¶
func NewOauth2Config() *Oauth2Config
func (*Oauth2Config) SetBaseURL ¶
func (c *Oauth2Config) SetBaseURL(baseURL *url.URL)
type Oauth2PasswordConfig ¶
type Oauth2PasswordConfig struct {
passwordcredentials.Config
}
func NewOauth2PasswordConfig ¶
func NewOauth2PasswordConfig() *Oauth2PasswordConfig
func (*Oauth2PasswordConfig) SetBaseURL ¶
func (c *Oauth2PasswordConfig) SetBaseURL(baseURL *url.URL)
type PathParams ¶
type QueryParams ¶
type Request ¶
type Request interface { Method() string // QueryParams() QueryParams PathParamsInterface() PathParams RequestBodyInterface() interface{} URL() *url.URL }
type RequestCompletionCallback ¶
RequestCompletionCallback defines the type of the request callback function
type SendFilesFormParams ¶
type SendFilesFormParams struct {
ExtfFile FormFile
}
func (SendFilesFormParams) Files ¶
func (p SendFilesFormParams) Files() map[string]FormFile
func (SendFilesFormParams) IsMultiPart ¶
func (p SendFilesFormParams) IsMultiPart() bool
func (SendFilesFormParams) Values ¶
func (p SendFilesFormParams) Values() url.Values
type SendFilesPathParams ¶
type SendFilesPathParams struct { }
func (*SendFilesPathParams) Params ¶
func (p *SendFilesPathParams) Params() map[string]string
type SendFilesQueryParams ¶
type SendFilesQueryParams struct{}
func (SendFilesQueryParams) ToURLValues ¶
func (p SendFilesQueryParams) ToURLValues() (url.Values, error)
type SendFilesRequest ¶
type SendFilesRequest struct {
// contains filtered or unexported fields
}
func (*SendFilesRequest) Do ¶
func (r *SendFilesRequest) Do() (SendFilesResponseBody, error)
func (*SendFilesRequest) FormParams ¶
func (r *SendFilesRequest) FormParams() *SendFilesFormParams
func (*SendFilesRequest) FormParamsInterface ¶
func (r *SendFilesRequest) FormParamsInterface() Form
func (*SendFilesRequest) Method ¶
func (r *SendFilesRequest) Method() string
func (*SendFilesRequest) NewResponseBody ¶
func (r *SendFilesRequest) NewResponseBody() *SendFilesResponseBody
func (*SendFilesRequest) PathParams ¶
func (r *SendFilesRequest) PathParams() *SendFilesPathParams
func (*SendFilesRequest) PathParamsInterface ¶
func (r *SendFilesRequest) PathParamsInterface() PathParams
func (*SendFilesRequest) QueryParams ¶
func (r *SendFilesRequest) QueryParams() *SendFilesQueryParams
func (*SendFilesRequest) RequestBody ¶
func (r *SendFilesRequest) RequestBody() *SendFilesRequestBody
func (*SendFilesRequest) RequestBodyInterface ¶
func (r *SendFilesRequest) RequestBodyInterface() interface{}
func (*SendFilesRequest) SetMethod ¶
func (r *SendFilesRequest) SetMethod(method string)
func (*SendFilesRequest) SetRequestBody ¶
func (r *SendFilesRequest) SetRequestBody(body SendFilesRequestBody)
func (*SendFilesRequest) URL ¶
func (r *SendFilesRequest) URL() *url.URL
type SendFilesRequestBody ¶
type SendFilesRequestBody struct{}
type SendFilesResponse ¶
type SendFilesResponseBody ¶
type SendFilesResponseBody []SendFilesResponse
type StatusErrorResponse ¶
func (*StatusErrorResponse) Error ¶
func (r *StatusErrorResponse) Error() string
type StringFloat ¶
type StringFloat float64
func (*StringFloat) UnmarshalJSON ¶
func (f *StringFloat) UnmarshalJSON(text []byte) (err error)
type Time ¶
func (Time) MarshalCSV ¶
Convert the internal date as CSV string
func (*Time) MarshalJSON ¶
func (Time) MarshalSchema ¶
func (*Time) UnmarshalJSON ¶
type TransactionDatasetRow ¶
type TransactionDatasetRow struct { TransactionID string `csv:"transactionid"` UnitID string `csv:"unitid"` SiteLocationCode string `csv:"sitelocationcode"` TradingDate DateTime `csv:"tradingdate"` Time Time `csv:"time"` Timefact string `csv:"timefact"` TerminalCode string `csv:"terminalcode"` TerminalDesc string `csv:"terminaldesc"` RecordActivityCode int `csv:"recordactivitycode,omitempty"` ReceiptCode string `csv:"receiptcode"` CheckCode string `csv:"checkcode"` TableCode string `csv:"tablecode"` RevenueCentreCode string `csv:"revenuecentrecode"` RevenueCentreDesc string `csv:"revenuecentredesc"` TransactionTypeCode string `csv:"transactiontypecode"` SalesItemID string `csv:"salesitemid"` SalesItemPLU string `csv:"salesitemPLU"` SalesItemGUID string `csv:"salesitemGUID"` SalesItemDesc string `csv:"salesitemdesc"` TenderTypeCode string `csv:"tendertypecode"` TenderTypeDesc string `csv:"tendertypedesc"` DeductionCode string `csv:"deductioncode"` DeductionDesc string `csv:"deductiondesc"` Covers int `csv:"covers"` Qty float64 `csv:"qty"` Currency string `csv:"currency"` ListPrice float64 `csv:"listprice"` Tax float64 `csv:"tax"` PricePaid float64 `csv:"pricepaid"` Deduction float64 `csv:"deduction"` TenderAmount float64 `csv:"tenderamount"` CostPriceTheo float64 `csv:"costpricetheo"` ListPriceConv float64 `csv:"listpriceconv"` TaxConv float64 `csv:"taxconv"` PricePaidConv float64 `csv:"pricepaidconv"` DeductionConv float64 `csv:"deductionconv"` TenderAmountConv float64 `csv:"tenderamountconv"` CostPriceTheoConv float64 `csv:"costpricetheoconv"` OrderTypeDesc string `csv:"ordertypedesc"` MenuBand string `csv:"menuband"` MajorGroupDesc string `csv:"majorgroupdesc"` FamilyGroupDesc string `csv:"familygroupdesc"` SubGroupDesc string `csv:"subgroupdesc"` TabOwner string `csv:"tabowner"` TabOwnerDesc string `csv:"tabownerdesc"` OriginalTabOwner string `csv:"originaltabowner"` OriginalTabOwnerDesc string `csv:"originaltabownerdesc"` OldTableCode string `csv:"oldtablecode"` PrevTransactionCode string `csv:"prevtransactioncode"` AuthorisedBy string `csv:"authorisedby"` TextField string `csv:"textfield"` GuestDesc string `csv:"guestdesc"` GuestCode string `csv:"guestcode"` TimeSentToPrep string `csv:"timesenttoprep"` BumpTime string `csv:"bumptime"` UniversalTimesLotID string `csv:"universaltimeslotid"` TimeslotDesc string `csv:"timeslotdesc"` TransactionStartEnd int `csv:"transactionstartend"` IsDeleted int `csv:"isdeleted"` CustomField1 string `csv:"customfield1"` CustomField2 string `csv:"customfield2"` CustomField3 string `csv:"customfield3"` CustomFact1 string `csv:"customfact1"` CustomFact2 string `csv:"customfact2"` DateFact string `csv:"datefact"` }
type TransactionDatasetRows ¶
type TransactionDatasetRows []TransactionDatasetRow
type ValidationError ¶
type ValidationError struct { ErrorCode *int `json:"errorCode"` ErrorScopeID string `json:"errorScopeId"` Message string `json:"message"` Reference string `json:"reference"` SequentialID string `json:"sequentialId"` SourceHint string `json:"sourceHint"` }
[
{ "errorCode": 1001004, "errorScopeId": "9ab8f26a-e31d-4b36-b3f3-26c5c5340abd", "message": "Invalid Voucher type, valid Values (Unspecified,SupplierInvoice,AutoVat,SupplierInvoicePayment,CustomerInvoice,CustomerInvoicePayment", "sequentialId": "00000000-0000-0000-0000-000000000000" }
]