en zh

Test Guide

1. Overview

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_TEST

Registering
Always Fail Side Load

No charge

OPERATION_MODE_TEST_FAILURE

Registering
Production Closed Beta

No charge or Charge
(depends on type of tester)

OPERATION_MODE_PRODUCTION

Beta Deployed

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
OPERATION_MODE_TEST

Licensed testers
  • Testers always get purchased items.
    - IAP always reports successful purchases.
  • For non-consumable items, the purchase record is initialized every 10 minutes to allow repurchase.
  • For subscription items, the subscription cycle is automatically renewed every 10 minutes and the subscription is automatically canceled after 12 renewals.
OPERATION_MODE_TEST_FAILURE

All types
  • Testers never get purchased items.
    - IAP always reports failed purchases.
OPERATION_MODE_PRODUCTION

All types
  • For successful purchases, testers get items.
    - IAP reports success.

(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 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.

3.1 Preparation

For all IAP tests, prepare your testers, app, and in-app items:

  1. Ensure each tester has a valid credit card for payment.
    Side load tester and licensed tester credit cards are not billed for any item purchases.
    Non-licensed tester credit cards are billed for all item purchases.

  2. 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

  3. Build the app APK.
    For details, see the ProgrammingGuide.

  4. 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.
  1. Prepare the app and in-app items for testing.

    • IAP operating mode is set to OPERATION_MODE_TEST.
  2. Install the app on a test device by an independent method (such as side loading).

  3. 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.

  4. Test subscription items.

(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.
  1. Prepare the app and in-app items for testing.
    • IAP operating mode is set to OPERATION_MODE_TEST_FAILURE.
  2. Install the app on a test device by an independent method (such as side loading).
  3. 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

  • 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 testers test subscription items at registered item periods.
    • Licensed 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.
  1. If the app was previously side loaded onto the test device, uninstall the app.

  2. Prepare the app and in-app items for testing.
    IAP operating mode is set to OPERATION_MODE_PRODUCTION.

  3. In Seller Portal:
    a. Register the app and its items.
    For details, see the App Registration Guide and In-App Purchase Guide.

    b. Set up the closed beta test:
    In the Binary tab of the Seller Portal app registration, register all testers (non-licensed and licensed) and the feedback channel for the closed beta test.

In your Seller Portal profile, register the licensed testers.

c. Submit the app and its items for beta release by clicking Submit Beta Test.
For more details, see the App 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 testers are non-licensed and some are licensed.

  • Non-licensed testers can get purchased items and are charged.
    Registered item periods apply to subscription items.
  • Licensed 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.

6.Test purchased subscription items.

3.3 Testing Item Offering and Purchase

The following steps can be run for each tested in-app item:

  1. 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.

  2. Test in-app item purchase:
    a. In the app, initiate the purchase of an in item.
    b. For licensed 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.

(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:

Test Descriptions
Always Success Side Load Testing

  • A payment-complete message is displayed (when configured).
    - The purchase item is added to your account.
    - An item purchased email is sent to you.
Always Fail Side Load Testing

  • A payment-failed message is displayed(when configured).
    - The purchase item is not added to your account.
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 tester, you are charged.
- If you are a licensed 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.

  • 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 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 testers.

To test subscription items

  1. Set up the test environment:
Non-Licensed testers are charged for purchases, and periods end as registered.
  1. Purchase a subscription item.

To test a free trial or lower-tier pricing again, either:

  • Re-Register a new item (for example, with a different name), and have the same tester purchase the item.
  • Have another tester purchase the item.

  1. 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).



  1. 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.



  1. 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 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.

To prepare for normal publication

  1. For subscription items purchased during IAP testing, ensure their subscriptions are canceled.

  2. Delete the tested app from the tester mobile device(s).

  3. In the app code to be submitted for validation testing, ensure that the IAP operating mode is OPERATION_MODE_PRODUCTION.

  4. In Seller Portal:
    a. Delete all licensed testers that are registered in your profile.
    b. If the app was changed after IAP testing, update the app registration with the production version of the app and change the registration information as necessary.
    c. Submit the app for validation testing by Samsung and normal publication in the Galaxy Store.
    For details, see the Application Registration Guide.