Documentation ¶
Index ¶
- type IRepository
- type IRequests
- type IWebhook
- type InternalTransactionDetails
- type InternalTransactionItem
- type Repository
- func (r Repository) GetDetails(TransactionId string) (transactionDetails TransactionDetails, userId string, transferList []transfer, ...)
- func (r Repository) GetList(userId string) (transactionPreviewList map[string]TransactionPreview, err error)
- func (r Repository) Register(userId string, email string, transactionId string, ...) error
- func (r Repository) StatusUpdate(transactionId string, conditions map[string]interface{}) error
- func (r Repository) StatusUpdateItems(transactionId string, itemId string, conditions map[string]interface{}) error
- type TransactionAddress
- type TransactionDetails
- type TransactionItem
- type TransactionPreview
- type TransactionRequests
- func (r TransactionRequests) GetDetails(userId string, transactionId string) (transactionDetails TransactionDetails, err error)
- func (r TransactionRequests) GetList(userId string) (transactionPreview []TransactionPreview, err error)
- func (r TransactionRequests) Purchase(userId string, email string) (clientSecret string, transactionId string, err error)
- func (r TransactionRequests) PurchaseRefund(stripeTransferId string, stripeTransactionId string) error
- type TransactionStatus
- type Webhook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IRepository ¶
type IRepository interface { GetList(UserId string) (map[string]TransactionPreview, error) GetDetails(transactionId string) (TransactionDetails, string, []transfer, error) Register(userId string, email string, transactionId string, internalCartList []cart.InternalCart) error StatusUpdate(transactionId string, conditions map[string]interface{}) error StatusUpdateItems(transactionId string, itemId string, conditions map[string]interface{}) error }
test complete
type IRequests ¶
type IRequests interface { GetList(userId string) ([]TransactionPreview, error) GetDetails(userId string, transactionId string) (TransactionDetails, error) Purchase(userId string, email string) (clientSecret string, transactionId string, err error) PurchaseRefund(stripeTransferId string, transactionId string) error }
type InternalTransactionDetails ¶
type InternalTransactionDetails struct { TransactionId string `gorm:"transaction_id"` UserAddress utils.Shipping `gorm:"embedded"` Items []InternalTransactionItem `gorm:"embedded"` }
type InternalTransactionItem ¶
type InternalTransactionItem struct { ItemId string `gorm:"item_id"` Price int `gorm:"price"` Name string `gorm:"name"` Quantity int `gorm:"quantity"` Description string `gorm:"description"` Tags string `gorm:"tags"` ManufacturerUserId string `gorm:"manufacturer_user_id"` ManufacturerName string `gorm:"manufacturer_name"` ManufacturerDescription string `gorm:"manufacturer_description"` TransferId string `gorm:"transfer_id"` Status string `gorm:"status"` }
type Repository ¶
type Repository struct { DB *gorm.DB UserRepository users.IRepository }
func (Repository) GetDetails ¶
func (r Repository) GetDetails(TransactionId string) (transactionDetails TransactionDetails, userId string, transferList []transfer, err error)
func (Repository) GetList ¶
func (r Repository) GetList(userId string) (transactionPreviewList map[string]TransactionPreview, err error)
func (Repository) Register ¶
func (r Repository) Register(userId string, email string, transactionId string, internalCartList []cart.InternalCart) error
func (Repository) StatusUpdate ¶
func (r Repository) StatusUpdate(transactionId string, conditions map[string]interface{}) error
func (Repository) StatusUpdateItems ¶
func (r Repository) StatusUpdateItems(transactionId string, itemId string, conditions map[string]interface{}) error
type TransactionAddress ¶
type TransactionDetails ¶
type TransactionDetails struct { TransactionId string `json:"transaction_id"` TrackingId string `json:"tracking_id"` Email string `json:"email"` TotalAmount int `json:"total_amount"` TotalPrice int `json:"total_price"` UserAddress TransactionAddress `json:"address"` Items []TransactionItem `json:"items"` TransactionAt time.Time `json:"transaction_at"` Status TransactionStatus `json:"status"` }
type TransactionItem ¶
type TransactionItem struct { ItemId string `json:"item_id"` Quantity int `json:"quantity"` Name string `json:"name"` Price int `json:"price"` TransferId string `json:"transfer_id"` Status string `json:"status"` ManufacturerUserId string `json:"manufacturer_user_id"` ManufacturerName string `gorm:"manufacturer_name"` }
type TransactionPreview ¶
type TransactionPreview struct { TransactionId string `json:"transaction_id"` Email string `json:"email"` Items []TransactionItem `json:"items"` TransactionAt time.Time `json:"transaction_at"` Status TransactionStatus `json:"status"` }
type TransactionRequests ¶
type TransactionRequests struct { TransactionRepository IRepository CartRepository cart.IRepository CartUtils cart.IUtils StripeRequests cash.IRequests StripeUtils cash.IUtils }
func (TransactionRequests) GetDetails ¶
func (r TransactionRequests) GetDetails(userId string, transactionId string) (transactionDetails TransactionDetails, err error)
func (TransactionRequests) GetList ¶
func (r TransactionRequests) GetList(userId string) (transactionPreview []TransactionPreview, err error)
func (TransactionRequests) PurchaseRefund ¶
func (r TransactionRequests) PurchaseRefund(stripeTransferId string, stripeTransactionId string) error
type TransactionStatus ¶
type TransactionStatus string
const ( Pending TransactionStatus = "Pending" Complete TransactionStatus = "Complete" Cancelled TransactionStatus = "Cancel" Fail TransactionStatus = "Fail" Refund TransactionStatus = "Refund" Paid TransactionStatus = "Paid" Shipped TransactionStatus = "Shipped" )
type Webhook ¶
type Webhook struct { StripeUtils cash.IUtils TransactionRepository IRepository ItemUpdater items.IUpdater App *firebase.App }
func (Webhook) PurchaseCanceled ¶
func (Webhook) PurchaseComplete ¶
func (r Webhook) PurchaseComplete(stripeTransactionId string) (transactionDetails TransactionDetails, err error)
func (Webhook) PurchaseFail ¶
Click to show internal directories.
Click to hide internal directories.