Documentation ¶
Index ¶
- type AccountDetails
- type CardDetails
- type DBRepository
- type DynamoDBClient
- type DynamoDBRepository
- func (r *DynamoDBRepository) CreateNewPayment(payment entities.Payment) error
- func (r *DynamoDBRepository) GetMerchantDetails(merchantID string) (entities.Merchant, error)
- func (r *DynamoDBRepository) GetPayment(merchantID, paymentID string) (entities.Payment, error)
- func (r *DynamoDBRepository) UpdatePayment(payment entities.Payment) error
- type MemoryRepository
- func (r *MemoryRepository) CreateNewPayment(payment entities.Payment) error
- func (r *MemoryRepository) GetMerchantDetails(merchantID string) (entities.Merchant, error)
- func (r *MemoryRepository) GetPayment(_, paymentID string) (entities.Payment, error)
- func (r *MemoryRepository) UpdatePayment(payment entities.Payment) error
- type MerchantItem
- type PaymentsItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountDetails ¶
type CardDetails ¶
type CardDetails struct { Name string `dynamodbav:"name"` Number string `dynamodbav:"number"` SecurityCode int `dynamodbav:"securityCode"` ExpirationDate string `dynamodbav:"expirationDate"` }
CardDetails NOTE: duplicating this model as it can differ from the business model in the future
type DBRepository ¶
type DynamoDBClient ¶
type DynamoDBClient interface { PutItem( ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options), ) (*dynamodb.PutItemOutput, error) UpdateItem( ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options), ) (*dynamodb.UpdateItemOutput, error) GetItem( ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options), ) (*dynamodb.GetItemOutput, error) }
type DynamoDBRepository ¶
type DynamoDBRepository struct {
// contains filtered or unexported fields
}
func NewDynamoDBRepository ¶
func (*DynamoDBRepository) CreateNewPayment ¶
func (r *DynamoDBRepository) CreateNewPayment(payment entities.Payment) error
func (*DynamoDBRepository) GetMerchantDetails ¶
func (r *DynamoDBRepository) GetMerchantDetails(merchantID string) (entities.Merchant, error)
func (*DynamoDBRepository) GetPayment ¶
func (r *DynamoDBRepository) GetPayment(merchantID, paymentID string) (entities.Payment, error)
func (*DynamoDBRepository) UpdatePayment ¶
func (r *DynamoDBRepository) UpdatePayment(payment entities.Payment) error
type MemoryRepository ¶
type MemoryRepository struct {
// contains filtered or unexported fields
}
func NewMemoryRepository ¶
func NewMemoryRepository() *MemoryRepository
func (*MemoryRepository) CreateNewPayment ¶
func (r *MemoryRepository) CreateNewPayment(payment entities.Payment) error
func (*MemoryRepository) GetMerchantDetails ¶
func (r *MemoryRepository) GetMerchantDetails(merchantID string) (entities.Merchant, error)
func (*MemoryRepository) GetPayment ¶
func (r *MemoryRepository) GetPayment(_, paymentID string) (entities.Payment, error)
func (*MemoryRepository) UpdatePayment ¶
func (r *MemoryRepository) UpdatePayment(payment entities.Payment) error
type MerchantItem ¶
type MerchantItem struct { PK string `dynamodbav:"PK"` // merchantID SK string `dynamodbav:"SK"` // MERCHANT AccountDetails AccountDetails }
type PaymentsItem ¶
type PaymentsItem struct { PK string `dynamodbav:"PK"` // merchantID SK string `dynamodbav:"SK"` // PAYMENTS#paymentID DATA string `dynamodbav:"DATA"` CustomerID string `dynamodbav:"CustomerID"` CardDetails CardDetails Timestamp int64 `dynamodbav:"Timestamp"` Refunded bool `dynamodbav:"Refunded"` RefundTimestamp int64 `dynamodbav:"RefundTimestamp"` }
func NewPaymentsItemFromPayment ¶
func NewPaymentsItemFromPayment(payment entities.Payment) PaymentsItem
Click to show internal directories.
Click to hide internal directories.