erede

package module
v0.0.0-...-092bcab Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteArrayToStruct

func ByteArrayToStruct[T any](b []byte) (*T, error)

func UpdateStructWithByteArray

func UpdateStructWithByteArray[T any](b []byte, c *T) error

Types

type ApiError

type ApiError struct {
	RequestDateTime *time.Time `json:"requestDateTime"`
	Code            string     `json:"returnCode"`
	Message         string     `json:"returnMessage"`
}

type Config

type Config struct {
	ApiUrl          string
	ApiTokenization string
	Filiation       string // PV
	Sandbox         bool
	Token           string
	Version         string
}

func (*Config) Init

func (c *Config) Init(filiation string, token string, version string, sandbox bool)

type ERedeClient

type ERedeClient struct {
	Config Config
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config Config, log hclog.Logger) *ERedeClient

func (*ERedeClient) AddHeader

func (c *ERedeClient) AddHeader(key, value string)

func (*ERedeClient) CancelTransaction

func (c *ERedeClient) CancelTransaction(tid string, transaction *models.Transaction) (*models.Refund, *Response)

func (*ERedeClient) CaptureTransaction

func (c *ERedeClient) CaptureTransaction(tid string, amount float64) (*models.TransactionResponse, *Response)

func (*ERedeClient) CreateTokenization

func (c *ERedeClient) CreateTokenization(tokenization *models.CreateTokenization) (*models.CreateTokenizationResponse, *Response)

func (*ERedeClient) CreateTransaction

func (c *ERedeClient) CreateTransaction(transaction *models.Transaction) (*models.TransactionResponse, *Response)

func (*ERedeClient) Delete

func (c *ERedeClient) Delete(url string) *Response

func (*ERedeClient) Get

func (c *ERedeClient) Get(url string) *Response

func (*ERedeClient) GetCancellationByRefundId

func (s *ERedeClient) GetCancellationByRefundId(tid string, refundId string) (*models.Refund, *Response)

func (*ERedeClient) GetCancellationsByTid

func (s *ERedeClient) GetCancellationsByTid(tid string) (*models.TransactionResponse, *Response)

func (*ERedeClient) GetCryptogramByTokenizationId

func (s *ERedeClient) GetCryptogramByTokenizationId(tokenizationId *uuid.UUID, subscription bool) (*models.QueryTokenizationCryptogramResponse, *Response)

func (*ERedeClient) GetTokenizationById

func (s *ERedeClient) GetTokenizationById(tokenizationId *uuid.UUID) (*models.QueryTokenizationResponse, *Response)

func (*ERedeClient) GetTransactionByReference

func (s *ERedeClient) GetTransactionByReference(reference string) (*models.TransactionResponse, *Response)

func (*ERedeClient) GetTransactionByTid

func (s *ERedeClient) GetTransactionByTid(tid string) (*models.TransactionResponse, *Response)

func (*ERedeClient) Header

func (c *ERedeClient) Header(key string) string

func (*ERedeClient) Post

func (c *ERedeClient) Post(url string, data any) *Response

func (*ERedeClient) Put

func (c *ERedeClient) Put(url string, data any) *Response

func (*ERedeClient) Send

func (c *ERedeClient) Send(method, url string, data any) *Response

type Response

type Response struct {
	Payload   []byte      `json:"payload"`
	Code      int         `json:"-"`
	Error     error       `json:"error"`
	Message   string      `json:"message"`
	ApiErrors []*ApiError `json:"ApiErrors"`
}

func (*Response) ApiErrorsStr

func (r *Response) ApiErrorsStr() string

func (*Response) Created

func (r *Response) Created() bool

func (*Response) HasApiErrors

func (r *Response) HasApiErrors() bool

func (*Response) Ok

func (r *Response) Ok() bool

func (*Response) OkCreated

func (r *Response) OkCreated() bool

func (*Response) UnmarshalJSON

func (r *Response) UnmarshalJSON(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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