pro-rate subscription to the end of the month
pro-rate subscription to the end of the month
Is there a way to do this through the interface, or would this be custom code? I'm trying to wrap my head around how to do this.
Re: pro-rate subscription to the end of the month
I should probably provide a little more detail.
I've figured out how to calculate it in the payment provider class I've created in the DoAuthorizeRecurring method.
double proratedAmount(string Amount)
{
double pricing = Convert.ToDouble(Amount);
DateTime nextDate = Convert.ToDateTime(DateTime.Now.AddMonths(1).Month.ToString() + "/1/" + DateTime.Now.AddMonths(1).Year.ToString() + " 00:00:00");
DateTime currentDate = DateTime.Now;
TimeSpan ts = nextDate - currentDate;
int daysbetween = ts.Days;
int daysinmonth = System.DateTime.DaysInMonth(currentDate.Year, currentDate.Month);
double priceperday = pricing / daysinmonth;
double proratedprice = priceperday * daysbetween;
return proratedprice;
}
I would like able commerce to be able to say as much in the interface. Right now the customer thinks they have been charged the full 9.99 when they've actually only been charged 5.33, the 9.99 will start when the first of the month billing comes around. How can I adjust email confirmations and order summaries to reflect?
Thanks,
Jeff
I've figured out how to calculate it in the payment provider class I've created in the DoAuthorizeRecurring method.
double proratedAmount(string Amount)
{
double pricing = Convert.ToDouble(Amount);
DateTime nextDate = Convert.ToDateTime(DateTime.Now.AddMonths(1).Month.ToString() + "/1/" + DateTime.Now.AddMonths(1).Year.ToString() + " 00:00:00");
DateTime currentDate = DateTime.Now;
TimeSpan ts = nextDate - currentDate;
int daysbetween = ts.Days;
int daysinmonth = System.DateTime.DaysInMonth(currentDate.Year, currentDate.Month);
double priceperday = pricing / daysinmonth;
double proratedprice = priceperday * daysbetween;
return proratedprice;
}
I would like able commerce to be able to say as much in the interface. Right now the customer thinks they have been charged the full 9.99 when they've actually only been charged 5.33, the 9.99 will start when the first of the month billing comes around. How can I adjust email confirmations and order summaries to reflect?
Thanks,
Jeff
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: pro-rate subscription to the end of the month
You could set your product to use a variable price and calculate that price every day using code. Only don't use the input box where the customer can enter a price.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx