<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I get next billing date in ARB subscription? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/3187#M2891</link>
    <description>&lt;P&gt;You can't get it from Authnet but you don't need to. If you know the next billing date is the first of every month you can easily figure it out programmatically.&lt;/P&gt;</description>
    <pubDate>Fri, 14 May 2010 12:17:25 GMT</pubDate>
    <dc:creator>stymiee</dc:creator>
    <dc:date>2010-05-14T12:17:25Z</dc:date>
    <item>
      <title>How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/3185#M2889</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am using ARB Authorized.net subscription. my subscription start_date is&amp;nbsp; 01 Jan,2010. I know that ARB will automatically bill my amount on date 01 of every month. But for some reason i need to get my next billing date. For example : I have to update my subscription today (14 May,2010) and I want to get my next&amp;nbsp; billing date (which is 01 June,2010) from authorized.net. Can I get it from authorized.net or I have to get it manually from my site ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanx&lt;/P&gt;&lt;P&gt;Subhash.&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2010 06:21:48 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/3185#M2889</guid>
      <dc:creator>subhash</dc:creator>
      <dc:date>2010-05-14T06:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/3187#M2891</link>
      <description>&lt;P&gt;You can't get it from Authnet but you don't need to. If you know the next billing date is the first of every month you can easily figure it out programmatically.&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2010 12:17:25 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/3187#M2891</guid>
      <dc:creator>stymiee</dc:creator>
      <dc:date>2010-05-14T12:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/15974#M9050</link>
      <description>&lt;P&gt;what happens if you bill date is late in the month e.g July 31? WHat happens in Sept (only goes to 30)&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2011 16:12:55 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/15974#M9050</guid>
      <dc:creator>syoung68</dc:creator>
      <dc:date>2011-08-11T16:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16002#M9064</link>
      <description>&lt;P&gt;Have your database store the next billing date and then increment it by one month when the callback says a payment came in.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2011 21:30:32 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16002#M9064</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-08-11T21:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16028#M9077</link>
      <description>&lt;P&gt;I understand that, but does anyone know what the policy is from Authorize.net. If the subscription starts on Jan. 30 what happens in Feb? Does it get charged on March 2?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2011 02:55:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16028#M9077</guid>
      <dc:creator>syoung68</dc:creator>
      <dc:date>2011-08-12T02:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16048#M9087</link>
      <description>&lt;P&gt;I'd be interested in finding that out as well. My client just has all subscriptions start on the first of the next month, that way there's no confusion.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2011 11:44:14 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16048#M9087</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-08-12T11:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16060#M9093</link>
      <description>&lt;P&gt;If I understand correctly the "next billing date" for a "monthly" period is always calculated by adding the days of the current month to the latest billing date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;1. 15.Jan&lt;/P&gt;&lt;P&gt;2. +31days = 15.Feb&lt;/P&gt;&lt;P&gt;3. +28/29days = 15.Mar&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So a monthly billing happens always on the "X.th" of a month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for February there will always be a little hickup&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;1. 31.Jan (last of month)&lt;/P&gt;&lt;P&gt;2. +31days = 2./3.Mar (the hickup)&lt;/P&gt;&lt;P&gt;3. +28 days = &amp;nbsp;31.Mar (last of month)&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2011 12:35:57 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16060#M9093</guid>
      <dc:creator>abernh</dc:creator>
      <dc:date>2011-08-12T12:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16064#M9095</link>
      <description>&lt;P&gt;You could always use CIM and just program the billing yourself - that way you have more control over when the billing happens and can set it up any way you prefer.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2011 13:55:53 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16064#M9095</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-08-12T13:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16080#M9102</link>
      <description>&lt;P&gt;Hey guys,&lt;BR /&gt;&lt;BR /&gt;If you set up a subscription to bill on daysthat don't exist in other months, like the 31st, then in those months without 31 days, the payment will run on the last day of the month, whatever that may be. ﻿So for instance, if you regularly bill on the 30th, then in February, the bill would run on the 28th. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Michelle&lt;BR /&gt;Developer Community Manager﻿&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2011 19:33:35 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16080#M9102</guid>
      <dc:creator>Michelle</dc:creator>
      <dc:date>2011-08-15T19:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16088#M9106</link>
      <description>&lt;P&gt;That makes good logical sense, thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2011 21:10:41 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16088#M9106</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-08-12T21:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16138#M9130</link>
      <description>&lt;P&gt;Thank you so much. That make sense.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2011 16:06:51 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16138#M9130</guid>
      <dc:creator>syoung68</dc:creator>
      <dc:date>2011-08-15T16:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16156#M9138</link>
      <description>&lt;P&gt;I realize that this is not a PHP forum, but I am looking for suggestions. I can calculate the last day of next month based on the current date so if today is 01/31 I can get 02/28, but I am not sure how to approach this if I am only storing the ARB start date. e.g. Start date = 01/31 and now it is 04/02 and I want to display the next bill date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2011 21:40:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16156#M9138</guid>
      <dc:creator>syoung68</dc:creator>
      <dc:date>2011-08-15T21:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16174#M9147</link>
      <description>&lt;P&gt;Depends. If you know it's 2011-04-02, then all you have to do is calculate how many days there are in the current month and then put that number in place of the 2, and to do that just requires knowing how many days each month has and how to calculate whether February has 28 or 29 days. Fairly simple. If you don't know it's 2011-04-02, you can use the date function to give you that information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your subscription started on the 27th, of course, you don't need to even bother with all of that - it's always going to be the 27th.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2011 00:05:17 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16174#M9147</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-08-16T00:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16190#M9155</link>
      <description>&lt;P&gt;I think I have it for anyone else who is interested. Any thoughts and/or improvements are appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/**
 * Function to calculate the same day one month in the future.
 *
 * This is necessary because some months don't have 29, 30, or 31 days.
 * If the﻿next month doesn't have as many days as this month, the 
 * anniversary will be﻿ moved up to the last day of the next month.
 *
 * @param $start_date
 *    Function assumes that date is pulled from MySql YYYY-MM-DD
 *
 * @return $nextBillDate
 *    Formmated in common US date format MM/DD/YYYY
 */

function getNextBillDate($start_date) {

   $date_array = explode("-",$start_date); // split the array

   $year = $date_array[0];
   $month = $date_array[1];
   $day = $date_array[2];

   if (date("d")  $day) {
      $billDay = $day;
   }else{
      $billDay = $billMonthDays;
   }

   $nextBillDate = $billMonth . "/" . $billDay . "/" . date("Y");

   return $nextBillDate;
}
&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Aug 2011 14:18:43 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16190#M9155</guid>
      <dc:creator>syoung68</dc:creator>
      <dc:date>2011-08-16T14:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16196#M9158</link>
      <description>&lt;P&gt;Well, you're getting a bit closer, but there seem to be some errors and no explanation of where $billMonthDays is coming from.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2011 14:55:07 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16196#M9158</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-08-16T14:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16198#M9159</link>
      <description>&lt;P&gt;﻿Sorry about that, several lines keeping getting removed when I paste and I did not notice it before...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function getNextBillDate($start_date) {

   $date_array = explode("-",$start_date); // split the array

   $year = $date_array[0];
   $month = $date_array[1];
   $day = $date_array[2];

   if (date("d") &amp;lt;= $day) {
      $billMonth = (int)date("m");
   }else{
      $billMonth = date("m")+1;
   }
   $billMonthDays = cal_days_in_month(CAL_GREGORIAN, ($billMonth), date("Y"));

   if ($billMonthDays &amp;gt; $day) {
      $billDay = $day;
   }else{
      $billDay = $billMonthDays;
   }

   $nextBillDate = $billMonth . "/" . $billDay . "/" . date("Y");

    return $nextBillDate;
}

&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Aug 2011 15:05:43 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/16198#M9159</guid>
      <dc:creator>syoung68</dc:creator>
      <dc:date>2011-08-16T15:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get next billing date in ARB subscription?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/17218#M9642</link>
      <description>&lt;P&gt;Someone brought an error to my attention. The following returns an error if we are in the month of December...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$billMonth = date("m")+1;﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are using PHP 5.3+, you can use the following...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$billMonth = date_format(date_modify(date_create(), 'first day of next month'), 'm');﻿&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2011 16:08:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-can-I-get-next-billing-date-in-ARB-subscription/m-p/17218#M9642</guid>
      <dc:creator>syoung68</dc:creator>
      <dc:date>2011-09-21T16:08:05Z</dc:date>
    </item>
  </channel>
</rss>

