Make IAP Purchases In-Game
Prerequisites
Create a Stripe Checkout Session
LootLockerSDKManager.CreateStripeCheckoutSession(catalogItemId, (response) =>
{
if (response.success)
{
Debug.Log("Stripe session created. Link: " + response.checkout_link);
// Open the Stripe checkout page in the user's browser
Application.OpenURL(response.checkout_link);
// Show a "Purchase in Progress" UI overlay in your game
purchaseInProgressScreen.SetActive(true);
// Start polling for the status of this specific entitlement
StartCoroutine(CheckPurchaseStatusRoutine(response.entitlement_id));
}
else
{
Debug.LogError("Failed to create session: " + response.errorData.message);
}
});Open the Checkout Link
Check the Purchase Status
Handle purchase result
Handling Edge Cases
Conclusion
Last updated
Was this helpful?
