Gamebase SDK for Unity 2.69.0
Toast Gamebase Platform
Loading...
Searching...
No Matches

◆ RequestActivatedPurchases() [2/2]

static void RequestActivatedPurchases ( GamebaseRequest::Purchase::PurchasableConfiguration configuration,
GamebaseCallback::GamebaseDelegate< List< GamebaseResponse::Purchase::PurchasableReceipt > > callback )
static

Request a list of payment products that are currently subscribed.

If there is a subscription purchased from another platform (such as iOS)

Since
Added 2.45.0.
Parameters
configurationSet query conditions.
callbackCallback pass to API result.

Example Usage :

public void RequestActivatedPurchasesSample(bool allStores)
{
var configuration = new GamebaseRequest.Purchase.PurchasableConfiguration
{
allStores = allStores
};
Gamebase.Purchase.RequestActivatedPurchases(configuration, (purchasableReceiptList, error) =>
{
if (Gamebase.IsSuccess(error) == true)
{
Debug.Log("RequestItemListPurchasable succeeded");
foreach (GamebaseResponse.Purchase.PurchasableReceipt purchasableReceipt in purchasableReceiptList)
{
var message = new StringBuilder();
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));
message.AppendLine(string.Format("marketItemId:{0}", purchasableReceipt.marketItemId));
Debug.Log(message);
}
}
else
{
// Check the error code and handle the error appropriately.
Debug.Log(string.Format("RequestItemListPurchasable failed. error is {0}", error));
}
});
}
static void RequestActivatedPurchases(GamebaseRequest.Purchase.PurchasableConfiguration configuration, GamebaseCallback.GamebaseDelegate< List< GamebaseResponse.Purchase.PurchasableReceipt > > callback)
Request a list of payment products that are currently subscribed.
Definition Gamebase.cs:2460
The Purchase class provides several APIs related to purchasing processes.
Definition Gamebase.cs:2040
static bool IsSuccess(GamebaseError error)
Return true if the GamebaseException object is null or the error code is zero.
Definition Gamebase.cs:57
The Gamebase class is core of Gamebase service.
Definition Gamebase.cs:11