v1transactions

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(router chi.Router, i interaction.Interactor)

func ToTransactionEntity

func ToTransactionEntity(tr Transaction) (*entities.Transaction, error)

Types

type Amount

type Amount struct {
	// Currency is the ISO 4217 currency code
	Currency string `json:"currency"`
	// The value contained for the given currency in the smallest possible definition
	GrossCent int64 `json:"gross_cent"`
	// The defined vat rate
	VatRate float64 `json:"vat_rate"`
}

type CreateTransactionRequest

type CreateTransactionRequest struct {
	Transaction Transaction `json:"transaction"`
}

CreateTrasactionRequest contains all information to create a new transaction for a given debitor

type CreateTransactionResponse

type CreateTransactionResponse struct {
	Transaction Transaction `json:"transaction"`
}

CreateTransactionResponse contains the transaction, which was created through the request parameters

type GetTransactionsRequest

type GetTransactionsRequest struct {
	// description: The id of a debitor to filter by
	DebitorID int64
	// filter by transaction_identifier
	TransactionIdentifier string
	// filter by effective date (inclusive) lower bound
	EffectiveFrom time.Time
	// filter by effective date (exclusive) upper bound - this makes it easy to get everything in a given month
	EffectiveBefore time.Time
}

GetTransactionsRequest will contain all information that will be sent from the client during calling the GetTransactions endpoint

type GetTransactionsResponse

type GetTransactionsResponse struct {
	Payload []Transaction `json:"payload"`
}

GetTransactionsResponse contains a number of transactions depending on the search criteria provided in the `GetTransactionsRequest`

type InitiatePaymentRequest

type InitiatePaymentRequest struct {
	TransactionInitiator TransactionInitiator
}

InitiatePaymentRequest is used for a convenience endpoint to create a payment transaction with the default values.

type InitiatePaymentResponse

type InitiatePaymentResponse struct {
	Transaction Transaction `json:"transaction"`
}

InitiatePaymentResponse contains the transaction, that was created through the request

type PaymentProcessorInformation

type PaymentProcessorInformation map[string]interface{}

type StatusHistory

type StatusHistory struct {
	Status     entities.TransactionStatus `json:"status"`
	Comment    string                     `json:"comment"`
	ChangedBy  string                     `json:"changed_by"`
	ChangeDate time.Time                  `json:"change_date"`
}

type Transaction

type Transaction struct {
	DebitorID             int64                       `json:"debitor_id"`
	TransactionIdentifier string                      `json:"transaction_identifier"`
	TransactionType       entities.TransactionType    `json:"transaction_type"`
	Method                entities.PaymentMethod      `json:"method"`
	Amount                Amount                      `json:"amount"`
	Comment               string                      `json:"comment"`
	Status                entities.TransactionStatus  `json:"status"`
	Info                  PaymentProcessorInformation `json:"payment_processor_information"`
	PaymentStartUrl       string                      `json:"payment_start_url"`
	EffectiveDate         string                      `json:"effective_date"`
	DueDate               string                      `json:"due_date,omitempty"`
	CreationDate          *time.Time                  `json:"creation_date,omitempty"`
	StatusHistory         []StatusHistory             `json:"status_history"`
}

func ToV1Transaction

func ToV1Transaction(tran entities.Transaction) Transaction

type TransactionInitiator

type TransactionInitiator struct {
	DebitorID int64                  `json:"debitor_id"`
	Method    entities.PaymentMethod `json:"method"`
}

type UpdateTransactionRequest

type UpdateTransactionRequest struct {
	Transaction Transaction `json:"transaction"`
}

UpdateTransactionRequest contains information to perform an update to a transaction. Based on the request permissions (JWT, API Token, Admin), the fields that may be altered may vary

type UpdateTransactionResponse

type UpdateTransactionResponse struct{}

UpdateTransactionResponse is am empty response as this endpoint yields no response

Jump to

Keyboard shortcuts

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