Documentation ¶
Index ¶
- func Create(router chi.Router, i interaction.Interactor)
- func MakeCreateTransactionEndpoint(i interaction.Interactor) common.Endpoint[CreateTransactionRequest, CreateTransactionResponse]
- func MakeGetTransactionsEndpoint(i interaction.Interactor) common.Endpoint[GetTransactionsRequest, GetTransactionsResponse]
- func MakeInitiatePaymentEndpoint(i interaction.Interactor) common.Endpoint[InitiatePaymentRequest, InitiatePaymentResponse]
- func MakeUpdateTransactionEndpoint(i interaction.Interactor) common.Endpoint[UpdateTransactionRequest, UpdateTransactionResponse]
- func ToTransactionEntity(tr Transaction) (*entities.Transaction, error)
- type Amount
- type CreateTransactionRequest
- type CreateTransactionResponse
- type GetTransactionsRequest
- type GetTransactionsResponse
- type InitiatePaymentRequest
- type InitiatePaymentResponse
- type PaymentProcessorInformation
- type StatusHistory
- type Transaction
- type TransactionInitiator
- type UpdateTransactionRequest
- type UpdateTransactionResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(router chi.Router, i interaction.Interactor)
func MakeCreateTransactionEndpoint ¶
func MakeCreateTransactionEndpoint(i interaction.Interactor) common.Endpoint[CreateTransactionRequest, CreateTransactionResponse]
func MakeGetTransactionsEndpoint ¶
func MakeGetTransactionsEndpoint(i interaction.Interactor) common.Endpoint[GetTransactionsRequest, GetTransactionsResponse]
func MakeInitiatePaymentEndpoint ¶
func MakeInitiatePaymentEndpoint(i interaction.Interactor) common.Endpoint[InitiatePaymentRequest, InitiatePaymentResponse]
func MakeUpdateTransactionEndpoint ¶
func MakeUpdateTransactionEndpoint(i interaction.Interactor) common.Endpoint[UpdateTransactionRequest, UpdateTransactionResponse]
func ToTransactionEntity ¶
func ToTransactionEntity(tr Transaction) (*entities.Transaction, error)
Types ¶
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 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