Hello,
Apologies in advance if this is an error on my part.
I've set up ARB and PayPal WPS and am trying to sell automatically renewing subscriptions. Near as I can tell, everything is working fine in PayPal. I see a charge for the base price, and a happy subscription.
But for credit card transactions, I am seeing a charge for the base price followed quickly by an order with status Pending for the recurring fee. The credit card appears to be charge twice. I was hoping to see a charge for the base price, and no recurring fee charge until it is time for the subscription to renew.
My recurring fee settings for the product have "Initial Charge" of zero and "Regular Interval" set to the subscription length. Recurring fee amount has the box checked to be the same as the selling price.
I played around a bit with "Initial Charge" settings, but couldn't find a way to keep PayPal happy.
Suggestions? Is this a bug, or am I doing something wrong?
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | uc_recurring_hosted-startDate.patch | 1.06 KB | bpirkle |
Comments
Comment #1
bpirkle commentedI'm looking at this some more, and it seems that in the function "uc_recurring_hosted_authorizenet_arb_process", the $fee->next_charge value is being sent as (roughly) the current time, rather than a subscription's duration in the future. This value isn't used in uc_recurring for WPS, which might explain why WPS works for me while ARB doesn't.
$fee->next_charge is used for WPP, to determine whether or not to call function 'uc_recurring_vodaplex_determine_past_due". I tried to look into that function to see if/how $fee->next_charge was being used therein, but couldn't find an implementation in uc_recurring (boggle).
My current best guess at a workaround is to do this in "uc_recurring_hosted_authorizenet_arb_process", just before the big array is created:
$fee->next_charge += ($length * 86400);
I've tried something like this (actual test code has debugging output and such) and it looks promising, but I need to do more testing to confirm.
Comment #2
longwaveI found something similar while developing uc_recurring support for the Sage Pay Direct module. $fee->next_charge was somehow getting set to a smallish integer instead of a timestamp if one of the processing functions failed in some unidentified way, so payment attempts were made immediately, not after the initial interval. Haven't been able to track it down yet, and I can't seem to make it recur now I moved some of my code around, but figured I should add to this as perhaps it's not ARB specific.
Comment #3
bpirkle commentedThank you, longwave. I may be seeing this as well. I added code similar to what I described in #1 and it usually works. But some subscriptions are still showing up on the A.net side with the first renewal payment being processed immediately rather than after one subscription's duration. My current suspicion is that the bug you mention is causing me to send A.net a date in the past, and it is using "now" instead of the invalid date.
I've added in some additional debugging, so we'll see what else I can learn. But I'm thinking my workaround is that if $fee->next_charge is smaller than the current time, I should set it to the current time before applying my tweak from #1.
If I eventually get all this working happily, I'll post a patch.
Comment #4
bpirkle commentedFollowup: seems the bug mentioned in #2 wasn't affecting us after all. I found a glitch in my workaround code related to units. (We sell both monthly and yearly subscriptions. My workaround was happy for yearly, but not monthly.)
I've fixed the glitch and hopefully have a functioning workaround now. I'll let it run for a few days and see what happens, then report back here. If all is well, I'll clean out my debugging code and attach a patch.
Comment #5
bpirkle commentedHad a decent number of orders come through since my last comment and they seemed okay. So I went ahead and rolled a patch.
Comment #6
avpadernoI am closing this issue, since it's for a Drupal version no longer supported.