en zh

Unreal Plugin

Samsung IAP Unreal Engine Plugin v6.5.0
(11.1MB) April 20, 2026

The Samsung IAP Unreal Engine Plugin comes with all the content necessary for your integration.

Integrate Samsung IAP into Your App

This section explains how to use the Samsung In-App Purchase(IAP) functionality by integrating the Samsung IAP Unreal Engine Plugin.

System requirements

To avoid compatibility issues, the plugin requires the following tools:

Install Samsung IAP Plugin

  1. Download the Samsung IAP Unreal Engine Plugin file.

  2. Create Plugins folder inside the <unreal_project_directory> directory if it does not exist.

  3. Copy the SamsungIAP folder and its contents to Plugins folder from the Samsung IAP Unreal plugin file.

  1. Now open the editor and navigate to the Edit->Plugins menu and enable the Samsung IAP Plugin.

Add Samsung IAP dependency

Modify the <unreal_project_name>.Build.cs file by adding "SamsungIAP" to the PublicDependencyModuleNames section.

Code snippet

PublicDependencyModuleNames.AddRange(new string[] {
    "Core", "CoreUObject", "Engine", "InputCore",
    "UMG", "Slate", "SlateCore",
    "SamsungIAP"
});

Implement Samsung IAP

This section explains the fundamental aspects of integrating Samsung IAP functionality into your Android app by making plugin method calls to support the offering and sale of in-app products.

Include IAP header file

Access the Samsung IAP API by including the IAP header file IAP.h in the related classes of your project.

Code snippet

#include "IAP.h"

Set the IAP operating mode

Use the setOperationMode() method to set the operating mode.

Mode

Description

IAP_MODE_PRODUCTION

startPayment() requests are processed as specified, financial transactions do occur for successful requests, and actual results are returned (successful or failed).

Note: For all other IAP requests:
  • Only products purchased in IAP_MODE_PRODUCTION mode are considered owned products.

IAP_MODE_TEST

startPayment() requests are processed as specified, except financial transactions do not occur (licensed testers are not billed for product purchases), and successful results are always returned.
For details of the payment window shown in IAP_MODE_TEST mode, see the payment window.

Note: For all other IAP requests:
  • Only products purchased in IAP_MODE_TEST mode are considered owned products.
  • In order to purchase in-app products, testers must be registered as a License Tester in the seller's Seller Portal profile. In this mode, licensed testers always get your in-app products for free. All other users see an error message if they try to purchase an in-app product.

IAP_MODE_TEST_FAILURE

All IAP requests fail.
This mode is for negative testing to ensure that your app can handle errors such as improper input and user actions.

Code snippet

samsung::IAP::setOperationMode(IAP_MODE_TEST);

Get user-owned products

Use the getOwnedList() method to get information about some or all of the products the user has already purchased:

Product Type

Description

item

Returns all purchased non-consumable items, consumable items that have not been consumed

subscription

Returns all active subscriptions

all

Returns all purchased non-consumable items, consumable items that have not been consumed and active subscriptions

Code snippet

samsung::IAP::getOwnedList("all");

After processing is complete, the onGetOwnedProducts callback is triggered, containing information about the specified purchased products and API call processing.

Listen to callback events:

// listener delcaration
void onGetOwnedProducts(int result, const FString& msg, const std::vector<samsung::OwnedProductVo>& data);

// listener implementation
void SamsungIAPListener::onGetOwnedProducts(int result, const FString& msg, const vector<OwnedProductVo>& data) {
    
    for(auto& i : data) {
        print(FString::Printf(TEXT("Owned Item: %s"), *i.mItemName));
    }    
}

Get in-app product details

Use the getProductsDetails() method to get detailed information (for example, item ID, price, and description) about some or all of the in-app products registered to your app that are available for user purchase:

  • Specify one or more unique in-app product ID values (comma delimited) to get information about the specified products.
  • Specify an empty string ("") to get information about all registered products.

Code snippet

//Get information about three in-app products
samsung::IAP::getProductsDetails("com.mygame.product1, com.mygame.product2, com.mygame.product3");

//Get information about all in-app products
samsung::IAP::getProductsDetails("");

After processing is complete, the onGetProducts callback is triggered, which contains information about the specified products and API call processing.

Listen to callback events:

// listener delcaration
void onGetProducts(int result, const FString& msg, const std::vector<samsung::ProductVo>& data);

// listener implementation
void SamsungIAPListener::onGetProducts(int result, const FString& msg, const vector<ProductVo>& data) {
    
    for(auto& i : data) {
        print(FString::Printf(TEXT(" Name: %s"), *i.mItemName));
    }    
}

Purchase an in-app product

Use the startPayment() method to initiate a purchase and payment transaction for a specified in-app product.

You can optionally specify the obfuscated account ID and profile ID in the request for startPayment(). The obfuscated account ID and profile ID are returned in the response. Galaxy Store uses this value to detect fraudulent payments.

Code snippet

//Start purchase and payment of an in-app product.
samsung::IAP::startPayment("com.mygame.product1", "obfuscatedAccountId", "obfuscatedProfileId");

After processing is complete, the onPayment callback is triggered, which contains information about the purchased product, the transaction, and API call processing.

Listen to callback events:

// listener delcaration
void onPayment(int result, const FString& msg, const samsung::PurchaseVo& data);

// listener implementation
void SamsungIAPListener::onPayment(int result, const FString& msg, const PurchaseVo& data) {
    
    print(FString::Printf(TEXT("Item: %s"), *data.mItemName));    
}

Notify Samsung IAP that the purchase was processed

Consumable items

Use the consumePurchasedItems() method and the purchase ID of a consumable in-app item to enable it to be purchased again (whether or not the user has actually used the item).

Your app receives an item's purchase ID in the onPayment and onGetOwnedList callbacks.

Code snippet

//Consume Purchased Items
samsung::IAP::consumePurchasedItems("purchase_id");

After processing is complete, the onConsumePurchasedItems callback is triggered, which contains information about the consumed item and API call processing.

Listen to callback events:

// listener delcaration
void onConsumePurchasedItems(int result, const FString& msg, const std::vector<samsung::ConsumeVo>& data);

// listener implementation
void SamsungIAPListener::onConsumePurchasedItems(int result, const FString& msg, const vector<ConsumeVo>& data) {
    
    for(auto& i : data) {
        print(FString::Printf(TEXT("Owned Item: %s"), *i.mPurchaseId));
    }    
}

Non-consumable items and subscriptions

Use the acknowledgePurchases() method to acknowledge that the user has been granted entitlement for one or more purchased non-consumable items or subscriptions.

Code snippet

//Acknowledge non-consumable items and subscriptions
samsung::IAP::acknowledgePurchases("purchase_id");

After processing is complete, the onAcknowledgePurchases callback is triggered, which returns non-consumable items or subscription data.

Listen to callback events:

// listener delcaration
void onAcknowledgePurchases(int result, const FString& msg, const std::vector<samsung::AcknowledgeVo>& data);

// listener implementation
void SamsungIAPListener::onAcknowledgePurchases(int result, const FString& msg, const vector<AcknowledgeVo>& data) {
    
    for(auto& i : data) {
        print(FString::Printf(TEXT("Owned Item: %s"), *i.mPurchaseId));
    }    
}

Get promotion eligibility for subscription

Use the getPromotionEligibility() method to get the pricing options of a subscription, such as free trials and introductory prices, applicable to the customer.

Specify one or more unique subscription ID values, comma delimited.

Code snippet

//Get promotional offers of items and subscriptions
samsung::IAP::getPromotionEligibility("subItemId_1, subItemId_2");

After processing is complete, the onGetPromotionEligibility callback is triggered, which contains information about the pricing policy list and API call processing.

Listen to callback events:

// listener delcaration
void onGetPromotionEligibility(int result, const FString& msg, const std::vector<samsung::PromotionEligibilityVo>& data);

// listener implementation
void SamsungIAPListener::onGetPromotionEligibility(int result, const FString& msg, const vector<PromotionEligibilityVo>& data) {
    
    for(auto& i : data) {
        print(FString::Printf(TEXT("Owned Item: %s"), *i.itemID));
    }    
}

Change subscription plan

Use the changeSubscriptionPlan() method to allow your customer to change their existing subscription to another tier of the same subscription.

Proration Mode

Description

PRORATION_MODE_INSTANT_PRORATED_DATE

The subscription is upgraded or downgraded immediately.
Any time remaining is adjusted based on the price difference and credited toward the new subscription by pushing forward the next billing date. There is no any additional payment.

PRORATION_MODE_INSTANT_PRORATED_CHARGE

For upgraded subscriptions only.
The subscription is upgraded immediately but the billing cycle remains the same. The price difference for the remaining period is then charged to the user.

PRORATION_MODE_INSTANT_NO_PRORATION

For upgraded subscriptions only.
The subscription is upgraded immediately and the new price is charged when the subscription renews. The billing cycle remains the same.

PRORATION_MODE_DEFERRED

The subscription is upgraded or downgraded when the subscription renews.
When the subscription renews, the new price is charged. A downgrade is always executed with this mode.

See Proration Modes for more details about the four modes.

Code snippet

//Change from one subscription plan to another
samsung::IAP::changeSubscriptionPlan("oldItemId", "newItemId", PRORATION_MODE_INSTANT_PRORATED_DATE, "obfuscatedAccountId", "obfuscatedProfileId");

After processing is complete, the onChangeSubscriptionPlan callback is triggered, which contains information about the purchased product, the transaction, and API call processing.

Listen to callback events:

// listener delcaration
void onChangeSubscriptionPlan(int result, const FString& msg, const samsung::PurchaseVo& data);

// listener implementation
void SamsungIAPListener::onChangeSubscriptionPlan(int result, const FString& msg, const PurchaseVo& data) {
    
    print(FString::Printf(TEXT("Item: %s"), *data.mItemName));    
}