transactions

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedEventType = errors.New("unsupported event type")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(reader portfolio.ReaderInterface) Client

func (*Client) Get

func (c *Client) Get() ([]TransactionResponse, error)

type EventType added in v0.6.0

type EventType string
const (
	EventTypePaymentInbound                EventType = "PAYMENT_INBOUND"
	EventTypePaymentInboundSepaDirectDebit EventType = "PAYMENT_INBOUND_SEPA_DIRECT_DEBIT"
	EventTypePaymentOutbound               EventType = "PAYMENT_OUTBOUND"
	EventTypeOrderExecuted                 EventType = "ORDER_EXECUTED"
	EventTypeSavingsPlanExecuted           EventType = "SAVINGS_PLAN_EXECUTED"
	EventTypeInterestPayoutCreated         EventType = "INTEREST_PAYOUT_CREATED"
	EventTypeCredit                        EventType = "CREDIT"
	EventTypeBenefitsSavebackExecution     EventType = "benefits_saveback_execution"
	EventTypeBenefitsSpareChangeExecution  EventType = "benefits_spare_change_execution"
	EventTypeCardSuccessfulTransaction     EventType = "card_successful_transaction"
	EventTypeCardRefund                    EventType = "card_refund"
)

type EventTypeResolver added in v0.6.0

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

func NewEventTypeResolver added in v0.6.0

func NewEventTypeResolver(logger *log.Logger) EventTypeResolver

func (EventTypeResolver) Resolve added in v0.6.0

func (e EventTypeResolver) Resolve(response TransactionResponse) (EventType, error)

type EventTypeResolverInterface added in v0.6.0

type EventTypeResolverInterface interface {
	Resolve(response TransactionResponse) (EventType, error)
}

type Response

type Response struct {
	Type  string              `json:"type"`
	Items TransactionResponse `json:"data"`
}

type TransactionActionResponse

type TransactionActionResponse struct {
	Payload string `json:"payload"`
	Type    string `json:"type"`
}

func (TransactionActionResponse) HasTimelineDetail

func (a TransactionActionResponse) HasTimelineDetail() bool

type TransactionAmountResponse

type TransactionAmountResponse struct {
	Currency       string  `json:"currency"`
	FractionDigits uint8   `json:"fractionDigits"`
	Value          float32 `json:"value"`
}

type TransactionResponse

type TransactionResponse struct {
	Action    TransactionActionResponse `json:"action,omitempty"`
	Amount    TransactionAmountResponse `json:"amount"`
	Badge     string                    `json:"badge,omitempty"`
	EventType string                    `json:"eventType"`
	Icon      string                    `json:"icon"`
	ID        string                    `json:"id"`
	Status    string                    `json:"status"`
	SubAmount string                    `json:"subAmount,omitempty"`
	Subtitle  string                    `json:"subtitle,omitempty"`
	Timestamp string                    `json:"timestamp"`
	Title     string                    `json:"title"`
}

Jump to

Keyboard shortcuts

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