Skip to main content

Ready to market your stellar app?

Samsung Developer Program is your gateway to app monetization success.

Learn More

Samsung Developer Program

Purchase Method Details

CreateFromSku

public static Purchase CreateFromSku(string sku)

Creates a purchase from the specified SKU item ID for debug purposes and in editor mode.

Parameters:

sku SKU identifier of the item
CreateFromSku

public static Purchase CreateFromSku(string sku, string developerPayload)

For debug purposes and editor mode.

Parameters:

sku SKU identifier of the item

developerPayload

This assigned with a blank string; not supported by Samsung IAP.
This string is used for verification purposes to check if the purchase is legitimate or not. The app store returns the developer payload and is matched with the developer payload from the app.

ToString

public override string ToString()

Gets a string of the original JSON sent by the current app store for the SKU.

Returns:

Returns a string of the original JSON sent by the current app store for the SKU.

AddIOSHack

private static void AddIOSHack(Purchase p)

For iOS® Unity app, this method checks if the app store name, item type, or the order ID is null or empty.

When one of the variables is empty or null, this method sets the respective variables accordingly based on Apple app store settings.

Parameters:

p Purchase object instance
Serialize

public string Seralize()

Creates a JSON object instance that contains the item type, order ID, package name, SKU, purchase time, purchase state, developer payload, token, original JSON, signature, app store name, and receipt.

Returns:

Returns a serialized JSON object in string form.


  • Was this article helpful?