public static GetCustomFieldsResponse GetCustomFields(string billId)
        {
            GetCustomFieldsResponse servicesTypes = new GetCustomFieldsResponse();

            ErrorResponse errorResponse = validateCredentials(credentials);
            string        responseCode  = errorResponse.responseCode;

            if (errorResponse.responseCode != "00")
            {
                servicesTypes.responseCode = errorResponse.responseCode;
                servicesTypes.responseMsg  = errorResponse.responseMsg;
                return(servicesTypes);
            }

            if (String.IsNullOrEmpty(billId))
            {
                servicesTypes.responseCode = "14";
                servicesTypes.responseMsg  = "Missing billId parameter";
                return(servicesTypes);
            }

            try
            {
                var response = WebClientUtil.GetResponse(credentials.url, RemitaBillerUrl.GetServiceTypes(billId), _header);

                servicesTypes = JsonConvert.DeserializeObject <GetCustomFieldsResponse>(response);
            }
            catch (Exception)
            {
                throw;
            }
            return(servicesTypes);
        }
        public static PaymentStatusResponse PaymentStatus(string transactionId)
        {
            PaymentStatusResponse paymentStatusResponse = new PaymentStatusResponse();
            ErrorResponse         errorResponse         = validateCredentials(credentials);
            string responseCode = errorResponse.responseCode;

            if (errorResponse.responseCode != "00")
            {
                paymentStatusResponse.responseCode = errorResponse.responseCode;
                paymentStatusResponse.responseMsg  = errorResponse.responseMsg;
                return(paymentStatusResponse);
            }

            if (String.IsNullOrEmpty(transactionId))
            {
                paymentStatusResponse.responseCode = "22";
                paymentStatusResponse.responseMsg  = "Missing transactionId parameter";
                return(paymentStatusResponse);
            }
            try
            {
                var response = WebClientUtil.GetResponse(credentials.url, RemitaBillerUrl.PaymentStatus(transactionId), _header);
                paymentStatusResponse = JsonConvert.DeserializeObject <PaymentStatusResponse>(response);
            }
            catch (Exception)
            {
                throw;
            }
            return(paymentStatusResponse);
        }
        public static GetBillersResponse GetBillers()
        {
            GetBillersResponse billers = new GetBillersResponse();

            //Console.WriteLine("Getting Error response. . .");
            ErrorResponse errorResponse = validateCredentials(credentials);
            //Console.WriteLine("Error response. . ."+ errorResponse.responseMsg);

            string responseCode = errorResponse.responseCode;

            if (errorResponse.responseCode != "00")
            {
                billers.responseCode = errorResponse.responseCode;
                billers.responseMsg  = errorResponse.responseMsg;
                return(billers);
            }

            try
            {
                var response = WebClientUtil.GetResponse(credentials.url, RemitaBillerUrl.GetBillers(), _header);
                billers = JsonConvert.DeserializeObject <GetBillersResponse>(response);
            }
            catch (Exception)
            {
                throw;
            }
            return(billers);
        }
        public static GetRRRDetailsResponse GetRRRDetails(string rrr)
        {
            GetRRRDetailsResponse rrrDetails = new GetRRRDetailsResponse();

            ErrorResponse errorResponse = validateCredentials(credentials);
            string        responseCode  = errorResponse.responseCode;

            if (errorResponse.responseCode != "00")
            {
                rrrDetails.responseCode = errorResponse.responseCode;
                rrrDetails.responseMsg  = errorResponse.responseMsg;
                return(rrrDetails);
            }

            if (String.IsNullOrEmpty(rrr))
            {
                rrrDetails.responseCode = "20";
                rrrDetails.responseMsg  = "Missing rrr parameter";
                return(rrrDetails);
            }
            try
            {
                var response = WebClientUtil.GetResponse(credentials.url, RemitaBillerUrl.GetRRRDetails(rrr), _header);

                rrrDetails = JsonConvert.DeserializeObject <GetRRRDetailsResponse>(response);
            }
            catch (Exception)
            {
                throw;
            }
            return(rrrDetails);
        }