Class ReceiptValidation
Class which contains helper functions for verification of receipts created through Unity's IAP Service.
Inheritance
ReceiptValidation
Assembly: cs.temp.dll.dll
Syntax
public class ReceiptValidation : IReceiptValidation, IInjectable
Fields
Declaration
protected IAppInformation _applicationInformation
Field Value
Type |
Description |
IAppInformation |
|
APP
Declaration
protected const string APP = "app"
Field Value
JSON
Declaration
protected const string JSON = "json"
Field Value
ORDER_ID
Declaration
protected const string ORDER_ID = "orderId"
Field Value
PAYLOAD
Declaration
protected const string PAYLOAD = "Payload"
Field Value
PAYLOAD_PROPERTY_NAME
Declaration
protected const string PAYLOAD_PROPERTY_NAME = "payload"
Field Value
Declaration
protected const string PLATFORM = "platform"
Field Value
Declaration
protected const string PLATFORM_ANDROID = "android"
Field Value
Declaration
protected const string PLATFORM_IOS = "ios"
Field Value
PRODUCT_IDENTIFIER
Declaration
protected const string PRODUCT_IDENTIFIER = "productIdentifier"
Field Value
PURCHASE_TOKEN
Declaration
protected const string PURCHASE_TOKEN = "purchaseToken"
Field Value
RECEIPT_PROPERTY_NAME
Declaration
protected const string RECEIPT_PROPERTY_NAME = "receipt"
Field Value
SIGNATURE_PROPERTY_NAME
Declaration
protected const string SIGNATURE_PROPERTY_NAME = "signature"
Field Value
TRANSACTION_ID
Declaration
protected const string TRANSACTION_ID = "TransactionID"
Field Value
TRANSACTION_IDENTIFIER
Declaration
protected const string TRANSACTION_IDENTIFIER = "transactionIdentifier"
Field Value
Methods
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
|
Declaration
protected WWWForm CreateFormWithSignature(Dictionary<string, string> data, string secret, bool encode = true)
Parameters
Returns
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
|
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
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
GetSignature(String, String)
Declaration
protected string GetSignature(string secretKey, string data)
Parameters
Returns
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
IInjectable