1. Call Product Purchase Status
Use StovePC_ConfirmPurchase to call product purchase status
// input parameters
// int64 transactionMasterNo : Transaction unique master number (obtained through the OnStartPurchase callback parameter StovePCPurchase.transactionMasterNo)
StovePCResult result = StovePC_ConfirmPurchase(TRANSACTION_MASTER_NO);
if(result == StovePCResult::STOVE_PC_NO_ERROR)
{
// handle success
}
C++
복사
When the StovePC_ConfirmPurchase function is successfully processed, the OnConfirmPurchase callback is called.
The StovePCPurchaseProduct structure passed to the callback contains meta information about the purchased product, and the callback status parameter delivers the purchase status of the product.
•
StovePCPurchaseProduct.TotalQuantity : Total Product sales quantity
•
StovePCPurchaseProduct.MemberQuantity : Member purchase quantity
•
StovePCPurchaseProduct.GuidQuantity: Guid purchase quantity (purchase quantity of product purchase subject [CharacterNo/Guid/MemberNo])
In the case of a game without a separate game server, if the purchase result is successful, the game may provide an item.
In the case of a game with a game server, the game server can receive a notification about the purchase and can provide the item at this time.
(To find more about purchase notification, click here)
void OnConfirmPurchase(const int size, StovePCPurchaseProduct* purchaseProducts, bool status, char* shopKey)
{
printf("OnConfirmPurchase");
printf(" - status : %s", status ? "true":"false");
printf(" - shopKey: %s", shopKey);
printf("-puchaseProduct size = %d", size);
for (int i = 0; i < size; i++, purchaseProducts++)
{
printf(" - purchaseProducts[%d].productId: %lld", i, purchaseProducts->productId);
printf(" - purchaseProducts[%d].categoryId: %s", i, purchaseProducts->categoryId);
printf(" - purchaseProducts[%d].totalQuantity: %d", i, purchaseProducts->totalQuantity);
printf(" - purchaseProducts[%d].memberQuantity: %d", i, purchaseProducts->memberQuantity);
printf(" - purchaseProducts[%d].guidQuantity: %d", i, purchaseProducts->guidQuantity);
}
}
C++
복사
Reference
In the above sample code, string shopKey in the function is the same value as YOUR_SHOP_KEY called by StovePC_IAPInit function.
You need to send YOUR_SHOP_KEY with shopKey as an input parameter.
If an error occurs while running the StovePC_ConfirmPurchase function, the OnError callback is called.
External errors can be checked through the ExternalError field of the StovePCError structure.
ExternalError | Description |
500 | Internal Server Error
⇒ Contact STOVE Onboarding Manager |
999999 | undefined error
⇒ Contact STOVE Onboarding Manager |