Documentation
¶
Index ¶
- type BillingAddress
- type Card
- type CardThirdParty
- type Customer
- type CustomerThirdParty
- type Repository
- func (r *Repository) CreateCustomer(ctx context.Context, item *Customer) (*Customer, error)
- func (r *Repository) CreateCustomerCard(ctx context.Context, item *Card) (*Card, error)
- func (r *Repository) CreateCustomerThirdParty(ctx context.Context, item *CustomerThirdParty) (*CustomerThirdParty, error)
- func (r *Repository) DeleteCustomer(ctx context.Context, Id string) error
- func (r *Repository) DeleteCustomerCard(ctx context.Context, id string) error
- func (r *Repository) DeleteCustomerThirdParty(ctx context.Context, customerId string) error
- func (r *Repository) GetCustomer(ctx context.Context, Id string, merchantId string) (*Customer, error)
- func (r *Repository) GetCustomerByMobile(ctx context.Context, mobile string, merchantId string) (*Customer, error)
- func (r *Repository) GetCustomerCard(ctx context.Context, cardId string) (*Card, error)
- func (r *Repository) GetCustomerCardList(ctx context.Context, customerId string, sourceType string, merchantId string, ...) ([]*Card, error)
- func (r *Repository) GetCustomerList(ctx context.Context, merchantId string) ([]*Customer, error)
- func (r *Repository) GetCustomerThirdParty(ctx context.Context, customerId string) (*CustomerThirdParty, error)
- func (r *Repository) UpdateCustomer(ctx context.Context, item *Customer) (*Customer, error)
- func (r *Repository) UpdateCustomerCard(ctx context.Context, customerId string, cardId string, isDefault bool) (*Card, error)
- func (r *Repository) UpdateCustomerThirdParty(ctx context.Context, item *CustomerThirdParty) (*CustomerThirdParty, error)
- type Service
- func (s *Service) CreateCustomer(ctx context.Context, realmId string, appzId string, item *Customer) (*Customer, error)
- func (s *Service) CreateCustomerSquareCard(ctx context.Context, customerId string, thirdPartyCardId string, ...) (*Card, error)
- func (s *Service) CreateCustomerStripeCard(ctx context.Context, customerId string, thirdPartyCardId string, ...) (*Card, error)
- func (s *Service) DeleteCustomer(ctx context.Context, id string) error
- func (s *Service) DeleteCustomerCard(ctx context.Context, id string) error
- func (s *Service) GetCustomer(ctx context.Context, id string, merchantId string) (*Customer, error)
- func (s *Service) GetCustomerByMobile(ctx context.Context, mobile string, merchantId string) (*Customer, error)
- func (s *Service) GetCustomerCard(ctx context.Context, id string) (*Card, error)
- func (s *Service) GetCustomerCardList(ctx context.Context, customerId string, cardType string, mechantId string, ...) ([]*Card, error)
- func (s *Service) GetCustomerList(ctx context.Context, merchantID string) ([]*Customer, error)
- func (s *Service) UpdateCustomer(ctx context.Context, item *Customer) (*Customer, error)
- func (s *Service) UpdateCustomerCard(ctx context.Context, customerId string, cardId string, isDefault bool, ...) (*Card, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BillingAddress ¶ added in v1.0.2
type Card ¶
type Card struct { Id string `json:"id"` CustomerId string `json:"customer_id"` MerchantID string `json:"merchant_id"` LocationId string `json:"location_id"` Type string `json:"type"` ThirdPartyCardId string `json:"third_party_card_id,omitempty"` BillingAddress *BillingAddress `json:"billing_address"` CardBrand string `json:"card_brand"` ExpMonth int64 `json:"exp_month"` ExpYear int64 `json:"exp_year"` Last4 string `json:"last_4"` IsDefault bool `json:"is_default"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type CardThirdParty ¶
type Customer ¶
type Customer struct { Id string `json:"id"` MerchantId string `json:"merchant_id"` Mobile string `json:"mobile"` Email string `json:"email"` FirstName string `json:"first_name"` LastName string `json:"last_name"` DisplayName string `json:"display_name"` Gender string `json:"gender"` Avatar string `json:"avatar"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type CustomerThirdParty ¶
type Repository ¶
Repository is the data access object for simple
func (*Repository) CreateCustomer ¶
func (*Repository) CreateCustomerCard ¶
func (*Repository) CreateCustomerThirdParty ¶
func (r *Repository) CreateCustomerThirdParty(ctx context.Context, item *CustomerThirdParty) (*CustomerThirdParty, error)
func (*Repository) DeleteCustomer ¶
func (r *Repository) DeleteCustomer(ctx context.Context, Id string) error
func (*Repository) DeleteCustomerCard ¶
func (r *Repository) DeleteCustomerCard(ctx context.Context, id string) error
func (*Repository) DeleteCustomerThirdParty ¶
func (r *Repository) DeleteCustomerThirdParty(ctx context.Context, customerId string) error
func (*Repository) GetCustomer ¶
func (*Repository) GetCustomerByMobile ¶ added in v1.0.2
func (*Repository) GetCustomerCard ¶
func (*Repository) GetCustomerCardList ¶
func (*Repository) GetCustomerList ¶
func (*Repository) GetCustomerThirdParty ¶
func (r *Repository) GetCustomerThirdParty(ctx context.Context, customerId string) (*CustomerThirdParty, error)
func (*Repository) UpdateCustomer ¶
func (*Repository) UpdateCustomerCard ¶
func (*Repository) UpdateCustomerThirdParty ¶
func (r *Repository) UpdateCustomerThirdParty(ctx context.Context, item *CustomerThirdParty) (*CustomerThirdParty, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the simple service
func (*Service) CreateCustomer ¶
func (s *Service) CreateCustomer(ctx context.Context, realmId string, appzId string, item *Customer) (*Customer, error)
CreateCustomer creates a new customer
func (*Service) CreateCustomerSquareCard ¶ added in v1.0.2
func (s *Service) CreateCustomerSquareCard(ctx context.Context, customerId string, thirdPartyCardId string, postalCode string, locationId string, merchantId string) (*Card, error)
CreateCustomerCard create a customer card
func (*Service) CreateCustomerStripeCard ¶ added in v1.0.2
func (s *Service) CreateCustomerStripeCard(ctx context.Context, customerId string, thirdPartyCardId string, locationId string, merchantId string, stripeAccountId string) (*Card, error)
CreateCustomerCard create a customer card
func (*Service) DeleteCustomer ¶
DeleteCustomer delete a customer by MerchantID and Id
func (*Service) DeleteCustomerCard ¶
DeleteCustomerCard delete a customer card by id
func (*Service) GetCustomer ¶
GetCustomer finds a customer by MerchantID and Id
func (*Service) GetCustomerByMobile ¶ added in v1.0.2
func (s *Service) GetCustomerByMobile(ctx context.Context, mobile string, merchantId string) (*Customer, error)
GetCustomer finds a customer by mobile
func (*Service) GetCustomerCard ¶
GetCustomerCard get a customer card by id
func (*Service) GetCustomerCardList ¶
func (s *Service) GetCustomerCardList(ctx context.Context, customerId string, cardType string, mechantId string, locationId string) ([]*Card, error)
GetCustomerCardList get customer card list by customer id
func (*Service) GetCustomerList ¶
GetCustomer finds a customer by MerchantID
func (*Service) UpdateCustomer ¶
UpdateCustomer update a customer by MerchantID and Id
Click to show internal directories.
Click to hide internal directories.