Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: RFD on June 07, 2018, 06:38:11 AM

Title: paid subscription failure
Post by: RFD on June 07, 2018, 06:38:11 AM
SMF 2.0.15

paid subscription service had been working well since its installation over 2 months ago, with 54 subscriptions to date.  when a user creates a paid subscription, notifications from both paypal and SMF are generated to the site admin.  yesterday a paypal message was generated, but not one from SMF.  checking the user's profile, his membergroup wasn't updated to reflect the paid subscription and he's not listed in the SMF admin paid subscription summary page - however his payment was listed in paypal.

here's the interesting part - attempting to manually add this user to paid subscriptions ("Add New Subscriber") returns an error message ...

"This member is already subscribed to this subscription. Please edit their existing subscription."

but there is no existing paid subscription listing shown for this user in the paid subscriptions summary. somehow, there was a disconnect between paypal and SMF in such a manner that SMF knows there is a subscription for this user, but never logged it nor updated the user's membergroup.

while i can manually update the membergroup he paid for, and have done so, it will have to be manually monitored for his yearly expiration date since his account is not listed in the paid subscriptions summary.  so far, i don't see a way of correcting this in SMF .... ?


Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 07, 2018, 05:39:21 PM
Link to you forum?
Title: Re: paid subscription failure
Post by: RFD on June 07, 2018, 05:56:16 PM
ah, there ya are!

the usual culprit ..... www.tradgang.com/tgsmf

since that bad transaction, another one completed perfectly. 

Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 07, 2018, 06:12:05 PM
IIRC, we fixed a paid subs problem on one of your forums by upgrading php version.  Don't have admin access on this one, would like to see your error log.  You'll have to convert to https pretty soon, PayPal is supposed to implement security upgrades this month that will require https for verification.
Title: Re: paid subscription failure
Post by: RFD on June 07, 2018, 06:26:31 PM
yeah, i have https secured, just not yet implemented.  that will happen over this weekend.  clearly that wasn't the cause of yesterday's PS failure.

PM incoming shortly ...




Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 07, 2018, 07:18:45 PM
Looks like the ipn is incomplete, that would cause subscription activation to fail.  I would guess it was a glitch on PayPal's end.  If a subsequent sub completed, may be a one-off.  I'd let it go and see if it happens again.  I've attached a modified Subscriptions-PayPal.php, it contains some additional error handling that's not in the core code.  Upload it to /Sources, it'll give us more info if the error happens again.

You're logging a ton of errors from an SMFHacks mod, don't know which one.
Title: Re: paid subscription failure
Post by: RFD on June 07, 2018, 07:23:58 PM
thanx for the new PS code and your help.

yeah, i saw those errors, gotta see which hack is the issue ...
Title: Re: paid subscription failure
Post by: RFD on June 08, 2018, 08:08:45 AM
SMF will not allow a manual creation of a PS entry for that user who made the paypal payment - is there any way to get that missed PS user fixed in SMF, get him into the PS log with a start/end date?  i'd bet the problem is a miscommunication link 'tween PP and SMF, and that's a bug hole that needs some way of manually updating or fixing on the SMF PS side.
Title: Re: paid subscription failure
Post by: GigaWatt on June 08, 2018, 09:50:01 AM
Refund him and tell him to subscribe again ;).
Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 08, 2018, 01:11:50 PM
I've seen this before, don't remember what caused it.  I think you'll have to go into the database and remove the sub from smf_log_subscribed.  Looks like it's bowslinger id_member 15914, just delete the row.  If you can't get it, pm cpanel access (link/user/pw), I'll get to it tonight.
Title: Re: paid subscription failure
Post by: RFD on June 08, 2018, 05:36:20 PM
i don't see user 15914 as PS subscribed - or maybe i'm not reading the results correctly ...

Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 08, 2018, 10:29:46 PM
Is that the member you're unable to subscribe?  I used the email address in the paid subs error to get his name and id_member, maybe it was the wrong error.
Title: Re: paid subscription failure
Post by: Aleksi "Lex" Kilpinen on June 08, 2018, 10:54:26 PM
If the subscription fails, and trying to add a new subscription manually fails with that error - then usually the member will have an old subscription that has already ended, and the correct way to fix this would be to edit the old subscription and reactivate it.
Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 08, 2018, 10:57:33 PM
That's not the problem here.  There's a broken sub that doesn't show in the member's profile or the subscription itself, so there's no way to modify or delete it.  Has to be manually removed from database.
Title: Re: paid subscription failure
Post by: Aleksi "Lex" Kilpinen on June 08, 2018, 11:03:31 PM
There is no pending payment listed at all, or no old subscription to edit? That's odd.
SMF should log it even when only attempting to pay and failing.

When it fails, it should be shown as a pending subscription, and then normally you would have an option to just approve it manually.

while i can manually update the membergroup he paid for, and have done so, it will have to be manually monitored for his yearly expiration date since his account is not listed in the paid subscriptions summary.  so far, i don't see a way of correcting this in SMF .... ?
Just a thought. What if it is failing because you manually added the membergroup already? Or was this error there before you did that?
Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 08, 2018, 11:42:15 PM
The ipn is dumped in the error and it's incomplete, a lot of stuff is missing.  This may have caused the broken sub.  It's not shown anywhere, there's no pending sub, so there's no way to fix it.  If the member is aleady in the sub group, it has no effect, it just updates the field to same value. 
Title: Re: paid subscription failure
Post by: RFD on June 09, 2018, 05:59:03 AM
Is that the member you're unable to subscribe?  I used the email address in the paid subs error to get his name and id_member, maybe it was the wrong error.

yep, that's the member.  he was never part of any PS, there are no PS indicators in his profile, he is not listed in the PS admin log, yet when i try to manually give his PS status SMF sez he's already got it.  weird.

if i refund his PP payment, and have him subscribe again, is there a guarantee that won't fail if right now SMF thinks he already has a PS?

Title: Re: paid subscription failure
Post by: Aleksi "Lex" Kilpinen on June 09, 2018, 06:26:00 AM
No, I wouldn't go there before this is cleared somehow. It sounds like it could just fail again.
Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 10, 2018, 12:25:09 AM
It's not a payment problem, the payment was successful or you wouldn't have received the ipn.  Verification failed, for whatever reason, and you're left with a damaged sub.  If member tries to subscribe again, it will probably fail for same reason you can't get at it.  Would need access to your db to fix it.
Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 10, 2018, 05:37:41 PM
Hmm, well, the good news is I successfully added the subscription manually in ACP, it worked normally.  Bad news is, hadn't changed anything in database, so I'm not sure what went wrong.  id_member 15914 was already in id_group 9, the subscription group, but the sub was not in smf_log_subscribed.  Went to Admin -> Paid Subscriptions, clicked on Contributing Membership sub, did the Add New Subscriber, it was successful first try.  The sub now appears in smf_log_subscribed.  Only glitch was old_id_group was 9, because member was already in group 9, so when sub expires in a year, it would revert from id_group 9 to id_group 9, member would remain in subscription group indefinitely.  Changed old_id_group to 0, so he'll revert to regular member on expiration.

Never seen this before, best guess is IPN was screwed up, and it caused some unusual behavior when it posted to the forum.  Would be interested to know if it happens again.
Title: Re: paid subscription failure
Post by: Aleksi "Lex" Kilpinen on June 10, 2018, 11:22:23 PM
Interesting. I mean, wonder what did you and the OP do differently, or did something change in between.
Title: Re: paid subscription failure
Post by: RFD on June 11, 2018, 05:55:14 AM
Hmm, well, the good news is I successfully added the subscription manually in ACP, it worked normally.  Bad news is, hadn't changed anything in database, so I'm not sure what went wrong.  id_member 15914 was already in id_group 9, the subscription group, but the sub was not in smf_log_subscribed.  Went to Admin -> Paid Subscriptions, clicked on Contributing Membership sub, did the Add New Subscriber, it was successful first try.  The sub now appears in smf_log_subscribed.  Only glitch was old_id_group was 9, because member was already in group 9, so when sub expires in a year, it would revert from id_group 9 to id_group 9, member would remain in subscription group indefinitely.  Changed old_id_group to 0, so he'll revert to regular member on expiration.

Never seen this before, best guess is IPN was screwed up, and it caused some unusual behavior when it posted to the forum.  Would be interested to know if it happens again.

thank you for the fix, much obliged.

this member needed classifieds access, so i had no choice but to change his primary group to the 'contributing membership' group - that was no glitch.  i just reverted it back to 'no primary membergroup', which is where it'll auto revert back to in a year (hopefully, if PS is still working as intended).

what did ya do to manually fix member 15914?  this gltich will more than likely happen again and i'll need to make the fix.

Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 11, 2018, 12:40:24 PM
Didn't actually fix anything, took a look in db and there was nothing in smf_log_subscribed for this member, so there wasn't anything that would prevent a manual sub.  Tried it and it worked, no idea why it didn't work for you.  Member was already in sub group 9, so when sub was created in smf_log_subscribed, old_id_group was same as new id_group, both were 9.  That would cause group to not revert back to regular member when sub expired, it would revert to 9, so I fixed it.  Manual sub should have worked for you.
Title: Re: paid subscription failure
Post by: RFD on June 12, 2018, 06:48:15 AM
tried to manually add that member more than a few times and each time i got the message he already had a PS.  now that's scary weird.
Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 12, 2018, 04:47:46 PM
Only possibility that comes to mind, their may have been a glitch on PayPal's end, and the verification may have been delayed, but you would have seen a pending sub.  Member was already in sub group, there was nothing pending, nothing in _log_subscribed, and manual sub worked normally.  Unless you changed something trying to fix it, and were successful without realizing it was fixed. (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.thekrashsite.com%2Fpics%2Fidk.gif&hash=2b07c02bae8bb5a42bbd6a2860ab7d0c)
Title: Re: paid subscription failure
Post by: RFD on June 12, 2018, 05:04:16 PM
when i saw the completed  PP transaction (on the PP side) and never saw an SMF email that verified the member created a PS, i checked his profile.  no PS and therefore he was not given the "contributing member" membergroup access - he was still in the default membergroup.  when my attempts to include him in PS failed (SMF sez he's already in the PS), i manually gave him the "contributing member" access.   
Title: Re: paid subscription failure
Post by: Study Force on June 13, 2018, 01:42:13 AM
Before you jump to conclusions, I believe this is a problem from PayPal. I remember this used to happen to me when I used PayPal. Sometimes their servers (or yours) is down at a specific time when the end user is paying, thereby preventing the two from communicating. In addition, I don't think the paid subscription feature is designed to try again 3 times at least if something like this does occur.
Title: Re: paid subscription failure
Post by: RFD on June 13, 2018, 06:14:38 AM
Before you jump to conclusions, I believe this is a problem from PayPal. I remember this used to happen to me when I used PayPal. Sometimes their servers (or yours) is down at a specific time when the end user is paying, thereby preventing the two from communicating. In addition, I don't think the paid subscription feature is designed to try again 3 times at least if something like this does occur.

i agree.  it's a communication breakdown.  this problem happened sometime early in the morning and in checking it is entirely possible, if not likely, that the database might have been down during that communication period.  that happens, that's understandable, and that's ok.  what was ok was the failure for SMF to allow me to manually update the member's PS.  that the manual updating was allowed, eventually, is baffling. 

i don't mind that there was a problem - the frustrating part is that i couldn't fix it.
Title: Re: paid subscription failure
Post by: Study Force on June 13, 2018, 09:06:20 AM
That being said, you need a better solution.

When it comes to paying a strangers online (or anyone, really), people panic when they don't get what they want right away. I suggest you use a better subscription system moving forward. Too many PayPal complaints leads to unexplained bans and lose of profit.
Title: Re: paid subscription failure
Post by: RFD on June 13, 2018, 09:20:23 AM
That being said, you need a better solution.

When it comes to paying a strangers online (or anyone, really), people panic when they don't get what they want right away. I suggest you use a better subscription system moving forward. Too many PayPal complaints leads to unexplained bans and lose of profit.

great - i'm all ears, what's a better paid subscription service for my SMF customers?
Title: Re: paid subscription failure
Post by: Study Force on June 13, 2018, 10:03:53 AM
That being said, you need a better solution.

When it comes to paying a strangers online (or anyone, really), people panic when they don't get what they want right away. I suggest you use a better subscription system moving forward. Too many PayPal complaints leads to unexplained bans and lose of profit.

great - i'm all ears, what's a better paid subscription service for my SMF customers?

Honestly there aren't too many alternatives other than https://www.smfhacks.com/smf-store.php. You could also modify SMF's version to use Stripe.com. Their system is superior to PayPal, I think.
Title: Re: paid subscription failure
Post by: RFD on June 13, 2018, 10:06:02 AM
smf-store would be worth my consideration if it was already configured for stripes.
Title: Re: paid subscription failure
Post by: Study Force on June 13, 2018, 12:01:31 PM
smf-store would be worth my consideration if it was already configured for stripes.

Unfortunately, it's not configured to work with Stripe either. I had to pay a freelancer x amount of dollars to code it for me, then I ironed out the edges myself. The edge that it has over SMF's own subscription system is all the configurable features -- if you're into that. If you don't want those features, have someone from here reprogram what you currently have to work with Stripe.com.

Here's an idea of what the Store mod could look like: https://biology-forums.com/index.php?action=store (you'll need to register though) and here's what the purchase page looks like with Stripe.com: https://biology-forums.com/index.php?action=store;sa=view;id=1 (click the Buy Now, button).
Title: Re: paid subscription failure
Post by: Sir Osis of Liver on June 13, 2018, 12:14:49 PM
There's nothing wrong with PayPal, they've been very reliable for all the years and on all the forums I've worked on that use Paid Subs.  They are the most widely used and recognized payment service, and seeing an unfamiliar service will put off a lot of subscribers.  Switching to a different gateway is difficult, SMF is designed to work only with PayPal, and attempts to use a different service have been mostly unsuccessful.  It also precludes getting any further support for Paid Subs here, because modifications to core code are required.  This was an unusual situation, I'd have to see it again to investigate any further, but at this point it does appear to be a one-off.  Wouldn't be concerned about it if doesn't happen again.
Title: Re: paid subscription failure
Post by: Study Force on June 13, 2018, 12:42:44 PM
@Sir Osis of Liver

If you use it for a high volume of sales, you'll experience what the OP is experiencing, I'm hands-down positive of this. Yes, SMF comes stock with PayPal, but Stripe.com's technology is far superior than it, at least from my experience. The only issue might be, like you mentioned, it's slightly an unfamiliar service. That, however, doesn't stop customers from purchasing.