public String CheckPayooAccount(String username)
        {
            String result = "";
            try
            {
                Credential credential = new Credential();
                credential.APIUsername = ConfigurationManager.AppSettings["APIUsername"];
                credential.APIPassword = ConfigurationManager.AppSettings["APIPassword"];
                credential.APISignature = ConfigurationManager.AppSettings["APISignature"];
                Caller caller = new Caller();
                caller.InitCall(ConfigurationManager.AppSettings["PayooBusinessAPI"], credential,
                    Server.MapPath(@"..\App_Data\Certificates\biz_pkcs12.p12"), "alpe", Server.MapPath(@"..\App_Data\Certificates\payoo_public_cert.pem"));

                CheckPayooAccountRequestType req = new CheckPayooAccountRequestType();
                req.AccountID = username; // agentb2 ; vimp71 | [email protected]

                CheckPayooAccountResponseType res = (CheckPayooAccountResponseType)caller.Call("CheckPayooAccount", req);
                if (res.Ack == AckCodeType.Success)
                {
                    result = "Valid";
                }
                else
                {
                    result = "InValid Account";
                }

            }
            catch (Exception ex)
            {
                result = "False";
                throw ex;
            }
            return result;
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Methods call raceway");

            Caller    caller  = new Caller();
            ArrayList results = caller.Call(1);                 // once to get things up and runnin'

            results = DoRace(caller, "10000000");

            foreach (Result resultItem in results)
            {
                System.Console.WriteLine($"{resultItem.Name} : {resultItem.GetCallsPerSecond(false)}");
            }
        }
示例#3
0
        private static ArrayList DoRace(Caller caller, string laps)
        {
            GC.Collect();
            GC.WaitForPendingFinalizers();

            int       iterations = Int32.Parse(laps);
            ArrayList results    = caller.Call(iterations);

            //ClearPercentageValues();

            //currentStep = 0;
            //fastestCallsPerSecond = FindFastest(includeSetupTime);

            //callsPerPixel = fastestCallsPerSecond / 500F;

            //timer1.Enabled = true;
            return(results);
        }
示例#4
0
        public MainPage()
        {
            this.InitializeComponent();
            action.Click += async(s, e) =>
            {
                var syncResponse = Caller <Service.Contract.IServiceContract> .Call(service => service.GetInt());

                AddResultToDisplay(syncResponse);

                var asyncResponse = await Caller <Service.Contract.IServiceContract> .CallAsync(service => service.GetInt());

                AddResultToDisplay(asyncResponse);

                var syncItem = Caller <Service.Contract.IServiceContract> .Call(service => service.GetItem("Item Name", 5));

                AddResultToDisplay(syncItem.Name);

                var asyncItem = await Caller <Service.Contract.IServiceContract> .CallAsync(service => service.GetItem("Async Item Name", 5));

                AddResultToDisplay(asyncItem.Name);
            };
        }
示例#5
0
文件: Caller.cs 项目: uvbs/bot-2016
 public uint Call(params object[] parameters)
 {
     return(Caller.Call(Address, CallingConvention, parameters));
 }
        public string RefundAll(int IdDuan)
        {
            string result = "false";

            var dautu = db.EntityDauTus.Where(g => g.IdDuAn == IdDuan).ToList();
            foreach (var item in dautu)
            {
                Credential credential = new Credential();
                credential.APIUsername = ConfigurationManager.AppSettings["APIUsername"];
                credential.APIPassword = ConfigurationManager.AppSettings["APIPassword"];
                credential.APISignature = ConfigurationManager.AppSettings["APISignature"];
                Caller caller = new Caller();
                caller.InitCall(ConfigurationManager.AppSettings["PayooBusinessAPI"], credential,
                    Server.MapPath(@"..\App_Data\Certificates\biz_pkcs12.p12"), "alpe", Server.MapPath(@"..\App_Data\Certificates\payoo_public_cert.pem"));

                UpdateOrderStatusRequestType request = new UpdateOrderStatusRequestType();
                request.NewStatus = OrderStatus.Cancelled;
                request.ShopID = long.Parse(ConfigurationManager.AppSettings["ShopID"]);
                request.UpdateLog = "Dự án kết thúc thất bại.";
                request.OrderID = item.OrderID_Payoo;
                UpdateOrderStatusResponseType response = (UpdateOrderStatusResponseType)caller.Call("UpdateOrderStatus", request);
                if (response.Ack == AckCodeType.Success || response.Ack == AckCodeType.SuccessWithWarning)
                {
                    result = "Refund success";
                }
                else
                {
                    return "Fail";
                }
            }
            return result;
        }