지원 프로그램
home
슬기로운 데모생활
home

Check Purchase Status

태그

1. Call Product Purchase Status

Use StovePC.ConfirmPurchase to call product purchase status
// input parameters // Int64 transactionMasterNo : Unique transaction master number (obtained through the OnStartPurchase callback parameter StovePCPurchase.TransactionMasterNo) StovePCResult result = StovePC.ConfirmPurchase(TRANSACTION_MASTER_NO); if(result == StovePCResult.NoError) { // 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)
private void OnConfirmPurchase(StovePCPurchaseProduct[] products, bool status, string shopKey) { StringBuilder sb = new StringBuilder(); sb.AppendLine("OnConfirmPurchase"); sb.AppendFormat(" - products.Length : {0}" + Environment.NewLine, products.Length); for (int i = 0; i < products.Length; i++) { sb.AppendFormat(" - products[{0}].ProductId : {1}" + Environment.NewLine, i, products[i].ProductId.ToString()); sb.AppendFormat(" - products[{0}].CategoryId : {1}" + Environment.NewLine, i, products[i].CategoryId); sb.AppendFormat(" - products[{0}].TotalQuantity : {1}" + Environment.NewLine, i, products[i].TotalQuantity.ToString()); sb.AppendFormat(" - products[{0}].MemberQuantity : {1}" + Environment.NewLine, i, products[i].MemberQuantity.ToString()); sb.AppendFormat(" - products[{0}].GuidQuantity : {1}" + Environment.NewLine, i, products[i].GuidQuantity.ToString()); } sb.AppendFormat(" - status : {0}" + Environment.NewLine, status.ToString()); sb.AppendFormat(" - shopKey : {0}", shopKey); Debug.Log(sb.ToString()); }
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