services

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceBehaviour

type ServiceBehaviour struct {
	// Settings service model
	models.Settings
}

ServiceBehaviour defines the structure for the service behaviour.

func NewServiceBehaviour

func NewServiceBehaviour(settings models.Settings) *ServiceBehaviour

This function creates a new instance of NewServiceBehaviour with default values for all fields.

func (*ServiceBehaviour) Delete

func (serviceBehaviour *ServiceBehaviour) Delete(url string, body interface{}) (interface{}, error)

Performs an HTTP DELETE request to the specified URL and parses the response into the provided body interface. The response body will be closed before the function returns. If an error occurs during the process, it will be returned.

The `url` parameter represents the URL to make the DELETE request to. The `body` parameter represents request body.

This function returns a response as an interface and an error if it occurred.

func (*ServiceBehaviour) Get

func (serviceBehaviour *ServiceBehaviour) Get(url string, body interface{}) (interface{}, error)

Performs an HTTP GET request to the specified URL and parses the response into the provided body interface. The response body will be closed before the function returns. If an error occurs during the process, it will be returned.

The `url` parameter represents the URL to make the GET request to. The `body` parameter represents request body.

This function returns a response as an interface and an error if it occurred.

func (*ServiceBehaviour) Post

func (serviceBehaviour *ServiceBehaviour) Post(url string, body *interface{}) (interface{}, error)

Performs an HTTP POST request to the specified URL and parses the response into the provided body interface. The response body will be closed before the function returns. If an error occurs during the process, it will be returned.

The `url` parameter represents the URL to make the POST request to. The `body` parameter represents request body.

This function returns a response as an interface and an error if it occurred.

func (*ServiceBehaviour) Put

func (serviceBehaviour *ServiceBehaviour) Put(url string, body *interface{}) (interface{}, error)

Performs an HTTP PUT request to the specified URL and parses the response into the provided body interface. The response body will be closed before the function returns. If an error occurs during the process, it will be returned.

The `url` parameter represents the URL to make the PUT request to. The `body` parameter represents request body.

This function returns a response as an interface and an error if it occurred.

type Tokenization

type Tokenization struct {

	// Anonymous field, to embed the Response struct (composition)
	*ServiceBehaviour
	// contains filtered or unexported fields
}

Tokenization provides a specific structure for a tokenization to be performed

func NewTokenization

func NewTokenization(settings models.Settings) *Tokenization

NewTokenization initializes and returns a new instance of the Tokenization model.

func (*Tokenization) DeleteCard

func (tokenization *Tokenization) DeleteCard(token string) (interface{}, error)

Delete credit/debit card metadata by token card identifier.

The `token` parameter is a unique key associated to a Card.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Tokenization) ShowCard

func (tokenization *Tokenization) ShowCard(token string) (interface{}, error)

Show credit/debit card metadata by token card identifier.

The `token` parameter is a unique key associated to a Card.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Tokenization) ShowCards

func (tokenization *Tokenization) ShowCards(tokens []string) (interface{}, error)

Show credit/debit cards metadata by tokens card identifier.

The `tokend` parameter are unique keys associated with cards.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Tokenization) UpdateCard

func (tokenization *Tokenization) UpdateCard(token string, card interface{}) (interface{}, error)

Update credit/debit card by token card identifier.

The `token` parameter is a unique key associated to a Card. The `card` parameter represents the card to be updated, and it must be an instance of the Tokenization struct.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Tokenization) VaultCard

func (tokenization *Tokenization) VaultCard(card interface{}) (interface{}, error)

Vault credit/debit card and obtain a token card identifier (T-* format).

The `card` parameter represents the card to be vaulted, and it must be an instance of the Tokenization struct.

This function returns a response as an interface. If an error occurs during the process it will be returned.

type Transaction

type Transaction struct {
	// Anonymous field, to embed the Response struct (composition)
	*ServiceBehaviour
}

Transaction provides a specific structure for a transaction to be performed

func NewTransaction

func NewTransaction(settings models.Settings) *Transaction

NewTransaction initializes and returns a new instance of the Transaction model.

func (*Transaction) DoAuth

func (service *Transaction) DoAuth(transaction interface{}) (interface{}, error)

Sends and process an AUTH transaction

The `transaction` parameter represents the transaction to be performed.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Transaction) DoCapture

func (service *Transaction) DoCapture(transaction interface{}) (interface{}, error)

Sends and process a CAPTURE transaction

The `transaction` parameter represents the transaction to be performed.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Transaction) DoSale

func (service *Transaction) DoSale(transaction interface{}) (interface{}, error)

Sends and process a SALE transaction

The `transaction` parameter represents the transaction to be performed.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Transaction) DoVoid

func (service *Transaction) DoVoid(transaction interface{}) (interface{}, error)

Sends and process a VOID transaction

The `transaction` parameter represents the transaction to be performed.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Transaction) GetStatus

func (service *Transaction) GetStatus(transaction interface{}) (interface{}, error)

Verifies a transaction status

The `transaction` parameter represents the transaction to be performed.

This function returns a response as an interface. If an error occurs during the process it will be returned.

func (*Transaction) VerifyPaymentHash

func (service *Transaction) VerifyPaymentHash(hash, orderId, secret string) bool

Verifies a payment hash and returns true if payment response has not been modified.

The `hash` parameter represents the hash that will be compared with the order hash. The `orderId` parameter represents the order hash to look up. The `secret` parameter is a key used to verify the payment hash.

This function returns a response as an interface. If an error occurs during the process it will be returned.

Jump to

Keyboard shortcuts

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