Page 1 of 1

Hook when payment process has successfully finished

PostPosted: October 27th, 2011, 7:07 am
by freshman66
Hi all,
I am looking for a hook that gets triggers when a user has successfully finished a payment process - independent from type of checkout. Is there anything like that? Maybe this one:
Code: Select all
ws_plugin__s2member_during_paypal_return_during_explicit_ty_email


Thank you for your help. Cheers,
Freshman

Re: Hook when payment process has successfully finished

PostPosted: October 27th, 2011, 10:54 pm
by Cristián Lávaque
Could you explain what you're trying to do? :)

Re: Hook when payment process has successfully finished

PostPosted: October 27th, 2011, 11:10 pm
by freshman66
Sorry, for not beeing verbose enough :-) I need to capture the moment the user is coming back to the site to update some profile information - to be exact, I would like to track the account balance after a special post purchase. The user will the be able to use this balance to get access to certain tasks on our site. Since ww might want to implement more payment gateways (than paypal) in the future, the hook shiuld be gateway independent and provide information about the user (at least id and the amount paid.
Thank you very much for helping me out.
Cheers from Berlin, freshman

Re: Hook when payment process has successfully finished

PostPosted: October 29th, 2011, 10:19 pm
by Cristián Lávaque
OK. Hmm... Would the Notifications API be enough for what you want? http://www.s2member.com/api-tracking-no ... ons-video/

Re: Hook when payment process has successfully finished

PostPosted: October 31st, 2011, 5:06 am
by freshman66
Bum... Sorry for having wasted your time - I did watch the video before and didn't realize there was a second part. Obviously Notifications are exactly what I was looking for.
Thanks a lot,
Freshman

Re: Hook when payment process has successfully finished

PostPosted: October 31st, 2011, 3:26 pm
by freshman66
Ok, I am running into a problem I can't solve. As you suggested I put in a URL pointing to a custom script into "Specific Post/Page ~ Sale Notification URLs". The script works fine when I directly access it with the correct parameters.
However, as soon as I purchase the "Special Post" through PayPal (Sandbox) everything works fine, but the notification script does not get triggered. In my debug.log I find these lines which are obviously related to s2member.

Code: Select all
[31-Oct-2011 20:16:23] PHP Notice:  Undefined offset: 1 in /wp-content/plugins/s2member/includes/classes/utils-urls.inc.php on line 132
[31-Oct-2011 20:16:23] PHP Notice:  Undefined variable: cache_needs_updating in /wp-content/plugins/s2member/includes/classes/cache.inc.php on line 97
[31-Oct-2011 20:17:02] PHP Notice:  Undefined variable: cache_needs_updating in /wp-content/plugins/s2member/includes/classes/cache.inc.php on line 97
[31-Oct-2011 20:17:02] PHP Notice:  Undefined index: level-1_label in /wp-content/plugins/s2member/includes/classes/constants.inc.php on line 287
[31-Oct-2011 20:17:02] PHP Notice:  Undefined offset: 1 in /wp-content/plugins/s2member/includes/classes/utils-urls.inc.php on line 132
[31-Oct-2011 20:17:04] PHP Notice:  Undefined index: s2member_paypal_proxy in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php on line 78
[31-Oct-2011 20:17:04] PHP Notice:  Undefined index: s2member_paypal_proxy in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php on line 81
[31-Oct-2011 20:17:04] PHP Notice:  Undefined index: s2member_paypal_proxy in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php on line 84
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 1 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 2 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 3 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 4 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 5 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 6 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 7 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 8 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined offset: 9 in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php(166) : regexp code on line 1
[31-Oct-2011 20:17:04] PHP Notice:  Undefined index: s2member_paypal_proxy in /wp-content/plugins/s2member/includes/classes/paypal-notify-in-web-accept-sp.inc.php on line 183
[31-Oct-2011 20:17:04] PHP Notice:  Undefined index: HTTP_USER_AGENT in /wp-content/plugins/s2member/includes/classes/paypal-notify-in.inc.php on line 180
[31-Oct-2011 20:17:05] PHP Notice:  Undefined variable: cache_needs_updating in /wp-content/plugins/s2member/includes/classes/cache.inc.php on line 97
[31-Oct-2011 20:17:09] PHP Notice:  Undefined variable: cache_needs_updating in /wp-content/plugins/s2member/includes/classes/cache.inc.php on line 97
[31-Oct-2011 20:17:09] PHP Notice:  Undefined offset: 1 in /wp-content/plugins/s2member/includes/classes/utils-urls.inc.php on line 132


I do use W3TC, but have disabled DB caching for now. Is there any way to debug S2?
Thank you again,
Freshman

Re: Hook when payment process has successfully finished

PostPosted: November 1st, 2011, 6:28 am
by freshman66
I got it working now, even though I'm not sure what was wrong. The notices persist, however.
Cheers, Stefan

Re: Hook when payment process has successfully finished

PostPosted: November 2nd, 2011, 12:54 am
by Cristián Lávaque
Glad you got it working! :)

The WP_DEBUG Constant turns on Notices from PHP, which are advisory only, NOT errors. These are designed for debugging during development. If you turn on WP_DEBUG for any application, you would always see pages full of advisory "Notices".

I hope that helps.