private ARBSubscriptionUnitEnum GetSubscriptionUnit(IntervalUnit Unit) { if (Unit == IntervalUnit.Days) { return(ARBSubscriptionUnitEnum.days); } if (Unit == IntervalUnit.Months) { return(ARBSubscriptionUnitEnum.months); } throw new Exception("Interval unit of " + Unit.ToString() + " not supported by Authorize.NET"); }
public static string GetScheduleDescription(int repeatInterval, IntervalUnit repeatIntervalUnit, int repeatCount = 0) { string result = "Repeat "; if (repeatCount > 0) { result += repeatCount + " times "; } result += "every "; string unitStr = repeatIntervalUnit.ToString().ToLower(); if (repeatInterval == 1) { result += unitStr; } else { result += repeatInterval + " " + unitStr + "s"; } return(result); }
/// <summary> /// Returns a string that represents the current object. /// </summary> /// <returns> /// A string that represents the current object. /// </returns> public override string ToString() { return(string.Format("{0} {1}{2}", _amount, _mode.ToString().ToLower(), _amount > 1 ? "s" : string.Empty)); }