void OnPurchaseProductReceived(AMN_PurchaseResponse result)
    {
        if (result.isSuccess)
        {
            string _requestId    = result.RequestId;
            string _userId       = result.UserId;
            string _marketplace  = result.Marketplace;
            string _receiptId    = result.ReceiptId;
            long   _cancelDate   = result.CancelDate;
            long   _purchaseDate = result.PurchaseDatee;
            string _sku          = result.Sku;
            string _productType  = result.ProductType;
            string _status       = result.Status;

            SA_StatusBar.text = "PurchaseProduct status " + result.Status;

            Debug.Log(_requestId + " " + _userId + " " + _marketplace + " " + _receiptId + " " + _cancelDate + " " + _purchaseDate + " " + _sku + " " + _productType + " " + _status);
        }
        else
        {
            string _requestId = result.RequestId;
            string _status    = result.Status;

            SA_StatusBar.text = "PurchaseProduct status " + result.Status;

            Debug.Log("_status " + _status + " _requestId " + _requestId);
        }
    }
Exemplo n.º 2
0
    //--------------------------------------
    // Event Handlers
    //--------------------------------------


    private void HandleAmazonPurchaseProductReceived(AMN_PurchaseResponse response)
    {
        Debug.Log("[Amazon] HandleAmazonPurchaseProductReceived");

        UM_InAppProduct p = UltimateMobileSettings.Instance.GetProductByAmazonId(response.Sku);

        if (p != null)
        {
            UM_PurchaseResult result = new UM_PurchaseResult();
            result.Amazon_PurchaseInfo = response;
            result.product             = p;
            result.isSuccess           = response.isSuccess;

            SendPurchaseFinishedEvent(result);
        }
        else
        {
            SendNoTemplateEvent();
        }
    }
Exemplo n.º 3
0
    private void PurchaseProductHandler(PurchaseResponse data)
    {
        AMN_PurchaseResponse result;

        if (data.Status.Equals(status.SUCCESSFUL.ToString()))
        {
            result = new AMN_PurchaseResponse(data);
            iapService.NotifyFulfillment(new NotifyFulfillmentInput()
            {
                ReceiptId         = data.PurchaseReceipt.ReceiptId,
                FulfillmentResult = "FULFILLED"
            });
        }
        else
        {
            result = new AMN_PurchaseResponse(data, currentSKU);
        }

        OnPurchaseProductReceived(result);
    }