public HpsPayPlanSchedule EditSchedule(HpsPayPlanSchedule schedule)
        {
            if (schedule == null)
                throw new HpsInvalidRequestException(HpsExceptionCodes.InvalidArgument,
                    "schedule must be an instance of HpsPayPlanSchedule.", "schedule");

            schedule.EndDate = string.IsNullOrEmpty(schedule.EndDate) ? null : schedule.EndDate;
            schedule.StartDate = string.IsNullOrEmpty(schedule.EndDate) ? null : schedule.EndDate;
            schedule.NextProcessingDate = string.IsNullOrEmpty(schedule.NextProcessingDate) ? null : schedule.NextProcessingDate;
            schedule.PreviousProcessingDate = string.IsNullOrEmpty(schedule.PreviousProcessingDate) ? null : schedule.PreviousProcessingDate;

            var data = schedule.GetEditableFieldsWithValues();
            var response = DoRequest("PUT", "schedules/" + schedule.ScheduleKey, data);

            return HydrateObject<HpsPayPlanSchedule>(response);
        }
        /* SCHEDULE METHODS */

        public HpsPayPlanSchedule AddSchedule(HpsPayPlanSchedule schedule)
        {
            if (schedule == null)
                throw new HpsInvalidRequestException(HpsExceptionCodes.InvalidArgument,
                    "schedule must be an instance of HpsPayPlanSchedule.", "schedule");

            var data = schedule.GetEditableFieldsWithValues();
            data.Add("customerKey", schedule.CustomerKey);
            data.Add("numberOfPayments", schedule.NumberOfPayments);

            var response = DoRequest("POST", "schedules", data);
            return HydrateObject<HpsPayPlanSchedule>(response);
        }