en zh

Test Guide

1. Overview

Samsung In-App Purchase (IAP) supports your app IAP-integration and in-app product development testing of in-app product offering, purchase, and payment functionality before you submit your apps and in-app products (consumable and non-consumable items and subscriptions) to validation testing and normal publication in Galaxy Store.

IAP testing of in-app product offerings (when your app gets and presents current product prices and details to app users) is the same as for normal publication. IAP testing of in-app product purchase and payment is the same as for normal publication except for subscription testing changes, and some testers get products for free.

2. IAP Test Environment

Determine the IAP tests and type of purchase and payment transactions to test products with.

In your app code, set the IAP operating mode indicated below.
In the Seller Portal: register your app and in-app products, 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

2.1. IAP Test Transaction Types

IAP testing supports no charge and charge transactions for product purchases.

1) No charge transactions

  • Product 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 product 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

License tester

  • Testers always get purchased products.
    - IAP always reports successful purchases.
  • For non-consumable items, the purchase record is initialized every 10 minutes to allow repurchase.
  • For subscriptions, 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 products.
    - IAP always reports failed purchases.
OPERATION_MODE_PRODUCTION

All types

  • For successful purchases, testers get products.
    - IAP reports success.

2) Charge transactions

  • For successful transactions, product payments are reported to and authorized by the payment gateway (PG card company or payment agency), and IAP reports purchase amounts.

  • Only occurs for Beta test with OPERATION_MODE_PRODUCTION and non-license tester:
    For successful purchases, testers get products and are charged, and IAP reports successful purchases.

2.2. License tester

A license tester can purchase in-app products without charge in OPERATION_MODE_TEST mode or Closed Beta test.

To be a license tester, testers must be registered as a License Tester in the seller's Seller Portal profile.

For a Closed Beta Test, license tester can also be added from the Binary tab.

3. IAP Testing

When creating tests of your app, in-app products, 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 products with one or more IAP tests.

3.1 Preparation

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

  1. Ensure each tester has a valid credit card for payment.
  • Side load tester and license tester credit cards are not billed for any product purchases.
    Non-license tester credit cards are billed for all product purchases.
  1. In your app code:
  • Set the IAP operating mode for the selected IAP test.
    mIapHelper.setOperationMode(HelperDefine.OperationMode.[IAP operating mode for the selected test])
  1. Build the app APK.
  1. In the Samsung Galaxy Store Seller Portal:
  • Register the app and in-app products.
  • 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 products.
    • Test subscriptions at IAP test periods.
    • Commonly used during app, in-app product, and IAP integration development.
  1. Prepare the app and in-app products 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 product offering and purchase:
    a. Testers always get purchased products and are not charged.
    b. IAP reports all purchases as successful and the purchase amounts.

  4. Test subscriptions.

2) Always Fail Side Load Test

  • Purpose and use:
    • Test offerings and failed purchases and payments of all products.
    • Commonly used during app, in-app product, and IAP integration development.
  1. Prepare the app and in-app products 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 product offering and purchase:
    a. Testers always do not get products and are not charged.
    b. IAP reports all product purchases and payments as failed.

3) Closed Beta Test

  • Purpose and use:
    • All beta testers can test offerings, and successful and failed purchases and payments of all products (consumable items, nonconsumable items, and subscriptions).
    • Non-license testers test subscriptions at registered subscription periods.
    • License testers test subscriptions at IAP test periods.
    • Commonly used to test initial versions and update versions of apps and their products 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 products for testing.
    IAP operating mode is set to OPERATION_MODE_PRODUCTION.

  3. In Seller Portal:
    a. Register the app and its products.
    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 (License and non-license) and the feedback channel for the closed beta test.

    c. Submit the app and its products 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 product offering and purchase:

    • Non-license testers can get purchased products and are charged.
      Registered subscription periods apply to subscriptions.
    • License testers can get purchased products and are not charged.
      IAP test periods apply to subscriptions.
    • IAP reports successful and failed transactions, and actual product purchase amounts for successful transactions.

6.Test purchased subscriptions.

3.3 Testing Product Offering and Purchase

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

  1. Test in-app product offering:
    a. In the app, initiate the display of the current price and details for each product.
    b. Verify that product information matches the price and details registered in Seller Portal.

  2. Test in-app product purchase:
    a. In the app, initiate the purchase of an in-app product.
    b. For license 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 product 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 purchased product is added to your account.
    - A product purchased email is sent to you.
Always Fail Side Load Testing

  • A payment-failed message is displayed(when configured).
    - The in-app product is not added to your account.
Production Closed Beta Testing

For successful purchases:
- A payment-complete message is displayed (when configured).
- The purchased product is added to your account.
- A product purchased email is sent to you.
- If you are a non-license tester, you are charged.
- If you are a license tester, you are not charged.
For failed purchased:
- A payment-failed message is displayed (when configured).
- The in-app product is not added to your account.
- You are not charged.

3.4 Testing Subscriptions

For Auto-Recurring Subscriptions (ARS), 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 subscription periods

  • Free trial and subscription periods end as specified in the subscription’s Seller Portal registration, which can be weeks, months, or years.
  • Apply during production closed beta tests for non-license 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 a subscription 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 license testers.

To test subscriptions

  1. Set up the test environment:
  1. Purchase a subscription.

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

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

  1. Test subscription 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 subscription auto-payment:
    a. Auto-Payments are made 12 times every 10 minutes.
    b. Verify the following occur according to the diagram below for all subscription 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 Galaxy Store at any time before auto-cancellation, click Menu > Subscription > [select a subscription] > Unsubscribe.
    b. Verify a cancellation email is sent to you.

  2. Test re-subscription:
    A cancelled subscription expires at the end of the current test cycle which is the next 10 minute mark of the hour (for example, hh:00, hh:10, hh:20, hh:30, hh:40, hh:50). Before expiring, you can re-subscribe to the cancelled subscription.
    a. To re-subscribe, in Galaxy Store, click Menu > Subscription > [select a canceled subscription] > Resubscribe.

Example Subscription Testing

Non-Introductory Subscription with Purchase, Free Trial and Automatic Cancellation after 12th Auto-Payment

The test subscription has a 7-day free trial period and a regular $4.99 monthly subscription price. Times (hh:mm local time) are for listed events.

* After 12 automatic payments, the expiration date changes to the current date and time, allowing new purchases.

Introductory Subscription with Purchase, Free Trial and Automatic Cancellation after 12th Auto-Payment

The test subscription has a 7-day free trial period, a $2.99 introductory monthly subscription price for 3 months, and a $4.99 regular-tier monthly subscription price. Times (hh:mm local time) are for the listed actions and events.

* After 12 automatic payments, the expiration date changes to the current date and time, allowing new purchases.

Non-Introductory Subscription with Purchase, Free Trial, Manual Cancellation

The test subscription has a 7-day free trial period and a $4.99 regular-tier monthly subscription price. Times (hh:mm local time) are for listed events.

* When a subscription is cancelled in test mode, the subscription expires at the end of the current test cycle which is the next 10 minute mark of the hour (for example, hh:00, hh:10, hh:20, hh:30, hh:40, hh:50).

Non-Introductory Subscription with Purchase, Free Trial, Manual Cancellation, and Re-Subscribe from Galaxy Store

The test subscription has a 7-day free trial period and a $4.99 regular-tier monthly subscription price. Times (hh:mm local time) are for listed events.

* When a subscription is cancelled in test mode, the subscription expires at the end of the current test cycle which is the next 10 minute mark of the hour (for example, hh:00, hh:10, hh:20, hh:30, hh:40, hh:50).
** Re-subscription is only possible before the end of the current test cycle after cancellation.
*** After 12 automatic payments, the expiration date changes to the current date and time, allowing new purchases.

4. After IAP Testing

After you complete all IAP testing and before you submit your app and its in-app products for validation testing, you must prepare them for normal publication.

To prepare for normal publication

  1. For subscriptions 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 license 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.