Advertisement:

Author Topic: no paid subscriptions possible in SMF?  (Read 7395 times)

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
no paid subscriptions possible in SMF?
« on: March 25, 2015, 12:18:51 PM »
We've tried many many times now to set up 0,01 paid subscriptions in 2.1. All seems to be working fine, payments arrive, the users is being redirected back to the board, but the profile is not automatically updated.
Even when I make a complete fresh install, on a new database, it will have the exact same outcome.

What could be failing here?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,241
  • Gender: Male
    • Kindred-999 on GitHub
Re: no paid subscriptions possible in SMF?
« Reply #1 on: March 25, 2015, 04:56:53 PM »
lots of things could be failing -- you don't really provide enough information to debug....
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #2 on: March 25, 2015, 05:12:44 PM »
On the 2.1 install I 'manage' to get error e-mails back from the forum stating an unknown transaction type was used.On the subscriptions admin panel however, it claims it has a few fulfilled subscriptions, but when I click the subscription, there are no subscribers. Payments are processed by paypal though.

on 2.0 this all works pretty much the same, only here subscriptions are handled as expected, and subscribers automatically are transferred to the given group, and an overview of the transaction with the purchased subscription is emailed to the admin.

Then I tried an updated version 2.0 > 2.1... same issue

we've double checked the paypal settings a million times, but can't figure out what it is that might go wrong here.

Offline lc62003

  • Jr. Member
  • **
  • Posts: 207
Re: no paid subscriptions possible in SMF?
« Reply #3 on: March 25, 2015, 05:15:23 PM »
Here is a second on that issue.   ;)

Offline BryanD

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 22,147
  • Gender: Male
Re: no paid subscriptions possible in SMF?
« Reply #4 on: March 25, 2015, 06:38:15 PM »
any errors in the logs?
Former Project Manager and Customizer of SMF
Former Marketing and Vice-President of Simple Machines

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #5 on: March 25, 2015, 06:47:15 PM »
yes
all related to subscription.php

Code: [Select]
Fouttype: Errors resulting from paid subscriptions, which can include notification of payment failures.
Onbekend tranactietype.
transaction_subject:
txn_type: web_accept
payment_date: 08:12:46 Mar 25, 2015 PDT
last_name: xxxxx
residence_country: NL
pending_reason: unilateral
item_name: test Abonnement
payment_gross:
mc_currency: EUR
business: xxxxxx
payment_type: instant
protection_eligibility: Ineligible
verify_sign: AFQ83kqt8xk0yYDtaN-N-.t9hFpjANEJVZE3YUmZ83PRaUa5h.77scA9
payer_status: verified
tax: 0.00
payer_email: xxxxxxx
txn_id: 9VB014800S5819906
quantity: 1
receiver_email: xxxxxx
first_name: xxx
payer_id: E2BTTQVGRQJ38
item_number: 2+1615
handling_amount: 0.00
payment_status: Pending
shipping: 0.00
mc_gross: 0.01
custom:
charset: windows-1252
notify_version: 3.8
ipn_track_id: xxxxxxxx

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,983
Re: no paid subscriptions possible in SMF?
« Reply #6 on: March 25, 2015, 07:51:24 PM »
Can you pm the complete (unedited) error log?  payment_status should not be 'Pending', that may be something on PayPal's end.  Will be back on later, and have a closer look.


Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,983
Re: no paid subscriptions possible in SMF?
« Reply #7 on: March 25, 2015, 11:29:52 PM »
Subscription will fail if payment_status is 'Pending', it must be 'Completed' for subscription to activate, as per this -

Subscriptions-PayPal.php

Code: [Select]

public function isPayment()
{
if ($_POST['payment_status'] === 'Completed' && $_POST['txn_type'] === 'web_accept')
return true;
else
return false;
}


Same in 2.0 and 2.1.  For reasons unknown, PayPal is returning payment_status as 'Pending', which indicates the payment wasn't completed successfully on their end.  Paid Subs is doing what it's supposed to do, it does not activate the subscription and errors out.

Also see payment_gross is blank, and mc_gross: 0.01.  If this is a test subscription, PayPal has a minimum transaction of $0.10USD.  You may have configured it below the minimum.

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #8 on: March 26, 2015, 03:16:27 AM »
OK Thanks

I will look that up.
I didn't set this up as being an (admin) test payment/subscription, we did, however, made it 1 cent transactions. Which succeed perfectly on 2.0.

I will send you the PM later.



Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #9 on: March 26, 2015, 04:27:39 AM »
right...
1. I set it up to a 0,15 transaction.
2. payment is verified, however the same error occurs.
3. Directly after having the payment made, instead of automatically linking back to the board, paypal shows a link stating "go back to [pay@pal.com account]"
4. If I click this, the transaction seems to finish and I get an automated link back to the board on the actual next page.
5. Then the error follows by e-mail again (same as in this log, but just stating unknown blbala).

In the IPN log on paypal, the transaction is visible though.

To me it seems that step 3 is the issue. How come paypal is trying to send me back to the receivers paypal address?

Code: [Select]
d65aea696fc7f0c877edbb0aacb01659
 Fouttype: Errors resulting from paid subscriptions, which can include notification of payment failures.
Onbekend transactietype.
transaction_subject:
payment_date: 01:14:36 Mar 26, 2015 PDT
txn_type: web_accept
last_name: xxxxxx
residence_country: NL
item_name: test
payment_gross:
mc_currency: EUR
business: paypal@xxxxxx
payment_type: instant
protection_eligibility: Ineligible
verify_sign: Acp9sEM7MAdfBbGez1P6Ikf8i3dJABwhmYZPD-uLm1boYM38zLuAp0K7
payer_status: verified
tax: 0.00
payer_email: xxxxxx@gmail.com
txn_id: 08X83027VW2697046
quantity: 1
receiver_email: paypal@xxxxxx
first_name: xxx
payer_id: E2BTTQVGRQJ38
receiver_id: T84SU8JD5MMVJ
item_number: 1+1614
handling_amount: 0.00
payment_status: Completed
payment_fee:
mc_fee: 0.15
shipping: 0.00
mc_gross: 0.15
custom:
charset: windows-1252
notify_version: 3.8
ipn_track_id: ec742ba0517fb

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #10 on: March 26, 2015, 08:43:22 AM »
OK update :)

I now uploaded the 2.0.9 versions of Subscriptions.php and Subs_Paypal.php to 2.1
All though the paypal interface shows (in my opinion) not completely correct information, it seems to suffice in the process sending the IPN back to the board.
The user is "upgraded" to the desired members group.

There is no error log.
The user received the correct (new) id_group
The subscription log in the database went to pending 0, status 1

BUT
Despite the admin panel showing an active subscriber, the actual subscribers list remains empty.




Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: no paid subscriptions possible in SMF?
« Reply #11 on: March 26, 2015, 08:59:45 AM »
I now uploaded the 2.0.9 versions of Subscriptions.php and Subs_Paypal.php to 2.1
That is really a bad idea :P There were code changes from 2.0.x to 2.1 which should cause some problems...

We need to further investigate the current status of paid subs in 2.1...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

Quote
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #12 on: March 26, 2015, 10:18:55 AM »
I understand, but it might give us some idea of where the problem might lay.
and.. it kinda works now ;) Whereas with the out of the box 2.1 files, it doesn't  (at least not on my board)



edit:
I narrowed it down to the paypal file only.
The fresh install /subscriptions.php file works.
For now it is just the older /sources/Subscriptions-paypal.php  (version 2.0.3) that is being used.

Still not showing any subscribers in my list though. (/sources/ManagePaid.php?)
« Last Edit: March 26, 2015, 11:18:00 AM by paq »

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #13 on: March 26, 2015, 12:50:03 PM »
Well, I copied the arrays from the 2.0.9 /Sources/ManagePaid.php (version 2.0.3) to show subscribed users, and this solves my problem  8)

Not sure whether I should mark this topic as being solved, for this took quite some hours of searching, and -clearly- using unintended code in order to get it up and running.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,983
Re: no paid subscriptions possible in SMF?
« Reply #14 on: March 26, 2015, 03:19:57 PM »
What a mess.  Plugged your PP account into my 2.1 test install.  Payment is successful, subscription fails with error, don't know why.

Here's the problem in ManagePaid.php -

Code: [Select]

  'items_per_page' => $modSettings['defaultMaxListItems'],   


$modSettings is not globalized in function ViewSubscribedUsers().  Have to add it here -

Code: [Select]

function ViewSubscribedUsers()
{
global $context, $txt, $scripturl, $smcFunc, $sourcedir, $modSettings;


That's not causing sub to fail.  Will work on that.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,983
Re: no paid subscriptions possible in SMF?
« Reply #15 on: March 26, 2015, 04:01:49 PM »
Confirmed subscription activates in 2.1 with 2.0.9 Subscriptions-PayPal.php, not with 2.1 file.

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #16 on: March 27, 2015, 06:37:18 AM »
What a mess.  Plugged your PP account into my 2.1 test install.  Payment is successful, subscription fails with error, don't know why.

Here's the problem in ManagePaid.php -

Code: [Select]

  'items_per_page' => $modSettings['defaultMaxListItems'],   


$modSettings is not globalized in function ViewSubscribedUsers().  Have to add it here -

Code: [Select]

function ViewSubscribedUsers()
{
global $context, $txt, $scripturl, $smcFunc, $sourcedir, $modSettings;


That's not causing sub to fail.  Will work on that.
aaaah right... the Sourcedir.
Added that > works  ;D


Confirmed subscription activates in 2.1 with 2.0.9 Subscriptions-PayPal.php, not with 2.1 file.

 8)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,983
Re: no paid subscriptions possible in SMF?
« Reply #17 on: March 27, 2015, 01:44:23 PM »
I know where the problem is in Subscriptions-PayPal.php, just haven't picked it out.  Will have another go tonight.

paq, am using your PP account for test purposes, have to pay with credit card if I use my own.  Buy yourself something nice. ;)

Offline paq

  • Semi-Newbie
  • *
  • Posts: 54
Re: no paid subscriptions possible in SMF?
« Reply #18 on: March 27, 2015, 04:20:44 PM »
gheghege thanks :D

the thing is... subscriptions are 1 cent, paypal costs are 35 cents  :laugh:
So I end up with 0,00

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 8,983
Re: no paid subscriptions possible in SMF?
« Reply #19 on: March 27, 2015, 11:35:09 PM »
Ok, here's the fix -

Subscriptions-PayPal.php

Code: [Select]

public function isValid()
{
global $modSettings;

// Has the user set up an email address?

if (empty($modSettings['paypal_email']))

// if ((empty($modSettings['paidsubs_test']) && empty($modSettings['paypal_email'])) || empty($modSettings['paypal_sandbox_email']))

return false;