Skip to main content
Samsung Developer Program

IAP Helper Callback Listeners

Callback listeners define the data returned after requested IAP Helper functions are processed (with successful or failed results).

The following IAP Helper API calls must specify the indicated listener:

getOwnedList() OnGetOwnedListListener
getProductsDetails() OnGetProductsDetailsListener
startPayment() OnPaymentListener
consumePurchasedItems() OnConsumePurchasedItemsListener

 

OnGetOwnedListListener

The getOwnedList() callback listener receives information about in-app items that have been purchased by the end user (in OwnedProductVo) and call processing results (in ErrorVo).

void onGetItemInbox
(
    ErrorVo _errorVO, 
    ArrayList<OwnedProductVo> _ownedList
);

 

Listener Parameters

_errorVo

ErrorVo

Required  Name of the value object that contains the status code for the getOwnedList() processing

_ ownedList

ArrayList
<OwnedProductVo>

Required  Name of value object that contains purchased in-app item information

 

ErrorVo Parameters

For details, see IAP Helper Result Status Codes.

 

OwnedProductVo Parameters

Note: The local currency is the currency of the user's country, and the local price is the in-app item's price in the local currency at the time of the purchase and payment transaction.

Variable Type Description

mItemId

String

Unique ID of the in-app item

mItemName

String

Title of the in-app item

mItemPrice

Double

Current local price in the local currency of the in-app item

mItemPriceString

String

Local currency symbol and price (in the local currency format) of the in-app item
(for example £7.99, 66815₫)

mCurrencyUnit

String

Local currency symbol

mCurrencyCode String Code value (3 alphabetic characters) of the currency unit

mItemDesc

String

Description of the in-app item

mType

String

Type of in-app item:

Item                 Consumable or nonconsumable

Subscription   Auto-recurring subscription

mIsConsumable

String

Whether or not the in-app item is consumable:

True    Consumable in-app item

False   Not a consumable in-app item (nonconsumable item or auto-recurring subscription)

mPaymentId

String

Unique identifier assigned by Samsung IAP to the confirmed payment of the in-app item

mPurchaseId

String

Unique identifier assigned to the purchase and payment transaction

mPurchaseDate

String

Time (in milliseconds) of purchase and payment transaction

mPassThroughParam

String

Unique identifier that your Android app assigned to the purchase and payment transaction of the in-app item

If a pass-through ID was not assigned, null is returned.

mSubscriptionEndDate String For subscription in-app items only, the date of the item's next subscription renewal

mJsonString

String

Original JSON string

 

OnGetProductsDetailsListener

The getProductsDetails() callback listener receives information about one or more requested in-app items that are available for purchase (in ProductVo) and call processing results (in ErrorVo).

void onGetItem
(
    ErrorVo _errorVo, 
    ArrayList<ProductVo> _productList
);

 

Listener Parameters

_errorVo

ErrorVo

Required  Name of the value object that contains the status code for the getProductsDetails() processing

_productList

ArrayList
<ProductVo>

Required  Name of value object that contains information about the requested in-app items

 

ErrorVo Parameters

For details, see IAP Helper Result Status Codes.

 

ProductVo Parameters

Note: The local currency is the currency of the user's country, and the local price is the in-app item's price in the local currency at the time of the purchase and payment transaction.

Variable Type Description

mItemId

String

Unique ID of the in-app item

mItemName

String

Title of the in-app item

mItemPrice

Double

Current local price in the local currency of the in-app item

mItemPriceString

String

Local currency symbol and price (in the local currency format) of the in-app item
(for example £7.99, 66815₫)

mCurrencyUnit

String

Local currency symbol

mCurrencyCode String Code value (3 alphabetic characters) of the currency unit

mItemDesc

String

Description of the in-app item

mType

String

Type of in-app item:

Item                 Consumable or nonconsumable

Subscription   Auto-recurring subscription

mIsConsumable

String

Whether or not the in-app item is consumable:

True    Consumable in-app item

False   Not a consumable in-app item (a nonconsumable item or auto-recurring subscription)

mSubscription
DurationUnit
String For subscription in-app items only, the time basis (YEAR, MONTH, WEEK, DAY) of the item
mSubscription
DurationMultiplier
String For subscription in-app items only, the numeric multiple of the time basis unit that determines the item's subscription time period (for example, 1 year, 2 months, 4 weeks, or 5 days)

mFreeTrialPeriod

String

Information about the in-app item and its pre-subscription free trial:

[7 to 999] Free trial period (days) of the subscription item.

mItemImageUrl String URL of the in-app item's image
mItemDownloadUrl String URL where the in-app item's Android app can be downloaded

mJsonString

String

Original JSON string

 

 

OnPaymentListener

The startPayment() callback listener receives information about an in-app item to be purchased and its purchase and payment transaction information (in PurchaseVo) and call processing results (in ErrorVo).

void onPayment
(
    ErrorVo _errorVo, 
    PurchaseVo _purchaseVo
);

 

Listener Parameters

_errorVo

ErrorVo

Required Name of the value object that contains the status code for the startPayment() purchase and payment transaction processing

_ purchaseVo

PurchaseVo

Required Name of value object that contains information about the item, and the purchase and payment transaction

 

ErrorVo Parameters

For details, see IAP Helper Result Status Codes.

 

PurchaseVo Parameters

Note: The local currency is the currency of the user's country, and the local price is the in-app item's price in the local currency at the time of the purchase and payment transaction.

Variable Type Description

mItemId

String

Unique ID of the in-app item

mItemName

String

Title of the in-app item

mItemPrice

Double

Current local price in the local currency of the in-app item

mItemPriceString

String

Local currency symbol and price (in the local currency format) of the in-app item
(for example £7.99, 66815₫)

mCurrencyUnit

String

Local currency symbol

mCurrencyCode String Code value (3 alphabetic characters) of the local currency unit

mItemDesc

String

Description of the in-app item

mType

String

Kind of in-app item:

Item                 Consumable or nonconsumable

Subscription   Auto-recurring subscription

mIsConsumable

String

Whether or not the in-app item is consumable:

True    Consumable in-app item

False   Not a consumable in-app item (nonconsumable item or auto-recurring subscription)

mPaymentId

String

Unique identifier assigned by Samsung IAP to the confirmed payment of the in-app item

mPurchaseId

String

Unique identifier assigned by Samsung IAP to the purchase and payment transaction of the in-app item

mPurchaseDate

String

Time (in milliseconds) the in-app item purchase and payment transaction was completed

mVerifyUrl

String

URL of the IAP Server to which your app server sends IAP Server API calls (for example, to get purchase receipt information using a mPurchaseId value)

mPassThroughParam

 

String

Unique identifier that your Android app assigned to the purchase and payment transaction of the in-app item

If a pass-through ID was not assigned, null is returned.

mItemImageUrl String URL of the in-app item's image
mItemDownloadUrl String URL where the in-app item's Android app can be downloaded

mJsonString

String

Original JSON string

 

 

OnConsumePurchasedItemsListener

The consumePurchasedItem() callback listener receives information about one or more purchased consumable in-app items that have been used by the end-user (in ConsumeVo) and call processing results (in ErrorVo).

void onGetItemInbox
(
    ErrorVo _errorVo, 
    ArrayList<ConsumeVo> _consumeList
);

 

Listener Parameters

_errorVo

ErrorVo

Required  Name of the value object that contains the status code for the consumePurchasedItem() processing

_ consumeList

ArrayList
<ConsumeVo>

Required  Name of value object that contains consumable in-app item information

 

ErrorVo Parameters

For details, see IAP Helper Result Status Codes.
 

ConsumeVo Parameters

mPurchaseId String Unique identifier assigned by Samsung IAP to the purchase and payment transaction of the in-app item

mStatusCode

String

Whether or not the in-app item was used by the end-user:

True    The in-app item was used.

False   The in-app item was not used.

mStatusString

String

Status message

 

  • Was this article helpful?