Documentation ¶
Overview ¶
Package token allows to create and use tokens
Index ¶
- Constants
- func APICreateToken(context api.InterfaceApplicationContext) (interface{}, error)
- func APIDeleteToken(context api.InterfaceApplicationContext) (interface{}, error)
- func APIListVisitorCards(context api.InterfaceApplicationContext) (interface{}, error)
- func APISetDefaultToken(context api.InterfaceApplicationContext) (interface{}, error)
- type DefaultVisitorCard
- func (it *DefaultVisitorCard) Delete() error
- func (it *DefaultVisitorCard) FromHashMap(input map[string]interface{}) error
- func (it *DefaultVisitorCard) Get(attribute string) interface{}
- func (it *DefaultVisitorCard) GetAttributesInfo() []models.StructAttributeInfo
- func (it *DefaultVisitorCard) GetCustomerID() string
- func (it *DefaultVisitorCard) GetExpirationDate() string
- func (it *DefaultVisitorCard) GetHolderName() string
- func (it *DefaultVisitorCard) GetID() string
- func (it *DefaultVisitorCard) GetImplementationName() string
- func (it *DefaultVisitorCard) GetModelName() string
- func (it *DefaultVisitorCard) GetNumber() string
- func (it *DefaultVisitorCard) GetPaymentMethodCode() string
- func (it *DefaultVisitorCard) GetToken() string
- func (it *DefaultVisitorCard) GetType() string
- func (it *DefaultVisitorCard) GetVisitorID() string
- func (it *DefaultVisitorCard) IsExpired() bool
- func (it *DefaultVisitorCard) Load(loadID string) error
- func (it *DefaultVisitorCard) New() (models.InterfaceModel, error)
- func (it *DefaultVisitorCard) Save() error
- func (it *DefaultVisitorCard) Set(attribute string, value interface{}) error
- func (it *DefaultVisitorCard) SetID(NewID string) error
- func (it *DefaultVisitorCard) ToHashMap() map[string]interface{}
- type DefaultVisitorCardCollection
- func (it *DefaultVisitorCardCollection) GetDBCollection() db.InterfaceDBCollection
- func (it *DefaultVisitorCardCollection) GetImplementationName() string
- func (it *DefaultVisitorCardCollection) GetModelName() string
- func (it *DefaultVisitorCardCollection) List() ([]models.StructListItem, error)
- func (it *DefaultVisitorCardCollection) ListAddExtraAttribute(attribute string) error
- func (it *DefaultVisitorCardCollection) ListFilterAdd(Attribute string, Operator string, Value interface{}) error
- func (it *DefaultVisitorCardCollection) ListFilterReset() error
- func (it *DefaultVisitorCardCollection) ListLimit(offset int, limit int) error
- func (it *DefaultVisitorCardCollection) ListVisitorsCards() []visitor.InterfaceVisitorCard
- func (it *DefaultVisitorCardCollection) New() (models.InterfaceModel, error)
Constants ¶
const ( ConstCollectionNameVisitorToken = "visitor_token" ConstErrorModule = "visitor/token" ConstErrorLevel = env.ConstErrorLevelActor )
Package global constants
Variables ¶
This section is empty.
Functions ¶
func APICreateToken ¶
func APICreateToken(context api.InterfaceApplicationContext) (interface{}, error)
APICreateToken creates a request body for posting credit card info to payment system with 0 amount payment for obtaining token on this card and saving it for visitor
func APIDeleteToken ¶
func APIDeleteToken(context api.InterfaceApplicationContext) (interface{}, error)
APIDeleteToken deletes credit card token by provided token_id
func APIListVisitorCards ¶
func APIListVisitorCards(context api.InterfaceApplicationContext) (interface{}, error)
APIListVisitorCards return a list of existing tokens for visitor
func APISetDefaultToken ¶
func APISetDefaultToken(context api.InterfaceApplicationContext) (interface{}, error)
APISetDefaultToken set default credit card token by provided token_id
Types ¶
type DefaultVisitorCard ¶
type DefaultVisitorCard struct { Holder string Payment string Type string Number string ExpirationDate string ExpirationMonth int ExpirationYear int CreatedAt time.Time TokenUpdated time.Time // contains filtered or unexported fields }
DefaultVisitorCard is a default implementer of InterfaceVisitorCard
func (*DefaultVisitorCard) Delete ¶
func (it *DefaultVisitorCard) Delete() error
Delete will remove the Visitor Token from the database
func (*DefaultVisitorCard) FromHashMap ¶
func (it *DefaultVisitorCard) FromHashMap(input map[string]interface{}) error
FromHashMap will take a map[string]interface and apply the attribute values to the Visitor Token
func (*DefaultVisitorCard) Get ¶
func (it *DefaultVisitorCard) Get(attribute string) interface{}
Get will return the requested attribute when provided a string representation of the attribute
func (*DefaultVisitorCard) GetAttributesInfo ¶
func (it *DefaultVisitorCard) GetAttributesInfo() []models.StructAttributeInfo
GetAttributesInfo will return a set of Vistor Token attributes in []models.StructAttributeInfo
func (*DefaultVisitorCard) GetCustomerID ¶
func (it *DefaultVisitorCard) GetCustomerID() string
GetCustomerID will return the customer_id field of the Visitor Card
func (*DefaultVisitorCard) GetExpirationDate ¶
func (it *DefaultVisitorCard) GetExpirationDate() string
GetExpirationDate will return the Expiration date of the Visitor Card
func (*DefaultVisitorCard) GetHolderName ¶
func (it *DefaultVisitorCard) GetHolderName() string
GetHolderName returns the Holder of the Credit Card
func (*DefaultVisitorCard) GetID ¶
func (it *DefaultVisitorCard) GetID() string
GetID returns the Default Visitor Token as a string
func (*DefaultVisitorCard) GetImplementationName ¶
func (it *DefaultVisitorCard) GetImplementationName() string
GetImplementationName returns the Implementation name
func (*DefaultVisitorCard) GetModelName ¶
func (it *DefaultVisitorCard) GetModelName() string
GetModelName returns the Visitor Address Model
func (*DefaultVisitorCard) GetNumber ¶
func (it *DefaultVisitorCard) GetNumber() string
GetNumber will return the Number attribute of the Visitor Card
func (*DefaultVisitorCard) GetPaymentMethodCode ¶
func (it *DefaultVisitorCard) GetPaymentMethodCode() string
GetPaymentMethodCode returns the Payment method code of the Visitor Card
func (*DefaultVisitorCard) GetToken ¶
func (it *DefaultVisitorCard) GetToken() string
GetToken will return the Token of the Visitor Card
func (*DefaultVisitorCard) GetType ¶
func (it *DefaultVisitorCard) GetType() string
GetType will return the Type of the Visitor Card
func (*DefaultVisitorCard) GetVisitorID ¶
func (it *DefaultVisitorCard) GetVisitorID() string
GetVisitorID returns the Visitor ID for the Visitor Card
func (*DefaultVisitorCard) IsExpired ¶
func (it *DefaultVisitorCard) IsExpired() bool
IsExpired will return Expired status of the Visitor Card
func (*DefaultVisitorCard) Load ¶
func (it *DefaultVisitorCard) Load(loadID string) error
Load will take Visitor Token ID and retrieve it from the database
func (*DefaultVisitorCard) New ¶
func (it *DefaultVisitorCard) New() (models.InterfaceModel, error)
New creates a new Visitor Address interface
func (*DefaultVisitorCard) Save ¶
func (it *DefaultVisitorCard) Save() error
Save will persist the Visitor Token to the database
func (*DefaultVisitorCard) Set ¶
func (it *DefaultVisitorCard) Set(attribute string, value interface{}) error
Set will set a Visitor Token attribute and requiring a name and a value
func (*DefaultVisitorCard) SetID ¶
func (it *DefaultVisitorCard) SetID(NewID string) error
SetID takes a string as input and sets the ID on the Visitor Token
func (*DefaultVisitorCard) ToHashMap ¶
func (it *DefaultVisitorCard) ToHashMap() map[string]interface{}
ToHashMap will return a set of Visitor Token attributes in a map[string]interface
type DefaultVisitorCardCollection ¶
type DefaultVisitorCardCollection struct {
// contains filtered or unexported fields
}
DefaultVisitorCardCollection is a default implementer of InterfaceVisitorCardCollection
func (*DefaultVisitorCardCollection) GetDBCollection ¶
func (it *DefaultVisitorCardCollection) GetDBCollection() db.InterfaceDBCollection
GetDBCollection returns the database collection of the Visitor Cards
func (*DefaultVisitorCardCollection) GetImplementationName ¶
func (it *DefaultVisitorCardCollection) GetImplementationName() string
GetImplementationName returns the Visitor Address implementation name
func (*DefaultVisitorCardCollection) GetModelName ¶
func (it *DefaultVisitorCardCollection) GetModelName() string
GetModelName returns the Visitor Address model
func (*DefaultVisitorCardCollection) List ¶
func (it *DefaultVisitorCardCollection) List() ([]models.StructListItem, error)
List enumerates items of VisitorAddress model type
func (*DefaultVisitorCardCollection) ListAddExtraAttribute ¶
func (it *DefaultVisitorCardCollection) ListAddExtraAttribute(attribute string) error
ListAddExtraAttribute allows to obtain additional attributes from List() function
func (*DefaultVisitorCardCollection) ListFilterAdd ¶
func (it *DefaultVisitorCardCollection) ListFilterAdd(Attribute string, Operator string, Value interface{}) error
ListFilterAdd adds selection filter to List() function
func (*DefaultVisitorCardCollection) ListFilterReset ¶
func (it *DefaultVisitorCardCollection) ListFilterReset() error
ListFilterReset clears presets made by ListFilterAdd() and ListAddExtraAttribute() functions
func (*DefaultVisitorCardCollection) ListLimit ¶
func (it *DefaultVisitorCardCollection) ListLimit(offset int, limit int) error
ListLimit sets select pagination
func (*DefaultVisitorCardCollection) ListVisitorsCards ¶
func (it *DefaultVisitorCardCollection) ListVisitorsCards() []visitor.InterfaceVisitorCard
ListVisitorsCards returns list of visitor model items for the Visitor Cards
func (*DefaultVisitorCardCollection) New ¶
func (it *DefaultVisitorCardCollection) New() (models.InterfaceModel, error)
New creates a new Visitor Address Collection