コード例 #1
0
ファイル: NET.cs プロジェクト: kimhwi9202/crown_temp
    public void SendReqPurchase(Action <string, string> response, Action <string> timeout, string productUrl,
                                GooglePlayReceipt google, AppleInAppPurchaseReceipt apple)
    {
        if (CONFIG.IsRunningAndroid())
        {
            PK.Purchase.SendDataAndroid data = new PK.Purchase.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.Purchase.SENDAndroid command = new PK.Purchase.SENDAndroid(PKID.PurchaseAndroid, data);
            _NetSocket.SendData(xLitJson.JsonMapper.ToJson(command), PKID.PurchaseAndroid, response, timeout);
        }
        else if (CONFIG.IsRunningiOS())
        {
            PK.Purchase.SendDataIOS data = new PK.Purchase.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.Purchase.SENDIOS command = new PK.Purchase.SENDIOS(PKID.PurchaseIOS, data);
            _NetSocket.SendData(xLitJson.JsonMapper.ToJson(command), PKID.PurchaseIOS, response, timeout);
        }
    }
コード例 #2
0
ファイル: PKPurchase.cs プロジェクト: kimhwi9202/crown_temp
 public SENDIOS(string cmd, SendDataIOS data)
 {
     this.cmd  = cmd;
     this.data = data;
 }