Documentation ¶
Index ¶
- type BillingAddressForm
- type CartAppliedDiscounts
- type CartAppliedDiscountsResolver
- type CartSummary
- func (cs *CartSummary) Discounts() *CartAppliedDiscounts
- func (cs *CartSummary) HasAppliedDiscounts() bool
- func (cs CartSummary) SumAppliedDiscounts() *domain.Price
- func (cs CartSummary) SumAppliedGiftCards() *domain.Price
- func (cs CartSummary) SumGrandTotalWithGiftCards() *domain.Price
- func (cs CartSummary) SumPaymentSelectionCartSplitValueAmountByMethods(methods []string) *domain.Price
- func (cs CartSummary) SumTaxes() *Taxes
- func (cs *CartSummary) SumTotalDiscountWithGiftCardsAmount() domain.Price
- type DecoratedCart
- func (dc DecoratedCart) Cart() cart.Cart
- func (dc *DecoratedCart) CartSummary() CartSummary
- func (dc DecoratedCart) DecoratedDeliveries() []DecoratedDelivery
- func (dc *DecoratedCart) GetAllPaymentRequiredItems() PricedItems
- func (dc *DecoratedCart) GetDecoratedDeliveryByCode(deliveryCode string) *DecoratedDelivery
- type DecoratedCartItem
- type DecoratedDelivery
- type DeliveryAddressForm
- type DeliveryShippingOption
- type FieldError
- type PaymentSelectionSplit
- type PricedCartItem
- type PricedItems
- type PricedShippingItem
- type PricedTotalItem
- type SelectedPaymentResult
- type Taxes
- type ValidationInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BillingAddressForm ¶
type BillingAddressForm struct { FormData forms.AddressForm Processed bool ValidationInfo ValidationInfo }
BillingAddressForm is the GraphQL representation of the billing form
type CartAppliedDiscounts ¶ added in v3.3.0
type CartAppliedDiscounts struct {
// contains filtered or unexported fields
}
CartAppliedDiscounts DTO for cart.AppliedDiscounts
func (*CartAppliedDiscounts) ByCampaignCode ¶ added in v3.3.0
func (d *CartAppliedDiscounts) ByCampaignCode(campaignCode string) *CartAppliedDiscounts
ByCampaignCode getter and wrapper
func (*CartAppliedDiscounts) ByType ¶ added in v3.3.0
func (d *CartAppliedDiscounts) ByType(filterType string) *CartAppliedDiscounts
ByType getter and wrapper
func (*CartAppliedDiscounts) Items ¶ added in v3.3.0
func (d *CartAppliedDiscounts) Items() []cart.AppliedDiscount
Items getter
type CartAppliedDiscountsResolver ¶ added in v3.3.0
type CartAppliedDiscountsResolver struct{}
CartAppliedDiscountsResolver resolves discounts for items
func (*CartAppliedDiscountsResolver) ForItem ¶ added in v3.3.0
func (*CartAppliedDiscountsResolver) ForItem(ctx context.Context, item *cart.Item) (*CartAppliedDiscounts, error)
ForItem resolves for cart Items
func (*CartAppliedDiscountsResolver) ForShippingItem ¶ added in v3.3.0
func (*CartAppliedDiscountsResolver) ForShippingItem(ctx context.Context, item *cart.ShippingItem) (*CartAppliedDiscounts, error)
ForShippingItem resolves for shipping Items
type CartSummary ¶ added in v3.0.1
type CartSummary struct {
// contains filtered or unexported fields
}
CartSummary – provides custom graphql interface methods
func (*CartSummary) Discounts ¶ added in v3.0.1
func (cs *CartSummary) Discounts() *CartAppliedDiscounts
Discounts collects up discounts of cart based on its deliveries All discounts with the same campaign code are aggregated and returned as one with a summed price
func (*CartSummary) HasAppliedDiscounts ¶ added in v3.0.1
func (cs *CartSummary) HasAppliedDiscounts() bool
HasAppliedDiscounts check whether there are any discounts currently applied to the cart
func (CartSummary) SumAppliedDiscounts ¶ added in v3.0.1
func (cs CartSummary) SumAppliedDiscounts() *domain.Price
SumAppliedDiscounts – returns the sum of the applied values of the AppliedDiscounts
func (CartSummary) SumAppliedGiftCards ¶ added in v3.0.1
func (cs CartSummary) SumAppliedGiftCards() *domain.Price
SumAppliedGiftCards – sums applied gift cards
func (CartSummary) SumGrandTotalWithGiftCards ¶ added in v3.0.1
func (cs CartSummary) SumGrandTotalWithGiftCards() *domain.Price
SumGrandTotalWithGiftCards – sums grand total with gift cards
func (CartSummary) SumPaymentSelectionCartSplitValueAmountByMethods ¶ added in v3.3.0
func (cs CartSummary) SumPaymentSelectionCartSplitValueAmountByMethods(methods []string) *domain.Price
SumPaymentSelectionCartSplitValueAmountByMethods – sum
func (CartSummary) SumTaxes ¶ added in v3.0.1
func (cs CartSummary) SumTaxes() *Taxes
SumTaxes – sums taxes
func (*CartSummary) SumTotalDiscountWithGiftCardsAmount ¶ added in v3.0.1
func (cs *CartSummary) SumTotalDiscountWithGiftCardsAmount() domain.Price
SumTotalDiscountWithGiftCardsAmount – returns sum price of total discounts with applied gift cards
type DecoratedCart ¶ added in v3.0.1
type DecoratedCart struct {
// contains filtered or unexported fields
}
DecoratedCart – provides custom graphql interface methods
func NewDecoratedCart ¶ added in v3.0.1
func NewDecoratedCart(dc *decorator.DecoratedCart) *DecoratedCart
NewDecoratedCart – factory method
func (DecoratedCart) Cart ¶ added in v3.0.1
func (dc DecoratedCart) Cart() cart.Cart
Cart – provides the cart
func (*DecoratedCart) CartSummary ¶ added in v3.0.1
func (dc *DecoratedCart) CartSummary() CartSummary
CartSummary – returns cart summary
func (DecoratedCart) DecoratedDeliveries ¶ added in v3.0.1
func (dc DecoratedCart) DecoratedDeliveries() []DecoratedDelivery
DecoratedDeliveries – returns decorated deliveries
func (*DecoratedCart) GetAllPaymentRequiredItems ¶ added in v3.0.1
func (dc *DecoratedCart) GetAllPaymentRequiredItems() PricedItems
GetAllPaymentRequiredItems – returns all payment required items
func (*DecoratedCart) GetDecoratedDeliveryByCode ¶ added in v3.0.1
func (dc *DecoratedCart) GetDecoratedDeliveryByCode(deliveryCode string) *DecoratedDelivery
GetDecoratedDeliveryByCode – returns decorated delivery filtered by code
type DecoratedCartItem ¶ added in v3.4.0
type DecoratedCartItem struct { Item cart.Item Product graphqlProductDto.Product }
DecoratedCartItem Decorates a CartItem with its Product
type DecoratedDelivery ¶ added in v3.4.0
type DecoratedDelivery struct { Delivery cart.Delivery DecoratedItems []DecoratedCartItem }
DecoratedDelivery Decorates a CartItem with its Product
type DeliveryAddressForm ¶ added in v3.3.0
type DeliveryAddressForm struct { FormData forms.AddressForm Processed bool ValidationInfo ValidationInfo UseBillingAddress bool DeliveryCode string Method string Carrier string DesiredTime time.Time }
DeliveryAddressForm is the GraphQL representation of the delivery form
type DeliveryShippingOption ¶ added in v3.3.0
DeliveryShippingOption used to update shipping method/carrier for a specific delivery
type FieldError ¶
type FieldError struct { // MessageKey - a key of the error message. Often used to pass to translation func in the template MessageKey string // DefaultLabel - a speaking error label. OFten used to show to end user - in case no translation exists DefaultLabel string //FieldName FieldName string }
FieldError contains field related errors
type PaymentSelectionSplit ¶ added in v3.3.0
type PaymentSelectionSplit struct { Qualifier cart.SplitQualifier Charge domain.Charge }
PaymentSelectionSplit is a GraphQL specific representation of `cart.PaymentSplit`
type PricedCartItem ¶ added in v3.0.1
PricedCartItem – cart item with price
type PricedItems ¶ added in v3.0.1
type PricedItems struct {
// contains filtered or unexported fields
}
PricedItems – provides custom graphql interface methods
func (PricedItems) CartItems ¶ added in v3.0.1
func (pr PricedItems) CartItems() []PricedCartItem
CartItems – return all cart items
func (PricedItems) ShippingItems ¶ added in v3.0.1
func (pr PricedItems) ShippingItems() []PricedShippingItem
ShippingItems – return all shipping items
func (PricedItems) TotalItems ¶ added in v3.0.1
func (pr PricedItems) TotalItems() []PricedTotalItem
TotalItems – return all total items
type PricedShippingItem ¶ added in v3.0.1
PricedShippingItem – shipping item with price
type PricedTotalItem ¶ added in v3.0.1
PricedTotalItem – total item with price
type SelectedPaymentResult ¶
type SelectedPaymentResult struct { //Processed Processed bool //ValidationInfo ValidationInfo ValidationInfo }
SelectedPaymentResult represents the selected payment
type ValidationInfo ¶
type ValidationInfo struct { GeneralErrors []formDomain.Error FieldErrors []FieldError }
ValidationInfo contains form related validation information