Beispiel #1
0
    public PurchaseProcessingResult ProcessPurchase(PurchaseEventArgs args)
    {
        Debug.Log("Purchase OK: " + args.purchasedProduct.definition.id + "===" + productIdInProcessing);
        Debug.Log("Receipt: " + args.purchasedProduct.receipt);

        gpm.SetLog("Receipt: " + args.purchasedProduct.receipt);

        _web.Send(args.purchasedProduct.receipt);

        // A consumable product has been purchased by this user.
        if (string.Equals(args.purchasedProduct.definition.id, productIdInProcessing, StringComparison.Ordinal))
        {
            Debug.Log(string.Format("ProcessPurchase: PASS. Product: {0}", args.purchasedProduct.definition.id));
            // The consumable item has been successfully purchased, add 100 coins to the player's in-game score.
        }

        m_PurchaseInProgress = false;

        // Return a flag indicating whether this product has completely been received, or if the application needs
        // to be reminded of this purchase at next app launch. Use PurchaseProcessingResult.Pending when still
        // saving purchased products to the cloud, and when that save is delayed.
        return(PurchaseProcessingResult.Pending);
    }