Class: Portage::Ucp::Adapter Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/portage/ucp/adapter.rb

Overview

This class is abstract.

Subclass and override the methods for the capabilities you support. Unoverridden methods leave that capability out of the manifest.

Instance Method Summary collapse

Instance Method Details

#cancel_cart(cart_id:, idempotency_key:) ⇒ Portage::Ucp::Cart

Returns:



25
# File 'lib/portage/ucp/adapter.rb', line 25

def cancel_cart(cart_id:, idempotency_key:) = not_implemented

#cancel_checkout(checkout_id:, idempotency_key:) ⇒ Portage::Ucp::Checkout



41
# File 'lib/portage/ucp/adapter.rb', line 41

def cancel_checkout(checkout_id:, idempotency_key:) = not_implemented

#complete_checkout(checkout_id:, payment_token:, idempotency_key:) ⇒ Portage::Ucp::Checkout

Parameters:

  • payment_token (String)

    single-use token from a UCP payment handler / AP2 exchange — NEVER a raw PAN.

Returns:



39
40
# File 'lib/portage/ucp/adapter.rb', line 39

def complete_checkout(checkout_id:, payment_token:, idempotency_key:) = not_implemented
# @return [Portage::Ucp::Checkout]

#create_cart(line_items:, idempotency_key:) ⇒ Portage::Ucp::Cart

Returns:



21
22
# File 'lib/portage/ucp/adapter.rb', line 21

def create_cart(line_items:, idempotency_key:) = not_implemented
# @return [Portage::Ucp::Cart]

#create_checkout(line_items:, idempotency_key:) ⇒ Portage::Ucp::Checkout

--- Checkout (dev.ucp.shopping.checkout) ---



29
30
# File 'lib/portage/ucp/adapter.rb', line 29

def create_checkout(line_items:, idempotency_key:) = not_implemented
# @return [Portage::Ucp::Checkout]

#get_cart(cart_id:) ⇒ Portage::Ucp::Cart

--- Cart (dev.ucp.shopping.cart) --- Full-replacement semantics, matching UCP's real cart methods: create/ update take the complete desired line_items list, not a single item. line_items: is an array of request-shaped hashes (e.g. {product_id:, quantity:}) — the adapter looks up product data and builds the response's Item/Total/LineItem itself.

Returns:



19
20
# File 'lib/portage/ucp/adapter.rb', line 19

def get_cart(cart_id:) = not_implemented
# @return [Portage::Ucp::Cart]

#get_checkout(checkout_id:) ⇒ Portage::Ucp::Checkout



31
32
33
34
# File 'lib/portage/ucp/adapter.rb', line 31

def get_checkout(checkout_id:) = not_implemented
# Full-replacement, same as update_cart — line_items is required on
# checkout update per the real spec.
# @return [Portage::Ucp::Checkout]

#get_order(order_id:) ⇒ Portage::Ucp::Order?

--- Order (dev.ucp.shopping.order) ---

Returns:



45
# File 'lib/portage/ucp/adapter.rb', line 45

def get_order(order_id:) = not_implemented

#get_product(product_id:) ⇒ Portage::Ucp::Product?

Returns:



10
# File 'lib/portage/ucp/adapter.rb', line 10

def get_product(product_id:) = not_implemented

--- Identity Linking (dev.ucp.shopping.identity, OAuth 2.0) ---

Returns:



49
# File 'lib/portage/ucp/adapter.rb', line 49

def link_identity(oauth_token:) = not_implemented

#search_catalog(query:, limit:) ⇒ Array<Portage::Ucp::Product>

--- Catalog (dev.ucp.shopping.catalog) ---

Returns:



8
9
# File 'lib/portage/ucp/adapter.rb', line 8

def search_catalog(query:, limit:) = not_implemented
# @return [Portage::Ucp::Product, nil]

#update_cart(cart_id:, line_items:, idempotency_key:) ⇒ Portage::Ucp::Cart

Returns:



23
24
# File 'lib/portage/ucp/adapter.rb', line 23

def update_cart(cart_id:, line_items:, idempotency_key:) = not_implemented
# @return [Portage::Ucp::Cart]

#update_checkout(checkout_id:, line_items:, idempotency_key:) ⇒ Portage::Ucp::Checkout

Full-replacement, same as update_cart — line_items is required on checkout update per the real spec.



35
36
37
38
# File 'lib/portage/ucp/adapter.rb', line 35

def update_checkout(checkout_id:, line_items:, idempotency_key:) = not_implemented
# @param payment_token [String] single-use token from a UCP payment handler / AP2
#   exchange — NEVER a raw PAN.
# @return [Portage::Ucp::Checkout]