Module: Portage::Ucp::Capabilities

Defined in:
lib/portage/ucp/capabilities/cart.rb,
lib/portage/ucp/capabilities/order.rb,
lib/portage/ucp/capabilities/catalog.rb,
lib/portage/ucp/capabilities/checkout.rb,
lib/portage/ucp/capabilities/discount.rb,
lib/portage/ucp/capabilities/fulfillment.rb,
lib/portage/ucp/capabilities/identity_linking.rb

Constant Summary collapse

CART =
Portage::Ucp::Capability.new(
  name: "dev.ucp.shopping.cart",
  version: "1",
  actions: {
    "create_cart" => :create_cart,
    "get_cart" => :get_cart,
    "update_cart" => :update_cart,
    "cancel_cart" => :cancel_cart
  }
)
ORDER =
Portage::Ucp::Capability.new(
  name: "dev.ucp.shopping.order",
  version: "1",
  actions: {
    "get_order" => :get_order,
    "cancel_order" => :cancel_order,
    "request_return" => :request_return,
    "refund_order" => :refund_order
  }
)
CATALOG =
Portage::Ucp::Capability.new(
  name: "dev.ucp.shopping.catalog",
  version: "1",
  actions: { "search_catalog" => :search_catalog, "get_product" => :get_product }
)
CHECKOUT =
Portage::Ucp::Capability.new(
  name: "dev.ucp.shopping.checkout",
  version: "1",
  actions: {
    "create_checkout" => :create_checkout,
    "get_checkout" => :get_checkout,
    "update_checkout" => :update_checkout,
    "complete_checkout" => :complete_checkout,
    "cancel_checkout" => :cancel_checkout
  }
)
DISCOUNT =

schemas/shopping/discount.json — extends Cart/Checkout with a discounts field rather than adding actions of its own, so actions is empty and advertisement runs off Adapter#discount_codes_supported? instead (see Capability#advertised_for?).

Portage::Ucp::Capability.new(
  name: "dev.ucp.shopping.discount",
  version: "1",
  actions: {},
  predicate: :discount_codes_supported?
)
FULFILLMENT =

schemas/shopping/fulfillment.json — extends Checkout with a fulfillment field (shipping/pickup methods, groups, destinations) rather than adding actions of its own, same predicate-based advertisement as DISCOUNT above.

Portage::Ucp::Capability.new(
  name: "dev.ucp.shopping.fulfillment",
  version: "1",
  actions: {},
  predicate: :fulfillment_supported?
)
IDENTITY_LINKING =
Portage::Ucp::Capability.new(
  name: "dev.ucp.shopping.identity",
  version: "1",
  actions: { "link_identity" => :link_identity }
)
ALL =
[CATALOG, CART, CHECKOUT, ORDER, IDENTITY_LINKING, DISCOUNT, FULFILLMENT].freeze