Class ECommerceSystem

Inheritance Relationships

Base Type

Class Documentation

class ECommerceSystem : public csp::systems::SystemBase

Public facing system that allows interfacing with CSP’s concept of a ECommerce platform.

Offers methods for utilising Ecommerce through CSP

Public Functions

void GetProductInformation(const common::String &SpaceId, const common::String &ProductId, ProductInfoResultCallback Callback)

Get product information from a shopify store within a space.

Parameters
  • SpaceIdcsp::common::String : space id of product

  • ProductIdcsp::common::String : Product id of product

  • Callback – ProductInfoResultCallback : callback when asynchronous task finishes

void GetProductInfoCollectionByVariantIds(const common::String &SpaceId, const csp::common::Array<csp::common::String> &VariantIds, ProductInfoCollectionResultCallback Callback)

Get product information from a shopify store within a space, by providing an array of VariantIds.

Parameters
void GetCheckoutInformation(const common::String &SpaceId, const common::String &CartId, CheckoutInfoResultCallback Callback)

Get checkout information from a shopify store within a space.

Parameters
  • SpaceIdcsp::common::String : space id of the cart

  • CartIdcsp::common::String : id of Cart being checked out

  • Callback – NullResultCallback : callback when asynchronous task finishes

void CreateCart(const common::String &SpaceId, CartInfoResultCallback Callback)

Creates a cart for the current user in the given space.

Parameters
  • SpaceIdcsp::common::String : ID of the space to create the cart for.

  • Callback – CartInfoResultCallback : Callback when asynchronous task finishes

void GetCart(const common::String &SpaceId, const common::String &CartId, CartInfoResultCallback Callback)

Gets a cart for the current user in the given space.

Parameters
  • SpaceIdcsp::common::String : ID of the space the cart belongs to.

  • CartIdcsp::common::String : ID of the cart.

  • Callback – CartInfoResultCallback : Callback when asynchronous task finishes

void GetShopifyStores(const csp::common::Optional<bool> &IsActive, GetShopifyStoresResultCallback Callback)

Gets all shopify stores for the given user.

Parameters
  • IsActive – csp::common::Optional<bool> : optional bool for filtering returned stores by active status.

  • Callback – GetShopifyStoresResultCallback : Callback when asynchronous task finishes

void AddShopifyStore(const common::String &StoreName, const common::String &SpaceId, const bool IsEcommerceActive, const common::String &PrivateAccessToken, AddShopifyStoreResultCallback Callback)

Adds a Shopify store to a space.

Parameters
  • StoreNamecsp::common::String : The store name (URL) to the Shopify store. Do not include the ‘.shopify.com’ part of the url.

  • SpaceIdcsp::common::String : ID of the space to link the store to.

  • IsEcommerceActive – bool : Bool to set the ecommerce system status on creation.

  • PrivateAccessTokencsp::common::String : The access token for the shopify storefront.

  • Callback – AddShopifyStoreResultCallback : Callback when asynchronous task finishes

void SetECommerceActiveInSpace(const common::String &StoreName, const common::String &SpaceId, const bool IsEcommerceActive, SetECommerceActiveResultCallback Callback)

Sets a store to be enabled or disabled in a space.

Parameters
  • StoreNamecsp::common::String : The store name (URL) to the Shopify store. Do not include the ‘.shopify.com’ part of the url.

  • SpaceIdcsp::common::String : ID of the space the store links to.

  • IsEcommerceActive – bool : Bool to set the ecommerce system status to.

  • Callback – SetECommerceActiveResultCallback : Callback when asynchronous task finishes

void ValidateShopifyStore(const common::String &StoreName, const common::String &PrivateAccessToken, ValidateShopifyStoreResultCallback Callback)

Validates a shopify store given a store name and an access token.

Parameters
  • StoreNamecsp::common::String : The store name (URL) to the Shopify store. Do not include the ‘.shopify.com’ part of the url.

  • PrivateAccessTokencsp::common::String : The access token for the shopify storefront.

  • Callback – ValidateShopifyStoreResultCallback : Callback when asynchronous task finishes

void UpdateCartInformation(const CartInfo &CartInformation, CartInfoResultCallback Callback)

Update cart information from a shopify store within a space.

Parameters
  • CartInformationCartInfo : Updated Cart Object.

  • Callback – CartInfoResultCallback : Callback when asynchronous task finishes