latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Payment Notifications not always triggering?

Home Forums Community Forum Payment Notifications not always triggering?

This topic contains 4 replies, has 2 voices. Last updated by  Jason (Lead Developer) 3 years, 11 months ago.

Topic Author Topic
Posted: Tuesday Jan 15th, 2013 at 1:42 pm #37612

Due to our business model, it’s *very* important we know the last time anyone paid us any money, so we added a payment notification hook, as it’s described “In other words, a Payment Notification occurs anytime funds are received, no matter what.”.

We started logging all requests that come to this file in order to track down the problem, and we’ve encountered an instance where we have a record of a paypal transaction in paypal-api.log, nothing in paypal-ipn.log, and nothing triggered from the payment notification hook – it’s possible I’m misunderstanding the functionality of this hook – if
so feel free to advise.

Transaction in paypal-api.log occurred at: Mon Jan 14, 2013 4:43:24 pm UTC
s2Member Version: 120703
s2Member Pro Version: 120703


List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Tuesday Jan 15th, 2013 at 3:38 pm #37637
Staff Member

Thanks for reporting this important issue.

Please send us a copy of all of your recent log files privately, along with a reference to the specific transaction that you mentioned. I will review the log files for you and provide some clarity on this. Or, if you would prefer NOT to send us all of your log files, please send me all of the log entries related to a specific customer. Feel free to xxxxx out any sensitive information before you send them over.

Please use: s2Member® » Private Contact Form

Posted: Tuesday Jan 15th, 2013 at 6:17 pm #37681
Staff Member

Details received. Thank you!

~ Investigating.

Posted: Wednesday Jan 16th, 2013 at 12:41 pm #37780
Staff Member

Thanks for your patience.

I confirmed the missing log entries, which also explains the missing Payment Notification you mentioned. In order to solve the missing Payment Notification issue, we just need to solve the missing log entries (e.g. to determine why s2Member is failing to receive the IPN data related to this type of transaction).

I was unable to reproduce this in our lab, so I have to assume (at this point), the issue is installation-specific. Whenever I see data in the paypal-api.log file, but there is no matching data in the paypal-ipn.log file, it indicates to me that s2Member’s remote connection to it’s IPN handler is failing internally (e.g. the remote URL connection is timing out, or failing to connect – either all the time, or some of the time).

Because s2Member uses the built-in WordPress WP_Http class to make these connections, we can attach a logger to this class, and monitor errors that occur. My hope is this will shed light on the underlying issue for you.

Please create this directory and file:
(NOTE: these are MUST USE plugins, see:
(See also:

add_action('http_api_debug', 's2_http_api_debug', 1000, 5);
function s2_http_api_debug($response = NULL, $state = NULL, $class = NULL, $args = NULL, $url = NULL)
		$info = array(
			'state'           => $state,
			'transport_class' => $class,
			'args'            => $args,
			'url'             => $url,
			'response'        => $response
		$logs_dir = WP_CONTENT_DIR.'/plugins/s2member-logs';
				mkdir($logs_dir, 0777, TRUE);
				file_put_contents($logs_dir.'/.htaccess', 'deny from all');
		file_put_contents($logs_dir.'/http-api-debug.log', var_export($info, TRUE)."\n\n", FILE_APPEND);
Please monitor this log file (/s2member-logs/http-api-debug.log), and let us know if you come up with anything. Feel free to send this log over to us for review if this problem occurs again, so we can help you determine what the underlying issue really is. Thanks!
Posted: Thursday Jan 17th, 2013 at 1:33 pm #37908
Staff Member

KB article written to describe the process of debugging HTTP connections.
See: Knowledge Base » Debugging HTTP Connections

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.