Exemplo n.º 1
0
    public static UpsightPurchase purchaseFromJson(string json)
    {
        UpsightPurchase upsightPurchase = new UpsightPurchase();

        upsightPurchase.populateFromJson(json);
        return(upsightPurchase);
    }
Exemplo n.º 2
0
 void makePurchase(string json)
 {
     if (makePurchaseEvent != null)
     {
         makePurchaseEvent(UpsightPurchase.purchaseFromJson(json));
     }
 }
Exemplo n.º 3
0
 private void billboardDidReceivePurchase(string json)
 {
     if (UpsightManager.billboardDidReceivePurchaseEvent == null)
     {
         return;
     }
     UpsightManager.billboardDidReceivePurchaseEvent(UpsightPurchase.purchaseFromJson(json));
 }
Exemplo n.º 4
0
    void myMakePurchaseMethod(UpsightPurchase purchase)
    {
        if (purchase != null)
        {
                        # if UNITY_IPHONE
            if (StoreKitBinding.canMakePayments())
            {
                StoreKitBinding.purchaseProduct(purchase.productIdentifier, purchase.quantity);
            }
                        # endif

                        # if UNITY_ANDROID
    public static UpsightPurchase purchaseFromJson(string json)
    {
        var purchase = new UpsightPurchase();

        var dict = MiniJSON2.Json.Deserialize(json) as Dictionary <string, object>;

        if (dict != null)
        {
            if (dict.ContainsKey("placement") && dict["placement"] != null)
            {
                purchase.placement = dict["placement"].ToString();
            }

            if (dict.ContainsKey("quantity") && dict["quantity"] != null)
            {
                purchase.quantity = int.Parse(dict["quantity"].ToString());
            }

            if (dict.ContainsKey("productIdentifier") && dict["productIdentifier"] != null)
            {
                purchase.productIdentifier = dict["productIdentifier"].ToString();
            }

            if (dict.ContainsKey("store") && dict["store"] != null)
            {
                purchase.store = dict["store"].ToString();
            }

            if (dict.ContainsKey("receipt") && dict["receipt"] != null)
            {
                purchase.receipt = dict["receipt"].ToString();
            }

            if (dict.ContainsKey("title") && dict["title"] != null)
            {
                purchase.title = dict["title"].ToString();
            }

            if (dict.ContainsKey("price") && dict["price"] != null)
            {
                purchase.price = double.Parse(dict["price"].ToString());
            }
        }

        return(purchase);
    }
 void makePurchaseEvent(UpsightPurchase purchase)
 {
     Debug.Log("makePurchaseEvent: " + purchase);
 }
Exemplo n.º 7
0
 private void billboardDidReceivePurchaseEvent(UpsightPurchase purchase)
 {
     Debug.Log((object)("billboardDidReceivePurchaseEvent: " + (object)purchase));
 }