PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Determining Days Left in Month and then Calculating Prorata Price

  1. jerrylevine
    Member

    So, I'm relatively new to writing customizations, but...

    I am starting a project that will charge the user $100 on the first day of each month. However, if a user signs up on any day besides the first day, I only want to charge that user the portion of the fee that would begin on the day they sign up and then start the $100/month payment on the first day of the next month.

    EXAMPLE: Sally signs up on August 12. She sees two fields - one is "payment now" and the other is "payment on September 1". August has 31 days, so there are 19 days left, meaning Sally will be charged [$100 * (19/31)], or $61.29.

    Any help?

    Posted 12 years ago on Thursday August 2, 2012 | Permalink
  2. jerrylevine
    Member

    Basically, I need to charge for the remainder of the current month and then begin the next period, for every user, on the 1st. PayPal can manage the second part; how do I do the first part?

    Posted 12 years ago on Thursday August 2, 2012 | Permalink
  3. I can't think of a way to do this automatically with one form. There is the concept of a trial period, which can be free or paid, and can be different lengths (days or months.) I was thinking you could set up a $100/month subscription, then calculate the amount of time remaining in the current month, then change the time frame and price for the trial. That would enable you to modify the amount of the first payment, and continue with $100 per month subscriptions after that. However, looking at the documentation, it does not appear there are hooks in place to allow you to change these items in the PayPal feed.

    http://www.gravityhelp.com/documentation/page/PayPal_Add-on_Developer_Docs

    The other option I was thinking of would charge the first month as a product, and sign them up for a monthly $100 subscription at the same time. So, you could have a product on your form, with a price calculated before the form is shown, to cover the balance of the month. They would pay for that. And that would also require they subscribe to the $100 per month.

    I'm not sure how "pay now" and "pay September 1st" would work. If they select "pay now" they pay for the balance of the month, and also start paying $100/month on the first? If they select "Pay September 1st" what happens? Their subscription does not start until September first? I'm not sure how that would work with Gravity Forms.

    Can you just charge them $100/month recurring, based on the date they subscribed? So, if I signed up today, my billing date would always be the 3rd of the month. That's the simple way to do it. I'm not sure how hard it would be to set up anything more complicated in Gravity Forms. Let us know your thoughts.

    Posted 12 years ago on Friday August 3, 2012 | Permalink