//////////
Search
Duplicate

Call Shop and Product Information

태그
1 more property

1. Call Shop Categories

The StovePC.FetchShopCategories function retrieves store category information for the game. Category information includes the CategoryID (and ParentCategoryID, a value in which categorizes your in-game items (hierachial or vertical). (click here to find more amount cateogry ID)
StovePCResult result = StovePC_FetchShopCategories(); if(result == StovePCResult::STOVE_PC_NO_ERROR) { // handle success }
C++
복사
When the StovePC_FetchShopCategories function is successfully processed, the OnFetchShopCategories callback is called.
The StovePCShopCategory structure passed to the callback contains meta information about the store category.
StovePCShopCategory.CategoryId : CategoryID
StovePCShopCategory.ParentCategoryId: Parent CategoryID
StovePCShopCategory.DisplayNo: Category Order
StovePCShopCategory.Name: Category Name
StovePCShopCategory.Depth: Category Depth (1 for the highest category)
void OnFetchShopCategories(const int size, StovePCShopCategory* categories) { printf("OnFetchShopCategories"); printf("shopCategory size = %d", size); for (int i = 0; i < size; i++, categories++) { printf(" - categories[%d].categoryId : %s", i, categories->categoryId); printf(" - categories[%d].parentCategoryId : %s", i, categories->parentCategoryId); printf(" - categories[%d].displayNo: %d", i, categories->displayNo); wprintf(L" - categories[%d].name: %s", i, categories->name); printf(" - categories[%d].depth : %d", i, categories->depth); } }
C++
복사
The OnError callback is called if an error occurs while running the StovePC_FetchShopProducts function. External errors can be checked through the ExternalError field of the StovePCError structure.
ExternalError
Description
500
Internal Server Error
999999
undefined error

2. Call Product Information

Call in-game product information using StovePC_FetchProducts function.
// input parameters // char* categoryId : Category identifier registered by Partners (when passing an empty string, search all categories) // bool isRefresh : If true, search Web API, if false, search PC SDK Cache StovePCResult result = StovePC_FetchProducts("CATEGORY_ID", IS_REFRESH); if(result == StovePCResult::STOVE_PC_NO_ERROR) { // handle success }
C++
복사
When StovePC_FetchProducts is successful, OnFetchProducts callback is called.
The StovePCProduct structure passed to the callback contains meta information about the product.
StovePCProduct.ProductId : ProductID
StovePCProduct.GameItemId : In-game item ID mapped to ProductID
StovePCProduct.Name : Product Name
StovePCProduct.Description : Product Description
StovePCProduct.Quantity: Quantity of Each Product
StovePCProduct.ProductTypeCode : Product Type Code (1: Game Product, 2: in-game product, 3: Package item)
StovePCProduct.CategoryId : CategoryID
StovePCProduct.CurrencyCode : Currency code
StovePCProduct.Price: Listed price of the Product (if the CurrencyCode is equal to "KRW", the decimal point is omitted; if it is different, it is indicated to the second decimal place)
StovePCProduct.SalePrice: Sales Price of the Product (if the CurrencyCode is equal to "KRW", the decimal point is omitted; if it is different, it is indicated to the second decimal place)
StovePCProduct.IsDiscount: Discount Availability
StovePCProduct.DiscountType : Discount Type (1: rate, 2: price)
StovePCProduct.DiscountTypeValue: Discount Value
StovePCProduct.DiscountBeginDate : Discount Start Date (UTC+0)
StovePCProduct.DiscountEndDate : Discount End Date (UTC+0)
StovePCProduct.TotalQuantity : Total Quantity of Product Sales
StovePCProduct.MemberQuantity : Purchase Quantity (by a user)
StovePCProduct.GuidQuantity: Purchase Quantity (purchase quantity of product purchase subject [CharacterNo/Guid/MemberNo])
StovePCProduct.ThumbnailUrl : Representative Product Image
void OnFetchProducts(const int size, StovePCProduct* products) { printf("OnFetchProducts"); printf("product size = %d", size); for (int i = 0; i < size; i++, products++) { printf(" - products[%d].productId: %lld", i, products->productId); printf(" - products[%d].gameItemId: %s", i, products->gameItemId); wprintf(L" - products[%d].name: %s", i, products->name); wprintf(L" - products[%d].description: %s", i, products->description); printf(" - products[%d].quantity: %d", i, products->quantity); printf(" - products[%d].productTypeCode: %hd", i, products->productTypeCode); printf(" - products[%d].categoryId: %s", i, products->categoryId); printf(" - products[%d].currencyCode: %s", i, products->currencyCode); if( strcmp(products->currencyCode, "KRW") == 0) { printf(" - products[%d].price: %.0lf", i, products->price); printf(" - products[%d].salePrice: %.0lf", i, products->salePrice); } else { printf(" - products[%d].price: %.2lf", i, products->price); printf(" - products[%d].salePrice: %.2lf", i, products->salePrice); } printf(" - products[%d].isDiscount: %s", i, products->isDiscount ? "true" : "false"); printf(" - products[%d].discountType: %hd", i, products->discountType); printf(" - products[%d].discountTypeValue: %d", i, products->discountTypeValue); printf(" - products[%d].discountBeginDate: %llu", i, products->discountBeginDate); printf(" - products[%d].discountEndDate: %llu", i, products->discountEndDate); printf(" - products[%d].totalQuantity: %d", i, products->totalQuantity); printf(" - products[%d].memberQuantity: %d", i, products->memberQuantity); printf(" - products[%d].thumbnailUrl: %s", i, products->thumbnailUrl); } }
C++
복사
If an error occurs while running the StovePC_FetchProducts function, the OnError callback is called.
Below are the possible errors you might encounter.
ExternalError
Description
500
Internal Server Error ⇒ Please contact STOVE Onboarding Manager
50001
Store does not exist, or is under maintenance ⇒ Please check STOVE Studio
50002
Product does not exist or is unavailable for sale ⇒ Please check product(s) status in STOVE Studio
999999
undefined error ⇒ Please contact STOVE Onboarding Manager