Subscription Pay Failed, but user still has access

Discussion in 'Troubleshooting' started by story, May 27, 2008.

  1. story

    story New Member

    Joined:
    Aug 29, 2006
    Messages:
    21
    There seems to be a huge snafu in the "failed" subscription payment process -- A user's payment fails, the account appears to be canceled (in PayPal), BUT the user still has access - indefinitely.

    I've been getting an inordinate number of "subscription payment failed," notifications. Looking into it and following the history of one user - I discover that it's easy to shut down the source of payment while aMember continues to allow access.


    Specifically:
    One of our users has a monthly recurring account ($10). In April, after attempting to collect funds 4 times over a period of 7 days, PayPal reports that the user's subscription is "cancelled" on April 17th - the last attempt at payment.

    However, I find the member in the database which shows the account as still active.

    And, I successfully log in under that user's name, the recurring subscription still shows active.

    A cancelled account is supposed to shut down after 30 days....

    How can this be? Has anyone encountered this? Can anyone help?

    Thanks
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Did you receive the cancel IPN, whats it say in your error log?

    David
  3. eleven

    eleven aMember Pro Customer

    Joined:
    Jan 28, 2006
    Messages:
    38
    A failure is different than a cancel.
    A payment will fail 3 times before being officially canceled within paypal.
    Even at that time , aMember by default won't remove access until the subscription ends. Thus if I paid today for the month and cancel in 15 days, I still get access for the remainder of the month.

    There is a work around for immediate removal upon cancellation however.
    You need to modify some code. Ask Alex and support. I don't remember the actual code changes.
  4. story

    story New Member

    Joined:
    Aug 29, 2006
    Messages:
    21
    Yes, the account should automatically cancel, and at the end of the cycle, the user would no longer have access.

    Unfortunately, I have learned this is not the case.

    It may be the fault of PayPal - the account is never actually "canceled" - there are three attempts to collect money, but the account drops off the radar after that.

    I am now manually entering end dates for a bunch of failed payments. :(
  5. story

    story New Member

    Joined:
    Aug 29, 2006
    Messages:
    21
    Thanks, eleven, I'll check with Alex.
  6. story

    story New Member

    Joined:
    Aug 29, 2006
    Messages:
    21
    Just confirmed again today - someone's subscription failed in June 2007.
    The account is still active today. PayPal never cancelled.
  7. jimjwright

    jimjwright New Member

    Joined:
    Sep 12, 2007
    Messages:
    162
    Hello,

    Just curious what protection method are you using to protect your content? I would think that even if you didn't receive any type of notification that the renewal failed that the subscription would still be expired because the expire date in the payment record would still not allow access.

    In your example of the user that still had access a year later after payment failure what was the expiration date(s) of all payment records for that user?

    As long as $db->check_access(...) is called it will look at all payment records for a user and if none are active access will be denied. So I can only conclude that your protection method is not calling $db->check_access() or else you have a payment record with an expiration date in the future or possibly null.

    Jimmy
  8. story

    story New Member

    Joined:
    Aug 29, 2006
    Messages:
    21
    Thanks for the reply Jimmy, but (sadly) I am not a programmer. The only protection I know we've been using is the PHP_include plugin. Where is $db->check_access(...)?

    Re: expiration date in the future - yes, they all are. There is a note in the admin panel at the "end date" "This date reserved to internally
    represent end of recurring subscription ..."

    So how does this date ever change - I thought that when there's a failed payment, PayPal automatically cancels the account.(?)

    I have been using aMember for 5 years with no problem. But when our revenues dropped in half about 4-5 months ago, -- maybe this is why? And users are gaming the system? I submitted a trouble ticket to Alex, but it still has not been resolved.

    Every day, I'm spending time on this to clean it up - today I see one person signed up 5/18, payment failed 5/21 and to this day, he's still had access, no further attempts at payment, no PayPal cancellations. (I manually closed it out). I look at the payment record, and all it does is show that the payment failed. There is no "expire date"

    (help?)
  9. jimjwright

    jimjwright New Member

    Joined:
    Sep 12, 2007
    Messages:
    162
    Hello,

    I am assuming your using PayPal if not then ignore my response. :)

    I would then assume that you have a broken link and are not getting any IPN notifications from PayPal. Are any new payments going through or is it only recurring subscriptions that are having problems. I have heard that since April recurring subscriptions has been acting flakey on PayPal. I would verify that IPN is working correctly. I believe for PayPal Amember sets the expiration date is to 2012-12-31 for recurring subscriptions. This is okay but it really relies on PayPal IPN mechanism to work where you receive the transanction subscr_eot from PayPal. This is what resets the expiration date so that it expires. Check your error/debug logs. Again if using paypal_r I believe IPN has to be working and I have heard that this has been flakey in the last couple of months from the PayPal side of things. I don't personally use PayPal but this is how I believe things to work.

    This is exactly why IPN from PayPal to your server has to be working flawlessly. PayPal might have cancelled from the PayPal side of the transanction but until Amember sees the cancellation it cannot cancel from your side of the transanction. Amember cannot properly expire payment records if IPN is not working or not notifying Amember that the subsciption has expired. You have to think of the Amember database and the PayPal database as being loosely consistent. Loosely consistent dbs work most of the time but rely on transanction updates to eventually filter their way to all DBs. Its not unlike DNS name propogation eventually DNS name propogation will work but there will be a short period of time where the information is inconsistent. But it will never work if the non-authoritive nameserver (Amember) used to resolve DNS names never gets updates from the master nameserver (PayPal) to update its local tables. Same concept with IPN, payment processors, and Amember. If dbs stay in a inconsistent state then someone loses. In this case you lose, people get free access, and you have to manually (or in a automated script) make the dbs (Amember and PayPal) consistent once again.

    As a last resort another thing to investigate is if you are on a shared host is that maybe the PayPal server has been IP blocked. Strange as it sounds this has happened to me when using CCBILL on a shared hosting plan. Because of this I upgraded to VPS plan. If you have VPS plan or dedicated then the utility tcpdump will log all packets your server receives that you can use to verify if you are receiving notifications from PayPal.

    Of course this is all conjecture it might have nothing to do with PayPal and IPN. By the way IPN is Instant Payment Notification or in other words its an asynchronous mechanism for a payment processor to notify you (Amember) the status of a payment.

    So I would do the following:

    1. Look at the Error/Debug logs to see if you are getting IPN notifications for recurring subscriptions from PayPal.
    2. If not contact PayPal to find out why or check IP blocking.
    3. If you are getting IPN's then enter support ticket and provide debug logs to Alex.
    4. Look at the Error/Debug logs again. There are always clues that can be found here.


    Jimmy
  10. story

    story New Member

    Joined:
    Aug 29, 2006
    Messages:
    21
    Yes.

    All other payments are going through (or seem to be fine)



    Hm. I'll look into this and your other suggestions.
    Thanks

    Meantime, Alex did some work and asked me to check to see how it's working. Right now, I have had a few failed payments, but need to wait out the cycle (paypal tries to resubmit for payment 3 times - which is up to about 3 weeks.)

    Now I have a new problem - Members cannot upgrade at all. I've got a trouble ticket in with Alex, but posting the failed DB error in a new thread.

    Working hard to get away from PayPal, but it's strange I haven't had any problems at all for years till now. Having said that - I did change hosts (HostGator) last November. And it is not a dedicated server. Will check with them.

    Thanks, Jimmy
  11. story

    story New Member

    Joined:
    Aug 29, 2006
    Messages:
    21
    unfortunately....
    I have to open this again. Alex worked on it for me (thanks) and now PayPal is cancelling after three attempts at payment, but it is not going to aMember.

    So it does sound like an IPN issue - but it is only an issue with failed payments. Is that possible? So user has access indefinitely with no more payments. Weirdly, one record I tracked showed monthly payments in PayPal, but not in aMember.

    when you say:
    "If dbs stay in a inconsistent state then someone loses. In this case you lose, people get free access, and you have to manually (or in a automated script) make the dbs (Amember and PayPal) consistent once again."

    how to make the db consistent?


    IPN is working with all other transactions (recurring subscriptions).


    thanks...
  12. ashpeters

    ashpeters New Member

    Joined:
    Feb 23, 2009
    Messages:
    8
    Is this just an isolated fault for this user or is amember not performing here?

    Either way, it has put me off purchasing.

    Ash

Share This Page