예제 #1
0
 public void onError(string message)
 {
     if (this.onErrorEvent != null)
     {
         NIAPResult obj = this.convertToObject(message);
         this.onErrorEvent(obj);
     }
 }
예제 #2
0
 public void showErrorMessage(NIAPResult result)
 {
     NIAPUnityPlugin.instance.activity.Call("showErrorMessage", new object[]
     {
         result.getRequestType(),
         result.getResult()
     });
 }
예제 #3
0
 public void onPaymentCanceled(string message)
 {
     if (this.onPaymentCanceledEvent != null)
     {
         NIAPResult obj = this.convertToObject(message);
         this.onPaymentCanceledEvent(obj);
     }
 }
예제 #4
0
 public void onReceivedReceipt(string message)
 {
     if (this.onReceivedReceiptEvent != null)
     {
         NIAPResult obj = this.convertToObject(message);
         this.onReceivedReceiptEvent(obj);
     }
 }
    public void onPaymentCanceled(NIAPResult result)
    {
        GS_BILLING_ITEM_RECODE_REQ gS_BILLING_ITEM_RECODE_REQ = new GS_BILLING_ITEM_RECODE_REQ();

        gS_BILLING_ITEM_RECODE_REQ.i8Type           = 1;
        gS_BILLING_ITEM_RECODE_REQ.i8Result         = 1;
        gS_BILLING_ITEM_RECODE_REQ.i64ItemMallIndex = NrTSingleton <ItemMallItemManager> .Instance.GetItemIndex(this.strProductID);

        NrTSingleton <ItemMallItemManager> .Instance.RecodeErrorMessage(ref gS_BILLING_ITEM_RECODE_REQ, string.Format("requestPayment canceled", new object[0]));

        SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_BILLING_ITEM_RECODE_REQ, gS_BILLING_ITEM_RECODE_REQ);
        NrTSingleton <NrMainSystem> .Instance.m_bIsBilling = false;
    }
    public void returnSuccess(string result)
    {
        JSONNode jSONNode = JSON.Parse(result);
        string   text     = jSONNode[NIAPConstant.invokeMethod];

        Debug.Log("success! invokeMethod : " + text + " result : " + result);
        if (string.Equals(text, NIAPConstant.InvokeMethod.getProductDetails))
        {
            if (this.getProductDetailsSuccessEvent != null)
            {
                this.getProductDetailsSuccessEvent(NIAPResult.Build(result));
            }
            this.getProductDetailsSuccessEvent = null;
        }
        else if (string.Equals(text, NIAPConstant.InvokeMethod.requestPayment))
        {
            if (this.requestPaymentSuccessEvent != null)
            {
                this.requestPaymentSuccessEvent(NIAPPurchase.Build(result));
            }
            this.requestPaymentSuccessEvent  = null;
            this.requestPaymentCanceledEvent = null;
        }
        else if (string.Equals(text, NIAPConstant.InvokeMethod.requestConsume))
        {
            if (this.consumeSuccessEvent != null)
            {
                this.consumeSuccessEvent(NIAPResult.Build(result));
            }
            this.consumeSuccessEvent = null;
        }
        else if (string.Equals(text, NIAPConstant.InvokeMethod.getPurchases))
        {
            if (this.getPurchasesSuccessEvent != null)
            {
                this.getPurchasesSuccessEvent(NIAPResult.Build(result));
            }
            this.getPurchasesSuccessEvent = null;
        }
        else if (string.Equals(text, NIAPConstant.InvokeMethod.getSinglePurchase))
        {
            if (this.getSinglePurchaseSuccessEvent != null)
            {
                this.getSinglePurchaseSuccessEvent(NIAPPurchase.Build(result));
            }
            this.getSinglePurchaseSuccessEvent = null;
        }
    }
    public void returnCancel(string result)
    {
        Debug.Log("fail! returnCancel result : " + result);
        JSONNode jSONNode = JSON.Parse(result);
        string   text     = jSONNode[NIAPConstant.invokeMethod];

        Debug.Log("canceled! invokeMethod : " + text + " result : " + result);
        if (string.Equals(text, NIAPConstant.InvokeMethod.requestPayment))
        {
            if (this.requestPaymentCanceledEvent != null)
            {
                this.requestPaymentCanceledEvent(NIAPResult.Build(result));
            }
            this.requestPaymentSuccessEvent  = null;
            this.requestPaymentCanceledEvent = null;
        }
    }