When making a successful recurring purchase with a Monthly schedule, the first payment is made immediately at PayPal Manager. However, the second payment is scheduled for 1 week out from the first payment, rather than 1 month, even though the Payment Schedule in PayPal Manager correctly states Monthly. I think there is some date miscalculation in the module when setting up the first recurring payment.

Comments

kwinters’s picture

Title: Recurring Purchase scheduled second payment incorrect » Start Dates for Many Payment Periods Not Implemented
Assigned: Unassigned » kwinters
Status: Active » Needs work

Function _uc_pfp_calc_start_date($period) not only has the wrong calculation for monthly, it also doesn't correctly implement a number of other periods.

I can write a test for this pretty easily, so I'll fix it and you concentrate your efforts on things I can't test because I don't have a recurring PFP account.

kwinters’s picture

Version: 5.x-1.0-beta1 » 6.x-1.0-beta2
Status: Needs work » Fixed

Fixed in the devel version of both d6 and d5. Changes:

* Removed a TODO in the recurring class file which was already completed
* Major rewrite of _uc_pfp_calc_start_date, which did not implement most of the period types
* Monthly / yearly periods needed to have consistent billing dates across months with varying numbers of days (round 29/30/31st up to 1st)
* Added a new optional $fromTime field to _uc_pfp_calc_start_date (mostly for testing purposes)
* Created many simpletest assertions for _uc_pfp_calc_start_date
* Added a description to the period field in the schedule form to reflect behavior of monthly / yearly periods.
* Improved automatically generated description language for terms of a schedule.
* Removed close php tags in a variety of files.

Matthew, please confirm that this works for you. If you want to test it for yourself without using the devel function, just copy in the updated function _uc_pfp_calc_start_date code.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.