Example #1
0
    public void SendReqWheelPurchase(Action <string, string> response, Action <string> timeout, string productUrl,
                                     GooglePlayReceipt google, AppleInAppPurchaseReceipt apple)
    {
        if (CONFIG.IsRunningAndroid())
        {
            PK.WheelPurchase.SendDataAndroid data = new PK.WheelPurchase.SendDataAndroid();
            data.status        = "completed";
            data.currency      = "USD";
            data.quantity      = "1";
            data.amount        = 1.0;
            data.purchase_type = "coin";
            data.product_url   = productUrl;
            data.packageName   = google.packageName;
            data.productId     = google.productID;
            data.transactionID = google.transactionID;
            data.purchaseTime  = (double)google.purchaseDate.Ticks;
            data.purchaseState = (int)google.purchaseState;
            data.purchaseToken = google.purchaseToken;

            PK.WheelPurchase.SENDAndroid command = new PK.WheelPurchase.SENDAndroid(PKID.WheelPurchaseAndroid, data);
            _NetSocket.SendData(xLitJson.JsonMapper.ToJson(command), PKID.WheelPurchaseAndroid, response, timeout);
        }
        else if (CONFIG.IsRunningiOS())
        {
            PK.WheelPurchase.SendDataIOS data = new PK.WheelPurchase.SendDataIOS();
            data.status        = "completed";
            data.currency      = "USD";
            data.quantity      = "1";
            data.product_url   = productUrl;
            data.purchase_type = "coin";
            data.amount        = 1.0;
            data.purchaseToken = apple.originalTransactionIdentifier;

            PK.WheelPurchase.SENDIOS command = new PK.WheelPurchase.SENDIOS(PKID.WheelPurchaseIOS, data);
            _NetSocket.SendData(xLitJson.JsonMapper.ToJson(command), PKID.WheelPurchaseIOS, response, timeout);
        }
    }
Example #2
0
 public SENDAndroid(string cmd, SendDataAndroid data)
 {
     this.cmd  = cmd;
     this.data = data;
 }