Advertisement:

Author Topic: Core Feature - "Paid Subscriptions"  (Read 1124 times)

Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Core Feature - "Paid Subscriptions"
« on: January 12, 2018, 07:04:17 PM »
my forum is SMF 2.0.13 and i just set up the paid subscriptions feature and ran a test.  paypal got the money and completed the transaction, but SMF still shows the user's status as "Pending Payment".  i have made no changes to my paypal business account money matters settings.  also, the duration of this subscription is 14 days and SMF shows no end date.  please see attached images.


Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,338
  • There's someone in my head but it's not me.
Re: Core Feature - "Paid Subscriptions"
« Reply #1 on: January 12, 2018, 09:20:37 PM »
Anything in your error log?  Are you using https?

Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #2 on: January 13, 2018, 07:31:06 AM »
not using https, zero errors in the SMF error log ...

Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #3 on: January 13, 2018, 08:07:54 AM »
interestingly, i set up paid subsrciptions in another SMF 2.0.13 forum that used the same paypal from account, but a different paypal receive account and it worked perfectly ... and unlike the other paypal receive account, this one that worked is not a business account.


Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,338
  • There's someone in my head but it's not me.
Re: Core Feature - "Paid Subscriptions"
« Reply #4 on: January 13, 2018, 02:41:09 PM »
If you use a PayPal business or premier account, you have to have your primary PayPal email address in Paid Subs settings.  PP is in the process of updating their security, validation postback will no longer be accepted from http, only https, but afaik, the change hasn't been implemented.

Try uploading the attached Subscriptions-PayPal.php (save your original), it contains additional error handling that's not in core version.  Do a test sub, check your error log.

Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #5 on: January 13, 2018, 04:46:39 PM »
primary PP address is in the PS settings.  did you also mean to change 'Subscriptions-PayPal.php' to 'subscriptions.php'?  if so, it did that and got same results as before and nothing in the error log.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,338
  • There's someone in my head but it's not me.
Re: Core Feature - "Paid Subscriptions"
« Reply #6 on: January 13, 2018, 05:01:51 PM »
No, subscriptions.php is in forum root, don't touch that.  The attached Subscriptions-PayPal.php replaces the existing file in /Sources, same file with some additional error handling.

Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #7 on: January 13, 2018, 05:29:42 PM »
failed again but this time i got an error log hit ....

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,338
  • There's someone in my head but it's not me.
Re: Core Feature - "Paid Subscriptions"
« Reply #8 on: January 13, 2018, 10:23:26 PM »
Won't be back on my computer til late tomorrow, but contact PayPal support, tell them ipn verification is failing, they should be able to trace it from their end.  It may be because you're using http, not https.

Online Aleksi "Lex" Kilpinen

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,927
  • Gender: Male
  • The Artist Formerly Known as LexArma
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Core Feature - "Paid Subscriptions"
« Reply #9 on: January 14, 2018, 04:14:59 AM »
failed again but this time i got an error log hit ....
Do you have Instant Payment Notification (IPN) configured in Paypal?
I've used the Paid subscriptions with paypal for years, and haven't seen any issues ( even though I started with a personal account, and have since upgraded to Business. )
Finnish Native Language Support Specialist & Former (Lead) Support Specialist

Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #10 on: January 14, 2018, 07:33:39 AM »
i have two other SMF 2.0.13 forums, on http domains.  i just set each of those up with Paid Subscriptions going to a non-business paypal account.  i did nothing to the paypal account and IPN is not setup at all.  they both work perfectly, with subscriptions going 'active' as soon as the payment is completed at the paypal side.

what's failing is this one paypal business account that''s not updating the forum.

i spoke with paypal website tech support last week and got conflicting answers.  the first tech said i'd need to buy 'paypal pro' for $30/month.  clearly, setting up my other two non-business paypal forums for paid subscriptions and having them work perfectly makes that tech's info nonsense. 

the other tech support person said that two things needed to be set in paypal ... 'my selling tools' 'Website preferences' turn 'auto return' on and enter a return URL ... also in 'my selling tools' 'Instant payment notifications' needs to be turned on, and i did (see attachment).  none of this worked at all, no paid subscription went 'active' (though i could manually make the subscriptions active). 

i don't know if both SMF and paypal are set up correctly, because at this point i haven't a clue as to what the problem is, other than seeing the SMF error log tell me there's an IPN failure.


Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,338
  • There's someone in my head but it's not me.
Re: Core Feature - "Paid Subscriptions"
« Reply #11 on: January 14, 2018, 09:34:24 PM »
•  It is not necessary to enable IPN in your PayPal account; if you do, the forum will receive payment notifications for all payments made to your account, and this will generate Paid Subscriptions errors for payments that are not subscription related.

This is the current info being posted by PayPal regarding security upgrades -

Merchants and partners use Instant Payment Notification (IPN) to receive notifications of events related to PayPal transactions. The IPN message service requires that you acknowledge receipt of these messages and validate them. This process includes posting the messages back to PayPal for verification. In the past, PayPal has allowed the use of HTTP for these postbacks. For increased security going forward, only HTTPS will be allowed for postbacks to PayPal. At this time, there is no requirement for HTTPS on the outbound IPN call from PayPal to the merchant’s IPN listener.

To avoid any disruption of service, you must verify that your systems
are ready for this change by June 2018.

UPDATE
PayPal is committed to providing the highest level of security to protect customer and transactional data, and we work closely with our merchant community to do the same. In response to feedback from several merchants, PayPal did not strictly enforce some of these vital security upgrades prior to the June 2017 deadline. However, in order to provide the most secure experience for all of our customers, PayPal must proceed with implementing these upgrades in the first half of 2018. In early 2018, we will conduct brief rounds of testing which will emulate the upgraded security experience so that merchants can understand the areas of their integration that still require work. Dates for these tests and full deployment will be published on this site at least two weeks prior to implementation.


AFAIK, verification postbacks should still work from http addresses, but it's possible they've implemented the security upgrade on business accounts.  PayPal's merchant support used to be very good, but last time I used it it had apparently been moved offshore, and it sucked.  No way you should have to pay for an upgrade to get a business account to work.  You will eventually have to convert to https to continue using paid subs, may as well do it now and see if it fixes the problem.

https://www.simplemachines.org/community/index.php?topic=555034.msg3934593#msg3934593

Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #12 on: January 14, 2018, 09:54:29 PM »
good to know the coming 6/18 PP https requirement for paid subscriptions and IPNs.

dealing with PP tech support hasn't been the answer for me, particularly judging from the completely different answers i get.

however, if it (SMF paid subscriptions) works perfectly my two non-business PP accounts, it should work just as well with a PP business account.  unless there is an issue on the PP side ... or SMF side. 

hmm.

the only thing i can think of to do now, is to create a new SMF 2.0.13 test forum, kick off paid subscriptions, and link it to my PP business forum, and test out paid subscriptions.  if it fails, chances are the problem is on the PP side, if it succeeds, i've probably got an SMF issue with my live SMF forum that's failing for paid subscriptions.
 

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,338
  • There's someone in my head but it's not me.
Re: Core Feature - "Paid Subscriptions"
« Reply #13 on: January 14, 2018, 10:12:28 PM »
IIRC, the ipn verification error occurs after payment is successful and PayPal has posted ipn to subscriptions.php.  IPN contains a verification code, which forum posts back to PP, which then posts verification to forum.  Subscription does not activate until verification is received.  This is the part that will fail when PP security upgrade requiring https goes into effect.  IPN post data is included when forum posts 'invalid transaction type' error.  If you want to confirm that ipn is received, and view post data, you can diddle the code in subscriptions.php and force it to log all transactions.  Let's see if I can remember how to do it .......


Ok, in subscriptions.php find this -

Code: [Select]

if (empty($txnType))
generateSubscriptionError($txt['paid_unknown_transaction_type']);


Do this -

Code: [Select]

///if (empty($txnType))
generateSubscriptionError($txt['paid_unknown_transaction_type']);


Find this -

Code: [Select]

// Then just log and die.
log_error($text);

exit;


Do this -

Code: [Select]

// Then just log and die.
log_error($text);

/// exit;


Do a test subscription, it should log an error that lists ipn post data.

You also should upgrade your forum to 2.0.15, I believe there was an update to accommodate PayPal's new security protocols.


Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #14 on: January 15, 2018, 06:08:45 PM »
i believe that 2.0.14-15 require php 5.5 - don't have that ..... yet .... in the process of upgrading.

accomplished the above and here's the resulting error log ...

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,361
    • Arantor on GitHub
Re: Core Feature - "Paid Subscriptions"
« Reply #15 on: January 15, 2018, 06:29:30 PM »
They require 5.4 or higher.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #16 on: January 15, 2018, 06:33:33 PM »
i'm on 5.3 ... just a silly point away.  :o  8)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,338
  • There's someone in my head but it's not me.
Re: Core Feature - "Paid Subscriptions"
« Reply #17 on: January 15, 2018, 09:11:57 PM »
Payment is successful, PayPal is posting ipn to subscriptions.php, nothing amiss in post data.  Verification is failing, PP is either not receiving postback from forum, or not posting verification back to forum.  Replace your business account with personal account, do a test sub, see if it activates.  If it does, problem is on PayPal's end, paid subs doesn't care which type of account you use, it handles transaction exactly the same.


Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #18 on: January 16, 2018, 07:12:18 AM »
all paid subscription tests from the tradmla SMF 2.0.13 forum to both business (tradmla) and personal (bpgang) paypal accounts fail to go active.

all paid subscription tests from the bpgang SMF 2.0.13 forum to both business (tradmla) and personal (bpgang) paypal accounts work perfectly and upon immediate paypal completion go active,




Offline RFD

  • Jr. Member
  • **
  • Posts: 185
Re: Core Feature - "Paid Subscriptions"
« Reply #19 on: January 16, 2018, 07:38:07 AM »
using a totally different personal paypal account, and the bpgang SMF 2.0.13 forum, with the tweaked subscriptions.php script (to show errors), a subscriptions test completed to active and below is the error log for that transaction.