This guide describes the process of establishing the digital records and relationships necessary for a Unity game to interact with an In-App Purchase Store. The Unity IAP purchasing API is targeted.
In-App Purchase (IAP) is the process of transacting money for digital goods. A platform’s Store allows purchase of Products, representing digital goods. These Products have an Identifier, typically of string data type. Products have Types to represent their durability: subscription, consumable (capable of being rebought), and non-consumable (capable of being bought only once) are the most common.
CloudMoolah Developer Portal website: dev.cloudmoolah.com
UnityPurchasingEditor.TargetAndroidStore(AndroidStore.CloudMoolah);
Tip: Take special precautions to safely store your keystore file. The original keystore is always required to update a published application.
Register the application at the CloudMoolah Developer Portal website: http://dev.cloudmoolah.com/
Choose Add New App
Input game server information if defining an “Online” connected game.
プロパティー | 機能 |
---|---|
DataFeedURL_Stage | URL for redemption - test environment. |
DataFeedURL_Prod | URL for redemption - production environment. |
Testing Account | Account name for test environment. |
Testing Password | Password for test environment. |
Add in-app purchases for this application at the CloudMoolah Developer Portal (dev.cloudmoolah.com).
The CloudMoolah Game Store supports testing via enabling a “Developer mode” in the app before making purchases. This special build of the game provides a fake offline store which performs performs fake purchases. This does not incur real-world monetary costs related to the product, and allows you to test the app’s purchasing logic.
Modify the game’s Unity IAP integration, adding the following line after creating the ConfigurationBuilder instance, then build and run the app, testing its in-app purchasing logic:
builder.Configure<IMoolahConfiguration>().SetMode(CloudMoolahMode.AlwaysSucceed); // TESTING: auto-approves all transactions
You can also configure this to fail all transactions for testing error handling via the CloudMoolahMode.AlwaysFailed enumeration.
Note: When testing is complete, make sure you remove the SetMode line disable Developer mode by using the CloudMoolahMode.Production enumeration. This ensures users pay real-world money when the app is in use.