errors

package
v0.0.0-...-1f8cd32 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: BSD-3-Clause, MIT Imports: 9 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError interface {
	// Error implements the error interface
	Error() string

	// Message gets the raw response body that was returned by the Ingenico ePayments platform.
	Message() string

	// StatusCode gets the HTTP status code that was returned by the Ingenico ePayments platform.
	StatusCode() int

	// ResponseBody gets the raw response body that was returned by the Ingenico ePayments platform.
	ResponseBody() string

	// ErrorID gets the error identifier received from the Ingenico ePayments platform if available.
	ErrorID() string

	// Errors gets the error list received from the Ingenico ePayments platform if available. Never nil.
	Errors() []errors.APIError
}

APIError represents an error response from the Ingenico ePayments platform which contains an ID and a list of errors.

func CreateAPIError

func CreateAPIError(statusCode int, responseBody string, errorObject interface{}, context communication.CallContext) (APIError, error)

CreateAPIError is used internally in order to create an API error after an HTTP request is done

type AuthorizationError

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

AuthorizationError represents an error response from the Ingenico ePayments platform when authorization failed.

func NewAuthorizationError

func NewAuthorizationError(statusCode int, responseBody, errorID string, errors []errors.APIError) (*AuthorizationError, error)

NewAuthorizationError creates an AuthorizationError with the given statusCode, responseBody, errorID and errors

func NewAuthorizationErrorVerbose

func NewAuthorizationErrorVerbose(message string, statusCode int, responseBody, errorID string, errors []errors.APIError) (*AuthorizationError, error)

NewAuthorizationErrorVerbose creates an AuthorizationError with the given message, statusCode, responseBody, errorID and errors

func (*AuthorizationError) Error

func (ae *AuthorizationError) Error() string

Error implements the Error interface

func (*AuthorizationError) ErrorID

func (ae *AuthorizationError) ErrorID() string

ErrorID returns the error id

func (*AuthorizationError) Errors

func (ae *AuthorizationError) Errors() []errors.APIError

Errors returns a slice of underlying errors

func (*AuthorizationError) Message

func (ae *AuthorizationError) Message() string

Message returns the error message

func (*AuthorizationError) ResponseBody

func (ae *AuthorizationError) ResponseBody() string

ResponseBody returns the response body

func (*AuthorizationError) StatusCode

func (ae *AuthorizationError) StatusCode() int

StatusCode returns the status code

func (*AuthorizationError) String

func (ae *AuthorizationError) String() (list string)

String implements the Stringer interface Format: 'errorMessage; statusCode=; responseBody='

type CommunicationError

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

CommunicationError represents an error during the communication with the Ingenico ePayments platform

func NewCommunicationError

func NewCommunicationError(internalError error) (*CommunicationError, error)

NewCommunicationError creates a Communication with the given internal error

func (*CommunicationError) Error

func (ce *CommunicationError) Error() string

Error implements the Error interface

func (*CommunicationError) InternalError

func (ce *CommunicationError) InternalError() error

InternalError returns the internal error encountered

func (*CommunicationError) String

func (ce *CommunicationError) String() string

String implements the Stringer interface Format: 'There was an error in the communication with the Ingenico ePayments platform error'

type DeclinedPaymentError

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

DeclinedPaymentError represents an error response from a create payment call

func NewDeclinedPaymentError

func NewDeclinedPaymentError(statusCode int, responseBody string, errorResponse *payment.ErrorResponse) (*DeclinedPaymentError, error)

NewDeclinedPaymentError creates a DeclinedTransactionError with the given statusCode, responseBody and errorResponse

func (*DeclinedPaymentError) Error

func (dpe *DeclinedPaymentError) Error() string

Error implements the Error interface

func (*DeclinedPaymentError) ErrorID

func (dpe *DeclinedPaymentError) ErrorID() string

ErrorID returns the error id

func (*DeclinedPaymentError) Errors

func (dpe *DeclinedPaymentError) Errors() []errors.APIError

Errors returns a slice of underlying errors

func (*DeclinedPaymentError) Message

func (dpe *DeclinedPaymentError) Message() string

Message returns the error message

func (*DeclinedPaymentError) PaymentResult

func (dpe *DeclinedPaymentError) PaymentResult() *payment.CreateResult

PaymentResult returns the payment creation result

func (*DeclinedPaymentError) ResponseBody

func (dpe *DeclinedPaymentError) ResponseBody() string

ResponseBody returns the response body

func (*DeclinedPaymentError) StatusCode

func (dpe *DeclinedPaymentError) StatusCode() int

StatusCode returns the status code

func (*DeclinedPaymentError) String

func (dpe *DeclinedPaymentError) String() string

String implements the Stringer interface Format: 'errorMessage; statusCode=; responseBody='

type DeclinedPayoutError

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

DeclinedPayoutError represents an error response from a create payout call

func NewDeclinedPayoutError

func NewDeclinedPayoutError(statusCode int, responseBody string, errorResponse *payout.ErrorResponse) (*DeclinedPayoutError, error)

NewDeclinedPayoutError creates a DeclinedPayoutError with the given statusCode, responseBody and errorResponse

func (*DeclinedPayoutError) Error

func (dpe *DeclinedPayoutError) Error() string

Error implements the Error interface

func (*DeclinedPayoutError) ErrorID

func (dpe *DeclinedPayoutError) ErrorID() string

ErrorID returns the error id

func (*DeclinedPayoutError) Errors

func (dpe *DeclinedPayoutError) Errors() []errors.APIError

Errors returns a slice of underlying errors

func (*DeclinedPayoutError) Message

func (dpe *DeclinedPayoutError) Message() string

Message returns the error message

func (*DeclinedPayoutError) PayoutResult

func (dpe *DeclinedPayoutError) PayoutResult() *payout.Result

PayoutResult returns the payout result

func (*DeclinedPayoutError) ResponseBody

func (dpe *DeclinedPayoutError) ResponseBody() string

ResponseBody returns the response body

func (*DeclinedPayoutError) StatusCode

func (dpe *DeclinedPayoutError) StatusCode() int

StatusCode returns the status code

func (*DeclinedPayoutError) String

func (dpe *DeclinedPayoutError) String() string

String implements the Stringer interface Format: 'errorMessage; statusCode=; responseBody='

type DeclinedRefundError

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

DeclinedRefundError represents an error response from a refund call

func NewDeclinedRefundError

func NewDeclinedRefundError(statusCode int, responseBody string, errorResponse *refund.ErrorResponse) (*DeclinedRefundError, error)

NewDeclinedRefundError creates a DeclinedRefundError with the given statusCode, responseBody and errorResponse

func (*DeclinedRefundError) Error

func (dpe *DeclinedRefundError) Error() string

Error implements the Error interface

func (*DeclinedRefundError) ErrorID

func (dpe *DeclinedRefundError) ErrorID() string

ErrorID returns the error id

func (*DeclinedRefundError) Errors

func (dpe *DeclinedRefundError) Errors() []errors.APIError

Errors returns a slice of underlying errors

func (*DeclinedRefundError) Message

func (dpe *DeclinedRefundError) Message() string

Message returns the error message

func (*DeclinedRefundError) RefundResult

func (dpe *DeclinedRefundError) RefundResult() *refund.Result

RefundResult returns the refund result

func (*DeclinedRefundError) ResponseBody

func (dpe *DeclinedRefundError) ResponseBody() string

ResponseBody returns the response body

func (*DeclinedRefundError) StatusCode

func (dpe *DeclinedRefundError) StatusCode() int

StatusCode returns the status code

func (*DeclinedRefundError) String

func (dpe *DeclinedRefundError) String() string

String implements the Stringer interface Format: 'errorMessage; statusCode=; responseBody='

type GlobalCollectError

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

GlobalCollectError represents an error response from the Ingenico ePayments platform when something went wrong at the Ingenico ePayments platform or further downstream.

func NewGlobalCollectError

func NewGlobalCollectError(statusCode int, responseBody, errorID string, errors []errors.APIError) (*GlobalCollectError, error)

NewGlobalCollectError creates a GlobalCollectError with the given statusCode, responseBody, errorID and errors

func NewGlobalCollectErrorVerbose

func NewGlobalCollectErrorVerbose(message string, statusCode int, responseBody, errorID string, errors []errors.APIError) (*GlobalCollectError, error)

NewGlobalCollectErrorVerbose creates a GlobalCollectError with the given message, statusCode, responseBody, errorID and errors

func (*GlobalCollectError) Error

func (gce *GlobalCollectError) Error() string

Error implements the Error interface

func (*GlobalCollectError) ErrorID

func (gce *GlobalCollectError) ErrorID() string

ErrorID returns the error id

func (*GlobalCollectError) Errors

func (gce *GlobalCollectError) Errors() []errors.APIError

Errors returns a slice of underlying errors

func (*GlobalCollectError) Message

func (gce *GlobalCollectError) Message() string

Message returns the error message

func (*GlobalCollectError) ResponseBody

func (gce *GlobalCollectError) ResponseBody() string

ResponseBody returns the response body

func (*GlobalCollectError) StatusCode

func (gce *GlobalCollectError) StatusCode() int

StatusCode returns the status code

func (*GlobalCollectError) String

func (gce *GlobalCollectError) String() string

String implements the Stringer ineterface Format: 'errorMessage; statusCode=; responseBody='

type IdempotenceError

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

IdempotenceError represents an error response from the Ingenico ePayments platform when an idempotent request failed because the first request has not finished yet.

func NewIdempotenceError

func NewIdempotenceError(idempotenceKey string, idempotenceRequestTimestamp *int64, statusCode int, responseBody, errorID string, errors []errors.APIError) (*IdempotenceError, error)

NewIdempotenceError creates an IdempotenceError with the given idempotenceKey, idempotenceRequestTimestamp, statusCode, responseBody, errorID and errors

func NewIdempotenceErrorVerbose

func NewIdempotenceErrorVerbose(idempotenceKey string, idempotenceRequestTimestamp *int64, message string, statusCode int, responseBody, errorID string, errors []errors.APIError) (*IdempotenceError, error)

NewIdempotenceErrorVerbose creates an IdempotenceError with the given idempotenceKey, idempotenceRequestTimestamp, message, statusCode, responseBody, errorID and errors

func (*IdempotenceError) Error

func (ie *IdempotenceError) Error() string

Error implements the Error interface

func (*IdempotenceError) ErrorID

func (ie *IdempotenceError) ErrorID() string

ErrorID returns the error id

func (*IdempotenceError) Errors

func (ie *IdempotenceError) Errors() []errors.APIError

Errors returns a slice of underlying errors

func (*IdempotenceError) IdempotenceKey

func (ie *IdempotenceError) IdempotenceKey() string

IdempotenceKey returns the idempotence key used

func (*IdempotenceError) IdempotenceRequestTimestamp

func (ie *IdempotenceError) IdempotenceRequestTimestamp() *int64

IdempotenceRequestTimestamp returns the timestamp of the request

func (*IdempotenceError) Message

func (ie *IdempotenceError) Message() string

Message returns the error message

func (*IdempotenceError) ResponseBody

func (ie *IdempotenceError) ResponseBody() string

ResponseBody returns the response body

func (*IdempotenceError) StatusCode

func (ie *IdempotenceError) StatusCode() int

StatusCode returns the status code

func (*IdempotenceError) String

func (ie *IdempotenceError) String() string

String implements the Stringer interface Format: 'errorMessage; statusCode=; responseBody='

type NotFoundError

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

NotFoundError indicates an exception that occurs when the requested resource is not found. In normal usage of the SDK, this exception should not occur, however it is possible. For example when path parameters are set with invalid values.

func NewNotFoundErrorVerbose

func NewNotFoundErrorVerbose(errorMessage string, internalError error) (*NotFoundError, error)

NewNotFoundErrorVerbose creates a NotFoundError with the given errorMessage and internalError

func (*NotFoundError) Error

func (nfe *NotFoundError) Error() string

Error implements the Error interface

func (*NotFoundError) InternalError

func (nfe *NotFoundError) InternalError() error

InternalError returns the internal error encountered

func (*NotFoundError) String

func (nfe *NotFoundError) String() string

String implements the Stringer interface Format: 'errorMessage internalError'

type ReferenceError

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

ReferenceError represents an error response from the Ingenico ePayments platform when a non-existing or removed object is trying to be accessed.

func NewReferenceError

func NewReferenceError(statusCode int, responseBody, errorID string, errors []errors.APIError) (*ReferenceError, error)

NewReferenceError creates a ReferenceError with the given statusCode, responseBody, errorID and errors

func NewReferenceErrorVerbose

func NewReferenceErrorVerbose(message string, statusCode int, responseBody, errorID string, errors []errors.APIError) (*ReferenceError, error)

NewReferenceErrorVerbose creates a ReferenceError with the given message, statusCode, responseBody, errorID and errors

func (*ReferenceError) Error

func (re *ReferenceError) Error() string

Error implements the Error interface

func (*ReferenceError) ErrorID

func (re *ReferenceError) ErrorID() string

ErrorID returns the error id

func (*ReferenceError) Errors

func (re *ReferenceError) Errors() []errors.APIError

Errors returns a slice of underlying errors

func (*ReferenceError) Message

func (re *ReferenceError) Message() string

Message returns the error message

func (*ReferenceError) ResponseBody

func (re *ReferenceError) ResponseBody() string

ResponseBody returns the response body

func (*ReferenceError) StatusCode

func (re *ReferenceError) StatusCode() int

StatusCode returns the status code

func (*ReferenceError) String

func (re *ReferenceError) String() string

String implements the Stringer interface Format: 'errorMessage; statusCode=; responseBody='

type ResponseError

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

ResponseError is returned when a response was received from the Ingenico ePayments platform which indicates an error.

func NewResponseError

func NewResponseError(statusCode int, body string, headers []communication.Header) *ResponseError

NewResponseError creates a new ResponseError with the specified response

func (*ResponseError) Body

func (e *ResponseError) Body() string

Body gets the raw response body that was returned by the Ingenico ePayments platform.

func (*ResponseError) Error

func (e *ResponseError) Error() string

Error implements the Error interface

func (*ResponseError) GetHeader

func (e *ResponseError) GetHeader(headerName string) *communication.Header

GetHeader returns the header with the given name, or nil if there was no such header.

func (*ResponseError) Headers

func (e *ResponseError) Headers() []communication.Header

Headers gets the headers that were returned by the Ingenico ePayments platform.

func (*ResponseError) StatusCode

func (e *ResponseError) StatusCode() int

StatusCode gets the HTTP status code that was returned by the Ingenico ePayments platform.

func (*ResponseError) String

func (e *ResponseError) String() string

String implements the Stringer interface Format: 'errorMessage; statusCode=; responseBody='

type ValidateError

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

ValidateError represents an error response from the Ingenico ePayments platform when validation of requests failed.

func NewValidateError

func NewValidateError(statusCode int, responseBody, errorID string, errors []errors.APIError) (*ValidateError, error)

NewValidateError creates a ValidateError with the given statusCode, responseBody, errorID and errors

func NewValidateErrorVerbose

func NewValidateErrorVerbose(message string, statusCode int, responseBody, errorID string, errors []errors.APIError) (*ValidateError, error)

NewValidateErrorVerbose creates a ValidateError with the given message, statusCode, responseBody, errorID and errors

func (*ValidateError) Error

func (ve *ValidateError) Error() string

Error implements the Error interface

func (*ValidateError) ErrorID

func (ve *ValidateError) ErrorID() string

ErrorID returns the error id

func (*ValidateError) Errors

func (ve *ValidateError) Errors() []errors.APIError

Errors returns a slice of underlying errors

func (*ValidateError) Message

func (ve *ValidateError) Message() string

Message returns the error message

func (*ValidateError) ResponseBody

func (ve *ValidateError) ResponseBody() string

ResponseBody returns the response body

func (*ValidateError) StatusCode

func (ve *ValidateError) StatusCode() int

StatusCode returns the status code

func (*ValidateError) String

func (ve *ValidateError) String() string

String implements the Stringer interface Format: 'errorMessage; statusCode=; responseBody='

Jump to

Keyboard shortcuts

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