Exemple #1
0
        public static WebRequestJob CreateGetStatusJob(ApplicationCase appCase, WebRequestJob currentJob)
        {
            
            var job = new WebRequestJob(WhvJobNames.GetStatus, appCase.AppId)
            {
                Method = RestSharp.Method.GET,
                JobType = JobTypes.Normal
            };

            //usl
            job.BaseUrl = @"https://onlineservices.immigration.govt.nz/";
            job.Resource = @"WorkingHoliday";

            //retrieving
            job.AddRetriever(new WebContentRetriever(@"<span.*referenceNumber.*>(?<refNum>\d+)<\/span>"));
            job.AddRetriever(new WebContentRetriever(@"<span.*dateCreated.*>(?<dateCreated>.*)<\/span>"));
            job.AddRetriever(new WebContentRetriever(@"<span.*status.*>(?<app_status>.*)<\/span>"));
            job.AddRetriever(new WebContentRetriever(@"<span.*paymentStatus.*>(?<pay_status>.*)<\/span>"));

            //
            job.AddMatcher(new WebContentMatcher(JobResults.Succeed, new string[]{
                                                @"<p>Welcome to the Working Holiday Schemes Online homepage.</p>"}));

            return job;
        }
Exemple #2
0
        //login homepage
        public static WebRequestJob CreateLoginHomeJob(ApplicationCase appCase)
        {
            var job = new WebRequestJob(CommonJobNames.LoginHomePage, appCase.AppId)
            {
                Method = RestSharp.Method.GET,
                JobType = JobTypes.Normal
            };

            //url
            job.BaseUrl = @"https://onlineservices.immigration.govt.nz/";
            job.Resource = @"secure/status.htm";

            //matcher
            job.AddMatcher(new WebContentMatcher(JobResults.Succeed,
                                                new string[] { @"<form name=""Login"" method=""post""" }));
            //retrieving
            job.AddRetriever(new WebContentRetriever(@"<form name=""Login"".*action=""(?<url>.*?)"""));
            job.AddRetriever(new WebContentRetriever(@"<input.*name=""__EVENTTARGET"".*value=""(?<eventTarget>.*?)"""));
            job.AddRetriever(new WebContentRetriever(@"<input.*name=""__EVENTARGUMENT"".*value=""(?<eventArgument>.*?)"""));
            job.AddRetriever(new WebContentRetriever(@"<input.*name=""__VIEWSTATE"".*value=""(?<viewstate>.*?)"""));
            job.AddRetriever(new WebContentRetriever(@"<input.*name=""__VIEWSTATEGENERATOR"".*value=""(?<viewstateGenerator>.*?)"""));

            return job;
        }
Exemple #3
0
        //card type selected
        public static WebRequestJob CreateCardTypeJob(ApplicationCase appCase, WebRequestJob currentJob)
        {
            var job = new WebRequestJob(CommonJobNames.CardType, appCase.AppId)
            {
                Method = RestSharp.Method.POST,
                JobType = JobTypes.Normal
            };

            //url
            job.BaseUrl = @"https://onlineservices.immigration.govt.nz/";
            job.Resource = string.Format(@"PaymentGateway/OnLinePayment.aspx?SourceUrl=https://onlineservices.immigration.govt.nz/WorkingHoliday/Application/SubmitConfirmation.aspx?ApplicationId={0}&ApplicationId={0}&ProductId=2", appCase.AppId);
            job.Parameters.Add("__EVENTTARGET", "");
            job.Parameters.Add("__EVENTARGUMENT", "");
            job.Parameters.Add("__VIEWSTATE", "/wEPDwULLTEyMDY4Njc4MDkPZBYCZg9kFgICAw9kFgICAw9kFgICBw8WCB4FY2xhc3MFCXNpdGV0YWJsZR4LY2VsbHNwYWNpbmcFATAeBmJvcmRlcgUBMB4LY2VsbHBhZGRpbmcFATIWAgIBDxYCHgZ2YWxpZ24FA3RvcBYCAgIPZBYCAgEPDxYCHglNYXhMZW5ndGgCZGRkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYCBSdjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJG9rSW1hZ2VCdXR0b24FK2N0bDAwJENvbnRlbnRQbGFjZUhvbGRlcjEkY2FuY2VsSW1hZ2VCdXR0b27cKn7Ve9p8wZAjvx+vD5veCXC0nw==");
            job.Parameters.Add("__VIEWSTATEGENERATOR", "64EC2CD5");
            job.Parameters.Add("__EVENTVALIDATION", "/wEWBAKbnrrRDQLsqKiNDgLAhozUDwL5l44EvLqaWXWqwKlxNHR20Ez1IFDyuaU=");
            job.Parameters.Add("ctl00$ContentPlaceHolder1$payorNameTextBox", appCase.Card.Holder);
            job.Parameters.Add("ctl00$ContentPlaceHolder1$okImageButton.x", "40");
            job.Parameters.Add("ctl00$ContentPlaceHolder1$okImageButton.y", "8");

            //
            job.AddRetriever(new WebContentRetriever(@"<form.*payment_type_selection.*action=""(?<form_action>.+?)"">"));
            job.AddRetriever(new WebContentRetriever(@"<input.*name=""hk"".*value=""(?<hk>.+)"">"));

            //
            job.AddMatcher(new WebContentMatcher(JobResults.Succeed, new string[] { @"1: Select your preferred payment method" }));

            return job;
        }
Exemple #4
0
        //card detail
        public static WebRequestJob CreateCardDetailJob(ApplicationCase appCase, WebRequestJob currentJob)
        {
            var job = new WebRequestJob(CommonJobNames.CardDetail, appCase.AppId)
            {
                Method = RestSharp.Method.POST,
                JobType = JobTypes.Normal
            };

            //url
            job.BaseUrl = @"https://webcomm.paymark.co.nz/";
            job.Resource = string.Format(@"hosted/{0}", currentJob.JobResultData["form_action"]);
            job.Parameters.Add("hk", currentJob.JobResultData["hk"]);
            job.Parameters.Add("hosted_responsive_format", "N");
            job.Parameters.Add(string.Format("card_type_{0}.x", appCase.Card.CardTypeName), "44"); //card_type_VISA.x:"36"
            job.Parameters.Add(string.Format("card_type_{0}.y", appCase.Card.CardTypeName), "18"); //card_type_VISA.y:"36"
            job.Parameters.Add("processingStage", "card_entry");
            job.Parameters.Add("future_pay", "");
            job.Parameters.Add("future_pay_save_only", "");

            //
            job.AddRetriever(new WebContentRetriever(@"<form action=""(?<form_action>.+?)"".*credit_card_entry"" >"));
            job.AddRetriever(new WebContentRetriever(@"<input.*name=""hk"".*value=""(?<hk>.+)"">"));

            //matcher
            job.AddMatcher(new WebContentMatcher(JobResults.Succeed, new string[] { @"2: Enter Your Card Details" }));

            return job;
        }