Core Feature - "Paid Subscriptions"

Started by RFD, January 12, 2018, 07:04:17 PM

Previous topic - Next topic

RFD

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.


Sir Osis of Liver

Anything in your error log?  Are you using https?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

not using https, zero errors in the SMF error log ...

RFD

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.


Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

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.

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

failed again but this time i got an error log hit ....

Sir Osis of Liver

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.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Aleksi "Lex" Kilpinen

Quote from: RFD on January 13, 2018, 05:29:42 PM
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. )
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

RFD

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.


Sir Osis of Liver

•  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
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

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.
 

Sir Osis of Liver

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 -



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



Do this -



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



Find this -



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

exit;



Do this -



// 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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

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 ...

Arantor


RFD

i'm on 5.3 ... just a silly point away.  :o  8)

Sir Osis of Liver

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.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

RFD

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,




RFD

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.

Advertisement: