Samsung In-App Purchase (IAP) supports your app IAP-integration and in-app item development testing of in-app item offering, purchase, and payment functionality before you submit your apps and in-app items (consumable, nonconsumable, and subscription) to validation testing and normal publication in Galaxy Store.
IAP testing of in-app item offerings (when your app gets and presents current item prices and details to app users) is the same as for normal publication. IAP testing of in-app item purchase and payment is the same as for normal publication except for subscription item testing changes, and some testers get items for free.
2. IAP Test Environment
Determine the IAP tests and type of purchase and payment transactions to test items with.
In your app code, set the IAP operating mode indicated below.
In the Seller Portal: register your app and in-app items, set up closed beta testing (if used), and set the app status indicated below.
|IAP Test||Transactions||IAP Operating Mode||App Status|
|Always Successful Side Load||No charge||OPERATION_MODE_
|Always Fail Side Load||No charge||OPERATION_MODE_
|Production Closed Beta||No charge or Charge
(depends on type of tester)
Do not test when the IAP operating mode is ‘OPERATION_MODE_PRODUCTION’ and the app status is ‘Registering’. IAP functionality is not supported under these conditions.
IAP Test Transaction Types
IAP testing supports ‘no charge’ and ‘charge’ transactions for item purchases.
(1) No charge transactions
- Item payments are not reported to the payment gateway (PG card company or payment agency). For successful transactions, Purchase emails, with amounts, are sent to testers.
- In the item purchase UI popup, the ‘Sandbox’ icon is displayed.
- Details depend on the IAP test environment and type of tester:
|IAP Operating Mode||Tester Type||Details|
||Licensed beta testers||
(2) Charge transactions
- For successful transactions, item payments are reported to and authorized by the payment gateway (PG card company or payment agency), and IAP reports purchase amounts.
- In the item purchase UI popup, the ‘Sandbox’ icon is not displayed.
- Only occur for OPERATION_MODE_PRODUCTION beta tests and non-licensed beta testers :
For successful purchases, testers get items and are charged, and IAP reports successful purchases.
3. IAP Testing
When creating tests of your app, in-app items, and Samsung IAP, the IAP tests are guidelines for test setup and initiating and verifying IAP functionality. You can test your app and in-app items with one or more IAP tests.
For all IAP tests, prepare your testers, app, and in-app items:
Ensure each tester has a valid credit card for payment.
Side load tester and licensed beta tester credit cards are not billed for any item purchases.
Non-licensed beta tester credit cards are billed for all item purchases.
In your app code:
a. Set the IAP operating mode for the selected IAP test.
mIapHelper.setOperationMode(HelperDefine.OperationMode.[IAP operating mode for the selected test])
b. Set whether or not payment-complete or -failed messages are to be displayed during item purchasing
IapHelper.startPayment class parameter _showSuccessDialog is true or false
Build the app APK.
For details, see the ProgrammingGuide.
In the Samsung Galaxy Store Seller Portal:
a. Register the app and in-app items.
b. Set the app status for the selected IAP test.
3.2 Test Type
(1) Always Successful Side Load Test
- Purpose and use:
- Test offerings, purchases, and payments of all items.
- Test subscription items at IAP test periods.
- Commonly used during app, in-app item, and IAP integration development.
- IAP operating mode is set to OPERATION_MODE_TEST.
Install the app on a test device by an independent method (such as side loading).
Test item offering and purchase:
a. Testers always get purchased items and are not charged.
b. IAP reports all purchases as successful and the purchase amounts.
(2) Always Fail Side Load Test
- Purpose and use:
- Test offerings and failed purchases and payments of all items.
- Commonly used during app, in-app item, and IAP integration development.
- Prepare the app and in-app items for testing.
- IAP operating mode is set to OPERATION_MODE_TEST_FAILURE.
- Install the app on a test device by an independent method (such as side loading).
- Test item offering and purchase:
a. Testers always do not get items and are not charged.
b. IAP reports all item purchases and payments as failed.
(3) Production Closed Beta Test
Apps deployed for beta testing must only be installed using the beta testing URL. If sideloaded, item information is not accessible.
If the beta test app being is updated and a newer version is deployed, testers MUST delete the earlier beta test app from their device and re-install the app.
- Purpose and use:
- All beta testers can test offerings, and successful and failed purchases and payments of all items (consumable, nonconsumable, and subscription).
- Non-licensed beta testers test subscription items at registered item periods.
- Licensed beta testers test subscription items at IAP test periods.
- Commonly used to test initial versions and update versions of apps and their items as a last development phase before normal publication.
The following steps are used for beta test setup and testing to be performed by the same person. Typically, a beta test conductor sets up a beta test to be run by many beta testers.
If the app was previously side loaded onto the test device, uninstall the app.
Prepare the app and in-app items for testing.
IAP operating mode is set to OPERATION_MODE_PRODUCTION.
b. Set up the closed beta test:
In the Binary tab of the Seller Portal app registration, register all beta testers (non-licensed and licensed) and the feedback channel for the closed beta test.
In your Seller Portal profile, register the licensed beta testers.
c. Submit the app and its items for beta release by clicking Submit Beta Test.
For more details, see the Application Registration Guide.
4. On each beta tester’s device, download the beta app from a beta test URL.
5. Test item offering and purchase:
Typically, some beta testers are non-licensed and some are licensed.
- Non-licensed beta testers can get purchased items and are charged.
Registered item periods apply to subscription items.
- Licensed beta testers can get purchased items and are not charged.
IAP test periods apply to subscription items.
- IAP reports successful and failed transactions, and actual item purchase amounts for successful transactions.
3.3 Testing Item Offering and Purchase
The following steps can be run for each tested in-app item:
Test in-app item offering:
a. In the app, initiate the display of the current price and details for each item.
b. Verify that item information matches the price and details registered in Seller Portal.
Test in-app item purchase:
a. In the app, initiate the purchase of an in item.
b. For licensed beta testers, click OK.
c. For Always Successful Side Load and Always Fail Side Load testers, click CONTINUE.
d. In the purchase popup:
No Charge transactions Charge transactions
(1) Verify the item details match those registered in Seller Portal.
Item discounts, coupons, free trial periods, lower-tier prices, and auto payment due dates are displayed but do not apply during IAP testing.
(2) Select payment method and verify payment information is correct.
(3) Select ‘Point and coupons’ and verify displayed information is correct.
(4) Click the [item purchase button].
e. Verify the following:
IAP test preparation sets whether or not payment-complete or payment-failed messages are displayed.
|Always Success Side Load Testing||
|Always Fail Side Load Testing||
|Production Closed Beta Testing||For successful purchases:
- A payment-complete message is displayed (when configured).
- The purchase item is added to your account.
- An item purchased email is sent to you.
- If you are a non-licensed beta tester, you are charged.
- If you are a licensed beta tester, you are not charged.
For failed purchased:
- A payment-failed message is displayed (when configured).
- The purchase item is not added to your account.
- You are not charged.
3.4 Testing Subscription Items
For Auto-Recurring Subscription (ARS) items, you can test their offering, purchase, free trials, lower and regular tier pricing, automatic payments, manual subscription cancellation, and repurchase.
Each subscription in-app item can have 1 free trial period (optional), 1 to 100 lower-tier price periods (optional), and regular-tier price periods (required, but they can be canceled at any time by testers, or are automatically canceled after 12 periods when IAP test periods apply).
- Depending on the IAP test environment, free trial and subscription periods end after either:
Registered item periods
- Free trial and subscription periods end as specified in the subscription item’s Seller Portal registration, which can be weeks, months, or years.
- Apply during production closed beta tests for non-licensed beta testers.
IAP test periods
- Free trial and subscription periods end every 10 minutes on the hour (at hh:10, hh:20, hh:30, …). The first period after purchase or repurchase ends at the next 10-minute time. For example, if an item with a free trial is first purchased at 11:08, free trial ends at 11:10.
- Apply during always successful side-load tests for all testers, and production closed beta tests for licensed beta testers.
To test subscription items
- Set up the test environment:
- Always successful side-load test.
- Production closed beta test and non-licensed beta testers and/or licensed beta testers.
The following steps are for side-load testers and licensed beta testers who are not charged for purchases, and free trials and subscriptions end at IAP test periods.
Non licensed beta testers are charged for purchases, and periods end as registered.
- Purchase a subscription item.
If an item with a free trial and/or lower-tier pricing is purchased in an IAP test, and the same tester purchases the same item in another IAP test, the free trial and lower-tier pricing will not be in effect.
- Test item after initial purchase.
Verify the following occur according to the diagrams below for the applicable scenario:
- Free or registered purchase price, and other purchase details, in the purchase email sent to you.
- First auto-payment email is sent at the next 10 minutes on the hour and the first auto-payment price (registered lower-tier or regular-tier).
- Additional auto-payment emails are sent every 10 minutes on the hour and the auto-payment price (registered lower-tier or regular-tier).
- Test item repurchase:
a. Purchase the subscription item again.
b. Verify the following occur according to the diagram below for all item types:
• Regular-tier price in the purchase email sent to you soon after purchase.
• First auto-payment email is sent 10 minutes on the hour after purchase.
• Regular-tier price in all auto-payment emails sent every 10 minutes on the hour.
- Test manual subscription cancellation:
a. In the Galaxy Store at any time before auto-cancellation, click My page > Receipts > Items tab > [Select purchased item] > Unsubscribe.
b. Verify a cancellation email is sent to you.
Example Subscription Item Testing
In both examples, either a side-load test was set up with a tester, or a production closed beta test was set up with a registered licensed beta tester. Free trial and subscription periods were at IAP test periods, and free trial and lower pricing are not in effect after item repurchase.
Non-Tiered Subscription Item with Purchase, Free Trial, Manual Cancellation, and Repurchase
- The test subscription in-app item has a 7-day free trial period, and a regular $4.99 monthly subscription price. Times (hh:mm local time) are for the listed actions and events.
Tiered Subscription with Purchase, Free Trial, Manual Cancellation, Repurchase, and Automatic Cancellation
- The test subscription in-app item has a 7-day free trial period, a $2.99 lower-tier monthly subscription price for 3 months, and a $4.99 regular-tier monthly subscription price.
Times (hh:mm local time) are for listed events.
4. After IAP Testing
After you complete all IAP testing and before you submit your app and its in-app items for validation testing, you must prepare them for normal publication.
You can only track the purchase history of a beta test app during beta testing. When the app is updated to a regular (non-beta) installation, the beta test purchase history is no longer available.
To prepare for normal publication
- For subscription items purchased during IAP testing, ensure their subscriptions are canceled.
- Delete the tested app from the tester mobile device(s).
- In the app code to be submitted for validation testing, ensure that the IAP operating mode is OPERATION_MODE_PRODUCTION.Caution :
If an app with the IAP operating mode set to OPERATION_MODE_TEST or OPERATION_MODE_TEST_FAILURE is normally published, then all app users are not charged for any in-app item purchases.
- In Seller Portal:
a. Delete all licensed beta testers that are registered in your profile.
b. If the app or its items were changed after IAP testing, update the app registration with the production version of the app and its items and change the registration information as necessary.
c. Submit the app and its items for validation testing by Samsung and normal publication in the Galaxy Store.
For details, see the Application Registration Guide and In-App Purchase Guide.