Page 1 of 1

(Solved!) Paypal Group Subscription not working...

PostPosted: Fri Apr 14, 2006 9:52 pm
Author: enoonsti
I set up a payment group (set it at $1 per month, recurring), but when a user pays the subscription, the user is not added to the group.

Does anybody have this feature working?

Thanks <img>

PostPosted: Sat Apr 15, 2006 8:49 am
Author: Jason Sanborn
I set the group up on my site, but no one has joined it yet, so I don't know if it works or not.

PostPosted: Sat Apr 15, 2006 9:51 am
Author: enoonsti
"Jason Sanborn";p="1734" wrote:I set the group up on my site, but no one has joined it yet, so I don't know if it works or not.



Yeah, lol, I don't expect much use from mine either <img>


But still... this was just bugging me. I noticed someone else having this problem, and so I was just curious if anyone has tested it before.

PostPosted: Sat Apr 15, 2006 9:52 am
Author: tekguru
I can confirm it did not work for me for the two users who have subscribed.

Do you have the subscription record recorded as well as that failed for me here.

PostPosted: Sat Apr 15, 2006 10:02 am
Author: enoonsti
"tekguru";p="1742" wrote:I can confirm it did not work for me for the two users who have subscribed.

Do you have the subscription record recorded as well as that failed for me here.


The subscription record turned out all right (I can see the Amount, Debit/Credit, Status, Date, etc., from both the user's perspective and from the Admin Control Panel).

The only problem I have (at least I think it's the only problem...) is that member is not being automatically added to the group.

PostPosted: Sat Apr 15, 2006 11:59 pm
Author: tekguru
Under due investigation I get the same issue.

If we can identify whos Mod it is and look for updates it might be worthwhile.

Re: Paypal Group Subscription not working...

PostPosted: Sun Apr 16, 2006 4:34 am
Author: found it
you have to got to your paypal account and then goto profile and then find

Code: Select all
Instant Payment Notification Preferences


you then have to place this addy into the setup...

Code: Select all
http]

obviously replacing
[code]your domain


with your web address...

:mrgreen:

Re: Paypal Group Subscription not working...

PostPosted: Sun Apr 16, 2006 9:11 am
Author: enoonsti
Thanks found it <img>


I also realized that I had to make the following changes (the Integramod package on this site might have these changes already implemented....

so check first before modding anything!!).

[hr:3n77auxw]
The most important thing I had to do was add some expiration/active tables to my database. So open up phpmyadmin and run the following sql query:

Code: Select all
ALTER TABLE phpbb_user_group ADD ug_expire_date int(11) default 0; ALTER TABLE phpbb_user_group ADD ug_active_date int(11) default 0;


If you've installed Integramod in your main public_html directory then you need to edit file

lwdonateconfirm.php

and change the line

Code: Select all
$pos = strpos($board_config['script_path'], '/', (strlen($board_config['script_path']) - 2));


to

Code: Select all
 $pos = strpos($board_config['script_path'], '/', (strlen($board_config['script_path']) - 1));


Only do the above if you didn't install Integramod in a sub directory


[b](The following is optional.... I think <s>assign_block_vars('switch_user_logged_out', array()); } else {    $template->assign_block_vars('switch_user_logged_in', array());      if ( !empty($userdata['user_popup_pm']) )    {       $template->assign_block_vars('switch_enable_pm_popup', array());    }    require($phpbb_root_path . 'includes/lw_ipn_grp_functions.'.$phpEx);    $lwuserreminder = lw_write_header_reminder();    $template->assign_block_vars('switch_lw_user_logged_in', array());    $template->assign_vars(array(       'L_LW_EXPIRE_REMINDER' => $lwuserreminder,       )    ); //   $lwuserreminder = '';    //   if( $userdata['user_level'] != ADMIN && $userdata['user_level'] != MOD) //   { //      if(time() > ( $userdata['user_expire_date'] == 0 ? ($userdata['user_regdate'] + intval($board_config['lw_trial_period']) * 24 * 60 * 60) ]  )) //      { //         $lwuserreminder = sprintf($lang['LW_Welcome_Nopaid_Member'], $userdata['username']); //      } //      else if($userdata['user_expire_date'] == 0) //      { //         $lwuserreminder = sprintf($lang['LW_EXPIRE_TRIAL_REMINDER'], ((($userdata['user_regdate'] + intval($board_config['lw_trial_period']) * 24 * 60 * 60) - time()) / (24 * 60 * 60) + 1)); //      } //      else //      { //         $lwuserreminder = sprintf($lang['LW_EXPIRE_MEMBER_REMINDER'], create_date($userdata['user_dateformat'], $userdata['user_expire_date'], $userdata['user_timezone'])); //      } //      if($userdata['user_rank'] > 0) //      { //         $sql = "SELECT r.rank_id, r.rank_title  //            FROM " . RANKS_TABLE . " r //            WHERE r.rank_id = " . $userdata['user_rank']; //         if ( ($resultr = $db->sql_query($sql)) ) //         { //            if( $rowr = $db->sql_fetchrow($resultr) ) //            { //               if(strcmp($rowr['rank_title'], VIP_RANK_TITLE) == 0) //               { //                  $lwuserreminder = sprintf($lang['LW_YOU_ARE_VIP'], $userdata['username']); //               } //            }    //         } //      } // //   } //   $template->assign_block_vars('switch_lw_user_logged_in', array()); //   $template->assign_vars(array( //      'L_LW_EXPIRE_REMINDER' => $lwuserreminder, //      ) //   );     }[/code]

and add into /templates<your>/overall_header.php just below {QBARS} so that it looks like below

Code: Select all
{QBARS} <a></a> <table> <tr> <td> <table> <tr> <td><a><img></a></td> <BEGIN> <td><div>{BANNER_0_IMG}</div></td> <END> <td>     </td> </tr> </table> {QMENUS} <Added> <table>   <BEGIN>   <tr>     <td><span> {L_LW_EXPIRE_REMINDER}</span></td>   </tr>   <END> </table> <END>


this will then display a user's subscription info (only displays it if they have any)

PostPosted: Sun Apr 16, 2006 9:13 am
Author: enoonsti
After doing found it's suggestion and mine, I was able to get the subscription mod to work.

It's pretty cool <img>

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Sun Apr 16, 2006 1:25 pm
Author: tekguru
How on earth did you work that lot out? Just applied the changes here, the able mods were already there but I've changed the lwdonate file and the other code so we'll see what happens if I can persuade someone to subscribe!

The other problem I have is that if folks donate they do not get added to the system, but as I also bring in the donate confirmation emails via POP3 I'm wondering if that screws it up?

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Sun Apr 16, 2006 2:38 pm
Author: found it
I used the subscription mod and the donation mod before integramod added them so any info you may need on them ..the mod authors site is here

http://www.loewen.com.sg/bbs/index.php

:mrgreen:

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Sun Apr 16, 2006 5:06 pm
Author: tekguru
Well I've so far:

- made all the changes above
- downloaded and read through the mod from loewen

and yet if a user goes into the usergroups option and chooses subscribers they can view the details but there is no option showing at all allowing them to subscribe to the group.

Am I missing something? The group is set up as a payment group with no trial requiring a ÂÂÂ £15 subscription to access it.

PostPosted: Sun Apr 16, 2006 5:24 pm
Author: enoonsti
"tekguru";p="1885" wrote:The other problem I have is that if folks donate they do not get added to the system, but as I also bring in the donate confirmation emails via POP3 I'm wondering if that screws it up?


I haven't tried the donating thing yet (but I'll give it a shot soon).

All I tested out was the group subscription part, and it seems to have automatically added the person to the group (now I'm testing to see if canceling the subscription will automatically remove the person).

"tekguru";p="1918" wrote:and yet if a user goes into the usergroups option and chooses subscribers they can view the details but there is no option showing at all allowing them to subscribe to the group.



Did you go to http://www.yourdomain.com/lwtopup.php ? That gives the user the option to pay for the group.

PostPosted: Mon Apr 17, 2006 1:00 am
Author: tekguru
Donate is now working fine now I've turned off bringing in those blasted emails.

Subs - no but I'll add that link in and we'll see what happens!

PostPosted: Mon Apr 17, 2006 11:15 pm
Author: tekguru
Well the system is now processing the subscription requess, that is I get the emails from PayPal confirming the subscription, and the IPN log on the forum is updated.

The bad news is that the users are not added in to the groups.

Problem seesm to be reported on Leowen as well with no solution yet.

Any ideas on that issue?

PostPosted: Mon Apr 17, 2006 11:38 pm
Author: IW4
Ensure that you are in fact using the correct group ID. You'll have to search your DB to make sure on it; the group ID for my Donors group turned out to be in the 1300s. Remember, the system creates a group for each individual user, as well, so it won't just be ID 1 or 2.

PostPosted: Tue Apr 18, 2006 3:10 am
Author: found it
"tekguru";p="2097" wrote:Well the system is now processing the subscription requess, that is I get the emails from PayPal confirming the subscription, and the IPN log on the forum is updated.

The bad news is that the users are not added in to the groups.

Problem seesm to be reported on Leowen as well with no solution yet.

Any ideas on that issue?


I have this mod working with users being added to the group correctly are you sure you added the correct info at paypal under profile then Instant Payment Notification Preferences as that will place them in the group....

:mrgreen:

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Tue Apr 18, 2006 5:25 am
Author: tekguru
IW4 - At work at the moment so unable to check the group ID. How exactly should one check for the group ID?

I had looked through the (from memory) phpbb_groups table and used the ID of the 2nd group which was for subscribers.

Should I have been looking elsewhere?
[hr:1d8xby2d]
found it - I've double checked the URL added for the Instant Payment Notification Preferences on PayPal and that looks to be correct.

I am getting the subscription confirmation emails through from PayPal so I think that part is working.
[hr:1d8xby2d]
All - Still not convinced though that the system is set up on IM properly as when in the ACP the second option under Subscriptions (from memory here) seems to want to give a user more days subscription, but there is only one box there that one can enter data into - I'd have expected a drop down to select a user and a box to enter the number of days. Or does everyone get that?

Thoughts folks?

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Tue Apr 18, 2006 9:55 am
Author: tekguru
Ref the idea that where we may be going wrong is on setting the group ID. (BTW have checked the ID and it is 13 - as the group was created at site launch).

This begs the question as to exactly where we set the group ID in the ACP looking through it I can see 2 groups settings for the Donations Mod, but in subscriber settings I only see:

[flash=,:3de4968i]http://www.4winmobile.com/news/subs_set.png[/flash:3de4968i]

Which I have a feeling has parts missing?

Can anyone advise whether that dialog does look right for the settings?

If it is screwed does anyone have working ACP files? (BBLite Theme)

Cheers

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Tue Apr 18, 2006 1:36 pm
Author: found it
there is also a subscription config in ACP/user admin subscription

though the image you have is exactly the same as the one I have and I am using the same theme....

:mrgreen:

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Tue Apr 18, 2006 2:01 pm
Author: tekguru
Damn.... looks like you have the same setup as me then. Is the Subscription system working for you?

No matter what I do:

- Checked Paypal IPN URL is correct
- Ensured I'm using the primary PayPal account in the ACP
- Checked the correct group has been referenced in phpbb_groups

The users are just not added or deleted from the paid membership group!

This is driving me slowly nuts!

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Tue Apr 18, 2006 3:07 pm
Author: found it
I have had this running for nearly a year now with success...but If I recall there might be some code missing from im1.4.0 which i pointed out at the time ....though I would have to check all the files to see if that is the case....

Re: (Solved!) Paypal Group Subscription not working...

PostPosted: Tue Apr 18, 2006 4:11 pm
Author: tekguru
[img=left:2c0ru9h1]http://www.4winmobile.com/news/sorted.png[/img]I finally worked out what the problem was tonight. I had changed the IPN address 1) to my primary IPN address last night but when I went in to it again tonight it hd flipped back to the secondary address.

So I changed it back and re-entered the config and again it had changed back.

I looked at the raw config table and found there were only two addresses stored in the file - the _b and _p addresses.

This actually means that the addresses marked 1) and 2) are the same internally.

I edited the raw table data and ensure the _b address was correct and that ended up changing both 1) and 2) to the primary address.

This has now resolved the issue for me and subscriptions are working.

So it seems to me to be a bit of a Mod conflict in the config.

Hope it helps others!