Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddPaymentMethodParams ¶ added in v0.15.0
AddPaymentMethodParams contains info needed to create new payment method
type Card ¶
type Card struct { Country string Brand string Name string ExpMonth int64 ExpYear int64 LastFour string }
Card contains credit card info
type CreateCustomerParams ¶
CreateCustomerParams contains info needed to create new customer
type CreateProjectInvoiceParams ¶
type CreateProjectInvoiceParams struct { ProjectName string CustomerID []byte PaymentMethodID []byte Storage float64 Egress float64 ObjectCount float64 StartDate time.Time EndDate time.Time }
CreateProjectInvoiceParams contains info needed to create project invoice
type Currency ¶
type Currency string
Currency is type for allowed currency
const ( // CurrencyUSD is USA default currency CurrencyUSD Currency = "usd" )
type CustomField ¶
CustomField represents custom field/value field
type Invoice ¶
type Invoice struct { ID []byte PaymentMethodID []byte Amount int64 Currency Currency LineItems []LineItem CustomFields []CustomField CreatedAt time.Time }
Invoice holds invoice information
type PaymentMethod ¶
type PaymentMethod struct { ID []byte CustomerID []byte Card Card IsDefault bool CreatedAt time.Time }
PaymentMethod contains payment method description. Credit cards are the only allowed payment methods so far
type Service ¶
type Service interface { CreateCustomer(ctx context.Context, params CreateCustomerParams) (*Customer, error) AddPaymentMethod(ctx context.Context, params AddPaymentMethodParams) (*PaymentMethod, error) GetCustomer(ctx context.Context, id []byte) (*Customer, error) GetCustomerDefaultPaymentMethod(ctx context.Context, customerID []byte) (*PaymentMethod, error) GetCustomerPaymentsMethods(ctx context.Context, customerID []byte) ([]PaymentMethod, error) GetPaymentMethod(ctx context.Context, id []byte) (*PaymentMethod, error) CreateProjectInvoice(ctx context.Context, params CreateProjectInvoiceParams) (*Invoice, error) GetInvoice(ctx context.Context, id []byte) (*Invoice, error) }
Service is interfaces that defines behavior for working with payments
Click to show internal directories.
Click to hide internal directories.