Show / Hide Table of Contents

    Class ReceiptValidation

    Class which contains helper functions for verification of receipts created through Unity's IAP Service.

    Inheritance
    Object
    ReceiptValidation
    Implements
    IReceiptValidation
    IInjectable
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ToString()
    Object.ReferenceEquals(Object, Object)
    Namespace: IdleKit.Gameplay
    Assembly: cs.temp.dll.dll
    Syntax
    public class ReceiptValidation : IReceiptValidation, IInjectable

    Fields

    _applicationInformation

    Declaration
    protected IAppInformation _applicationInformation
    Field Value
    Type Description
    IAppInformation

    APP

    Declaration
    protected const string APP = "app"
    Field Value
    Type Description
    String

    JSON

    Declaration
    protected const string JSON = "json"
    Field Value
    Type Description
    String

    ORDER_ID

    Declaration
    protected const string ORDER_ID = "orderId"
    Field Value
    Type Description
    String

    PAYLOAD

    Declaration
    protected const string PAYLOAD = "Payload"
    Field Value
    Type Description
    String

    PAYLOAD_PROPERTY_NAME

    Declaration
    protected const string PAYLOAD_PROPERTY_NAME = "payload"
    Field Value
    Type Description
    String

    PLATFORM

    Declaration
    protected const string PLATFORM = "platform"
    Field Value
    Type Description
    String

    PLATFORM_ANDROID

    Declaration
    protected const string PLATFORM_ANDROID = "android"
    Field Value
    Type Description
    String

    PLATFORM_IOS

    Declaration
    protected const string PLATFORM_IOS = "ios"
    Field Value
    Type Description
    String

    PRODUCT_IDENTIFIER

    Declaration
    protected const string PRODUCT_IDENTIFIER = "productIdentifier"
    Field Value
    Type Description
    String

    PURCHASE_TOKEN

    Declaration
    protected const string PURCHASE_TOKEN = "purchaseToken"
    Field Value
    Type Description
    String

    RECEIPT_PROPERTY_NAME

    Declaration
    protected const string RECEIPT_PROPERTY_NAME = "receipt"
    Field Value
    Type Description
    String

    SIGNATURE_PROPERTY_NAME

    Declaration
    protected const string SIGNATURE_PROPERTY_NAME = "signature"
    Field Value
    Type Description
    String

    TRANSACTION_ID

    Declaration
    protected const string TRANSACTION_ID = "TransactionID"
    Field Value
    Type Description
    String

    TRANSACTION_IDENTIFIER

    Declaration
    protected const string TRANSACTION_IDENTIFIER = "transactionIdentifier"
    Field Value
    Type Description
    String

    Methods

    CreateAndroidForm(Product, String)

    Creates a form for validating android receipts with ESG Game Services

    Declaration
    protected Dictionary<string, string> CreateAndroidForm(Product product, string app)
    Parameters
    Type Name Description
    Product product

    Unity Product purchased

    String app

    The app name (com.something.game)

    Returns
    Type Description
    Dictionary<String, String>

    Key Value Pairs for Form

    CreateFormWithSignature(Dictionary<String, String>, String, Boolean)

    Declaration
    protected WWWForm CreateFormWithSignature(Dictionary<string, string> data, string secret, bool encode = true)
    Parameters
    Type Name Description
    Dictionary<String, String> data
    String secret
    Boolean encode
    Returns
    Type Description
    WWWForm

    CreateIOSForm(Product, String)

    Creates a form for validating iOS receipts with ESG Game Services

    Declaration
    protected Dictionary<string, string> CreateIOSForm(Product product, string app)
    Parameters
    Type Name Description
    Product product

    Unity Product purchased

    String app

    The app name (com.something.game)

    Returns
    Type Description
    Dictionary<String, String>

    Key Value Pairs for Form

    CreatePurchaseForm(Product, String, String)

    Creates the WWWForm for receipt verification with ESG Game Services

    Declaration
    public virtual WWWForm CreatePurchaseForm(Product product, string secret, string app)
    Parameters
    Type Name Description
    Product product
    String secret
    String app
    Returns
    Type Description
    WWWForm

    EncodeForPHP(String)

    Provided by ESG Game Services to match their implementation in PHP

    Declaration
    public virtual string EncodeForPHP(string paramsString)
    Parameters
    Type Name Description
    String paramsString

    payload as a string

    Returns
    Type Description
    String

    Capital hex version of payload

    GetReceipt(String)

    Quick access to Unity Receipts

    Declaration
    public virtual string GetReceipt(string jsonString)
    Parameters
    Type Name Description
    String jsonString

    The Unity json string for purchase receipts

    Returns
    Type Description
    String

    GetSignature(String, String)

    Declaration
    protected string GetSignature(string secretKey, string data)
    Parameters
    Type Name Description
    String secretKey
    String data
    Returns
    Type Description
    String

    GetValFromJson(String, String)

    Returns the string value of a key from a json formatted string

    Declaration
    public virtual string GetValFromJson(string jsonString, string key)
    Parameters
    Type Name Description
    String jsonString

    json formatted string

    String key

    key within the json

    Returns
    Type Description
    String

    Return the value of json key as a string. Returns empty string if no key found.

    Inject(IResolver)

    Declaration
    public void Inject(IResolver resolver)
    Parameters
    Type Name Description
    IResolver resolver

    InsideOutBackToFrontSort(String[])

    Obfusgates the payloaded. Required by ESG Game Services.

    Declaration
    protected string[] InsideOutBackToFrontSort(string[] iterable)
    Parameters
    Type Name Description
    String[] iterable

    array of strings

    Returns
    Type Description
    String[]

    Obfusgated payload

    Implements

    IReceiptValidation
    IInjectable
    Back to top Copyright © 2020 East Side Games Inc.