NotePlease double check the version of all tools otherwise it will cause compatibility issues.
Import Samsung IAP Plugin
Download the plugin file.
In Unity, click Assets → Import Package → Custom Pacakge...
Check Plugins folder which contains all Samsung IAP related scripts and libraries.
NoteFor details about Samsung IAP method calls, see the Programming Guide.
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 items.
Samsung IAP Script
Drag-and-drop the SamsungIAP script into the GameObject of your choice.
CautionEnsure the operation mode is set to OPERATION_MODE_PRODUCTION before submitting for Beta test or normal publication. In other words, OPERATION_MODE_TEST or OPERATION_MODE_TEST_FAILURE must be set only if the app status in Seller Portal is Registering or Updating.
Mode
Description
OPERATION_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 items purchased in OPERATION_MODE_PRODUCTION mode are considered owned items.
OPERATION_MODE_TEST
StartPayment() requests are processed as specified, except financial transactions do not occur (licensed testers are not billed for item purchases), and successful results are always returned. For details of the payment window shown in OPERATION_MODE_TEST mode, see the payment window .
Note: For all other IAP requests:
Only items purchased in OPERATION_MODE_TEST mode are considered owned items.
In order to purchase in-app items, 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 items for free. All other users see an error message if they try to purchase an in-app item.
OPERATION_MODE_TEST_FAILURE
All IAP requests fail. It is meant to be negative testing to ensure that your app can handle errors such as improper input and user actions.
After processing is complete, the OnGetOwnedList callback is triggered, which contains information about the specified purchased items and API call processing.
Get in-app item details
Use the GetProductsDetails() method to get detailed information (for example, item ID, price, and description) about some or all of the in-app items registered to your app that are available for user purchase:
Specify one or more unique in-app item ID values (comma delimited) to get information about the specified items.
Specify an empty string ("") to get information about all registered items.
Code snippet
// Get information about 3 in-app items
SamsungIAP.Instance.GetProductsDetails("com.mygame.product1, com.mygame.product2, com.mygame.product3", OnGetProductsDetails);
// Get information about all in-app items
SamsungIAP.Instance.GetProductsDetails("", OnGetProductsDetails);
After processing is complete, the OnGetProductsDetails callback is triggered, which contains information about the specified items and API call processing.
Purchase an in-app item
Use the StartPayment() method to initiate a purchase and payment transaction for a specified in-app item.
You can specify your own pass-through parameter and use it for purchase and payment verification.
After processing is complete, the OnPayment callback is triggered, which contains information about the purchased item, the transaction, and API call processing.
Acknowledge a purchased consumable item
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 purchaseID in the OnPayment and OnGetOwnedList callbacks.
Specify one or more unique purchaseID values, comma delimited.
After processing is complete, the OnConsume callback is triggered, which contains information about the consumed item and API call processing.
Get promotion eligibility for subscription
Use the GetPromotionEligibility() method to get the pricing options of a subscription item, such as free trials and introductory prices, applicable to the customer.
Specify one or more unique subscription ID values, comma delimited.
After processing is complete, the OnGetPromotionEligibility callback is triggered, which contains information about the pricing policy list and API call processing.
Change subscription plan
Use the ChangeSubscriptionPlan() method to allow your customer to change their existing subscription to another tier of the same subscription item.
Proration Mode
Description
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.
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.
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.
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.
After processing is complete, the OnChangeSubscriptionPlan callback is triggered, which contains information about the purchased item, the transaction, and API call processing.
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
.samsungdeveloperconference.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
LinkedIn
.ads.linkedin.com, .linkedin.com
Advertising Cookies
These cookies gather information about your browser habits. They remember that
you've visited our website and share this information with other organizations such
as advertisers.
Company
Domain
LinkedIn
.linkedin.com
Meta (formerly Facebook)
.samsungdeveloperconference.com
Google Inc.
.samsungdeveloperconference.com
Preferences Submitted
You have successfully updated your cookie preferences.