示例#1
0
        protected Boolean handleUnregistered(JsonObject t, UnregisteredErrorCallback mCallback, Callback mCallbackPost)
        {
            if (t.ContainsKey("response_error"))
            {
                JsonObject er = (System.Json.JsonObject)t["response_error"];
                Console.WriteLine("Contains resp error" + er["response_code"].Equals("40")
                                  );


                if (Int32.Parse(er["response_code"]) == 40)
                {
                    Console.WriteLine("COntains 40");

                    Console.WriteLine("Unregister");
                    try
                    {
                        UnregisteredError e = JsonConvert.DeserializeObject <UnregisteredError>(
                            t.ToString());
                        mCallback.onUserNotRegistered(e);
                        //   Console.WriteLine("UNREG");
                        return(true);
                    }
                    catch (Exception e)
                    {
                        mCallbackPost.onFailure(e);
                    }
                }
            }
            Console.WriteLine("Not Unregister");

            return(false);
        }
        public void inqueryPaymentStatus(FaspayPaymentStatusRequest mRequest, FaspayInquiryPaymentStatusCallback mCallback)
        {
            this.mHandler = mCallback;
            String     obj = JsonConvert.SerializeObject(mRequest);
            JsonObject o   = (System.Json.JsonObject)JsonObject.Parse(obj);

            sendRequestHttpPost(mFaspayConfig.getInqueryPaymentStatusUrl(), o, new InquiryPaymentStatusCallback(mCallback));
        }
        public void createBilling(FaspayPaymentRequest mRequest, FaspayCreateBillingServiceCallback mCallback)
        {
            this.mHandler = mCallback;
            String     obj = JsonConvert.SerializeObject(mRequest);
            JsonObject o   = (System.Json.JsonObject)JsonObject.Parse(obj);

            sendRequestHttpPost(mFaspayConfig.getCreateBillingUrl(), o, new CreateBillingCallback(mCallback));
        }
        public void cancelTransaction(FaspayCancelPaymentRequest mRequest, FaspayCancelPaymentCallback mCallback)
        {
            this.mHandler = mCallback;
            String     obj = JsonConvert.SerializeObject(mRequest);
            JsonObject o   = (System.Json.JsonObject)JsonObject.Parse(obj);

            sendRequestHttpPost(mFaspayConfig.getCancelTransactionUrl(), o, new CancelTransactionCallback(mCallback));
        }
        public void inquiryPaymentChannel(FaspayInquiryServiceCallback mCallback)
        {
            this.mHandler = mCallback;
            JsonObject request = new JsonObject();

            request.Add("request", "");
            request.Add("merchant_id", mFaspayConfig.user.merchantId);
            request.Add("merchant", mFaspayConfig.user.merchantName);
            request.Add("signature", mFaspayConfig.user.calculateSignature());
            sendRequestHttpPost(mFaspayConfig.getInquiryPaymentChannelUrl(), request, new InquiryPCCallback(mCallback));
        }