Gamebase SDK for Unity 2.76.0 Toast Gamebase Platform

Loading...
Searching...
No Matches

## ◆ RequestItemListOfNotConsumed() [2/2]

static void RequestItemListOfNotConsumed | ( | GamebaseRequest.Purchase.PurchasableConfiguration | configuration,
|  | GamebaseCallback.GamebaseDelegate< List< GamebaseResponse.Purchase.PurchasableReceipt > > | callback )
| static

Request for a list of non-consumed items, which have not been normally consumed (delivered, or provided) after purchase.

In case of non-purchased items, ask the game server (item server) to proceed with item delivery (supply).

Since
  Added 2.45.0.

Parameters

  configuration | Set query conditions.
  callback | Callback pass to API result.

Example Usage :

public void RequestItemListOfNotConsumedSample(bool allStores)
{
var configuration = new GamebaseRequest.Purchase.PurchasableConfiguration
{
allStores = allStores
};
Gamebase.Purchase.RequestItemListOfNotConsumed(configuration, (purchasableReceiptList, error) =>
{
if (Gamebase.IsSuccess(error) == true)
{
Debug.Log("RequestItemListOfNotConsumed succeeded.");
foreach (GamebaseResponse.Purchase.PurchasableReceipt purchasableReceipt in purchasableReceiptList)
{
var message = new StringBuilder();
message.AppendLine("RequestPurchase succeeded.");
message.AppendLine(string.Format("itemSeq:{0}", purchasableReceipt.itemSeq));
message.AppendLine(string.Format("price:{0}", purchasableReceipt.price));
message.AppendLine(string.Format("currency:{0}", purchasableReceipt.currency));
// You will need paymentSeq and purchaseToken when calling the Consume API.
// Refer to the following document for the Consume API.
// http://docs.toast.com/en/Game/Gamebase/en/api-guide/#purchaseiap
message.AppendLine(string.Format("paymentSeq:{0}", purchasableReceipt.paymentSeq));
message.AppendLine(string.Format("purchaseToken:{0}", purchasableReceipt.purchaseToken));
Debug.Log(message);
// Calling the Consume API.
}
}
else
{
// Check the error code and handle the error appropriately.
Debug.Log(string.Format("RequestItemListOfNotConsumed failed. error is {0}", error));
}
});
}
Toast.Gamebase.Gamebase.Purchase.RequestItemListOfNotConsumed
static void RequestItemListOfNotConsumed(GamebaseRequest.Purchase.PurchasableConfiguration configuration, GamebaseCallback.GamebaseDelegate< List< GamebaseResponse.Purchase.PurchasableReceipt > > callback)
Request for a list of non-consumed items, which have not been normally consumed (delivered,...
Definition Gamebase.cs:2275
Toast.Gamebase.Gamebase.Purchase
The Purchase class provides several APIs related to purchasing processes.
Definition Gamebase.cs:2069
Toast.Gamebase.Gamebase.IsSuccess
static bool IsSuccess(GamebaseError error)
Return true if the GamebaseException object is null or the error code is zero.
Definition Gamebase.cs:57
Toast.Gamebase.Gamebase
The Gamebase class is core of Gamebase service.
Definition Gamebase.cs:11