Make IAP Purchases In-Game
Prerequisites
Initiate Purchase In-Game
CSteamID steamUser = SteamUser.GetSteamID();
string steamLanguage = SteamApps.GetCurrentGameLanguage();
LootLockerSDKManager.BeginSteamPurchaseRedemption(
steamId: steamUser.ToString(),
currency: "USD",
language: steamLanguage,
catalogItemId: "01HRCA5QQBV9P0A57RFK9J073T",
onComplete: (response) =>
{
if (response.success)
{
Debug.Log("Steam purchase started. Entitlement ID: " + response.entitlement_id);
entitlementId = response.entitlement_id;
// Begin polling for purchase status
StartCoroutine(PollSteamPurchaseStatus(entitlementId));
}
else
{
Debug.LogError("Failed to start purchase: " + response.errorData.message);
}
}
);Conclusion
Last updated
Was this helpful?




