services

package
v0.0.0-...-61222dd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IShopemaaService

type IShopemaaService interface {
	GetName() string
	GetCurrency() string
	GetShop() *models.Shop
	ListProducts(currentPage, perPage int) ([]models.Product, error)
	ListProductsByCategory(categoryID string, currentPage, perPage int) ([]models.Product, error)
	SearchProducts(query string, currentPage, perPage int) ([]models.Product, error)
	AddToCart(productIDs []string) (string, error)
	CreateCart(productID string, quantity int) (*models.Cart, error)
	UpdateCart(cartID, productID string, quantity int) (*models.Cart, error)
	GetCart(cartID string) (*models.Cart, error)
	PlaceOrder(params *models.GuestCheckoutPlaceOrderParams) (string, error)
	OrderDetails(orderID string) (*models.OrderDetail, error)
	OrderDetailsForGuest(orderHash, email string) (*models.OrderDetail, error)
	ListShippingMethods() ([]models.ShippingMethod, error)
	ListPaymentMethods() ([]models.PaymentMethod, error)
	ListLocations() ([]models.Location, error)
	CheckDiscount(cartID, couponCode string, shippingMethodID *string) (int64, error)
	GeneratePaymentNonce(orderId, orderHash string, email string, appUrl string) (*models.PaymentNonce, error)
	ListCategories(currentPage, limit int) ([]models.Category, error)
}

func NewShopemaaService

func NewShopemaaService(cfg *cfg.Application) (IShopemaaService, error)

type IStateService

type IStateService interface {
	SetState(customerID string, state models.CustomerState) error
	GetState(customerID string) (models.CustomerState, error)
	SetData(customerID, key string, data interface{}) error
	GetData(customer, key string) (interface{}, error)
	SetIdentityByCartID(key, cartID, identity string) error
	GetIdentityByCartID(key, cartID string) (string, error)
}

func NewStateService

func NewStateService() IStateService

type ITwilioService

type ITwilioService interface {
	Send(to, from, payload string) error
	Api() *twilio2.RestClient
}

func NewTwilioService

func NewTwilioService(cfg *config.Application) ITwilioService

type ShopemaaService

type ShopemaaService struct {
	// contains filtered or unexported fields
}

func (*ShopemaaService) AddToCart

func (ss *ShopemaaService) AddToCart(productIDs []string) (string, error)

func (*ShopemaaService) CheckDiscount

func (ss *ShopemaaService) CheckDiscount(cartID, couponCode string, shippingMethodID *string) (int64, error)

func (*ShopemaaService) CreateCart

func (ss *ShopemaaService) CreateCart(productID string, quantity int) (*models.Cart, error)

func (*ShopemaaService) GeneratePaymentNonce

func (ss *ShopemaaService) GeneratePaymentNonce(orderId, orderHash string, email string, appUrl string) (*models.PaymentNonce, error)

func (*ShopemaaService) GetCart

func (ss *ShopemaaService) GetCart(cartID string) (*models.Cart, error)

func (*ShopemaaService) GetCurrency

func (ss *ShopemaaService) GetCurrency() string

func (*ShopemaaService) GetName

func (ss *ShopemaaService) GetName() string

func (*ShopemaaService) GetShop

func (ss *ShopemaaService) GetShop() *models.Shop

func (*ShopemaaService) ListCategories

func (ss *ShopemaaService) ListCategories(currentPage, limit int) ([]models.Category, error)

func (*ShopemaaService) ListLocations

func (ss *ShopemaaService) ListLocations() ([]models.Location, error)

func (*ShopemaaService) ListPaymentMethods

func (ss *ShopemaaService) ListPaymentMethods() ([]models.PaymentMethod, error)

func (*ShopemaaService) ListProducts

func (ss *ShopemaaService) ListProducts(currentPage, perPage int) ([]models.Product, error)

func (*ShopemaaService) ListProductsByCategory

func (ss *ShopemaaService) ListProductsByCategory(categoryID string, currentPage, perPage int) ([]models.Product, error)

func (*ShopemaaService) ListShippingMethods

func (ss *ShopemaaService) ListShippingMethods() ([]models.ShippingMethod, error)

func (*ShopemaaService) OrderDetails

func (ss *ShopemaaService) OrderDetails(orderID string) (*models.OrderDetail, error)

func (*ShopemaaService) OrderDetailsForGuest

func (ss *ShopemaaService) OrderDetailsForGuest(orderHash, email string) (*models.OrderDetail, error)

func (*ShopemaaService) PlaceOrder

func (*ShopemaaService) SearchProducts

func (ss *ShopemaaService) SearchProducts(query string, currentPage, perPage int) ([]models.Product, error)

func (*ShopemaaService) UpdateCart

func (ss *ShopemaaService) UpdateCart(cartID, productID string, quantity int) (*models.Cart, error)

type StateService

type StateService struct {
	// contains filtered or unexported fields
}

func (*StateService) GetData

func (s *StateService) GetData(customerID, key string) (interface{}, error)

func (*StateService) GetIdentityByCartID

func (s *StateService) GetIdentityByCartID(key, cartID string) (string, error)

func (*StateService) GetState

func (s *StateService) GetState(customerID string) (models.CustomerState, error)

func (*StateService) SetData

func (s *StateService) SetData(customerID, key string, data interface{}) error

func (*StateService) SetIdentityByCartID

func (s *StateService) SetIdentityByCartID(key, cartID, identity string) error

func (*StateService) SetState

func (s *StateService) SetState(customerID string, state models.CustomerState) error

type TwilioService

type TwilioService struct {
	// contains filtered or unexported fields
}

func (*TwilioService) Api

func (ts *TwilioService) Api() *twilio2.RestClient

func (*TwilioService) Send

func (ts *TwilioService) Send(to, from, payload string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL