Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CardTokenizer ¶
type ChargeRequest ¶
type ChargeResponse ¶
type CurrencyConverter ¶
type FixedConverter ¶
type FraudChecker ¶
type GatewayClient ¶
type HttpGateway ¶
type HttpGateway struct {
}
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func (*MemoryStore) Save ¶
func (m *MemoryStore) Save(ctx context.Context, resp ChargeResponse) error
type PaymentFacade ¶
type PaymentFacade struct {
// contains filtered or unexported fields
}
func NewPaymentFacade ¶
func NewPaymentFacade(tokenizer CardTokenizer, fraud FraudChecker, conv CurrencyConverter, client GatewayClient, store TransactionStore) *PaymentFacade
func (*PaymentFacade) ChargeCard ¶
func (p *PaymentFacade) ChargeCard(ctx context.Context, req ChargeRequest) (ChargeResponse, error)
ChargeCard orchestrates tokenization, fraud check, conversion, gateway call, and persistence.
type SimpleFraud ¶
type SimpleFraud struct {
}
func (*SimpleFraud) Check ¶
func (st *SimpleFraud) Check(ctx context.Context, req ChargeRequest) (bool, string, error)
type SimpleTokenizer ¶
type SimpleTokenizer struct {
}
type TransactionStore ¶
type TransactionStore interface {
Save(ctx context.Context, resp ChargeResponse) error
}
Click to show internal directories.
Click to hide internal directories.