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.

Reasons for API Notifications not working?

Home Forums Community Forum Reasons for API Notifications not working?

Tagged: ,

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

Topic Author Topic
Posted: Friday May 25th, 2012 at 9:54 am #14592
Sacha Greif
Username: sachag

I was just notified of a new monthly payment from one of my customers by Paypal, but for some reason it seems the API notification URL wasn’t triggered (I would know since it sends me an email). What’s strange is that for past payments by other customers, it was working properly.

Is there any reason why that would happen? Is there a way I can test that payment notifications are set up properly? Or some documentation about this matter?

List Of Topic Replies

Viewing 25 replies - 1 through 25 (of 35 total)
Author Replies
Author Replies
Posted: Friday May 25th, 2012 at 9:58 am #14593
Sacha Greif
Username: sachag

Note: my problem sounds similar to this other thread:

http://www.s2member.com/forums/topic/payment-notification-url-not-working/

Posted: Friday May 25th, 2012 at 10:33 pm #14649

Hi Sasha.

Are you using the sandbox as that other user was?

It’d help to have your log entries for the transaction with the problem. Could you post them x’ing out any private info like email address?[hilite path]Dashboard -› s2Member® -› PayPal® Options -› Account Details -› Logging[/hilite]

Are other emails being sent by the site?

Posted: Saturday May 26th, 2012 at 2:19 pm #14692

I have the same issue and was just about to create another thread. On April 26th for me the payment notification stopped working. We went over issues on the website to see if we had changed anything and we could not find one.

We also can not bet notifications to fire on a succesful payment for google tracking and for sending our pixel token to ShareASale.

I can not find anything bad in any logs.

Posted: Saturday May 26th, 2012 at 6:35 pm #14706

Marlin, Sasha, could you send your login info via the contact form, please? In case Jason wants to run some diagnostics. Thanks! s2Member® » Private Contact Form

Posted: Saturday May 26th, 2012 at 6:37 pm #14707

Ah, and please confirm these:

Sasha, your problem is with the notification’s email field.

Marlin, your problem is with the payment notification URL or email field?

Posted: Saturday May 26th, 2012 at 6:52 pm #14709

Sasha, are other emails being sent successfully by WordPress?

Let me know if this helps: Knowledge Base » Troubleshooting Email Delivery Problems

Posted: Saturday May 26th, 2012 at 9:18 pm #14729
Sacha Greif
Username: sachag

No, sorry, my problem is with the payment URL field as well. It’s just that I set up the notification page to also send an email (I hadn’t seen you could do it right from the S2member admin).

And yes, other emails are getting sent out fine.

I suspect the problem is that payment triggers are not reaching s2member at all. Since I didn’t change the code since the last successful notification, maybe PayPal changed their implementation somehow?

Posted: Sunday May 27th, 2012 at 5:04 am #14750

Thanks Sasha, got your email with the info. Nothing wrong jumps at me.

Would you help me doing a test? I’d like to make sure it’s not a conflict with another plugin that’s causing this problem. The site is live, so it’s harder to do there, but you can install a fresh copy of WordPress and s2Member in a directory and test there. Just those two, no other plugin or theme.

Configure the payment notification, configure the PayPal integration, create a button for 1 cent and make the purchase. Does the notification work? Try the URL to your script and the email too. If the URL works, did it pass the values or the replacement codes?

Thanks!

Posted: Sunday May 27th, 2012 at 6:21 am #14758
Sacha Greif
Username: sachag

OK, I’ll do this tomorrow. But just to clarify, do you want me to use a notification URL for the new, fresh WP install, or the one of the current site? Or both?

Posted: Sunday May 27th, 2012 at 6:36 am #14759

The new test installation, please. You already know it’s not working in the current installation you have, or is it working?

Posted: Sunday May 27th, 2012 at 6:56 am #14763
Sacha Greif
Username: sachag

No, it’s not working (or at least, it didn’t work once… I don’t get payments every day so it’s kinda hard to test out).

Posted: Sunday May 27th, 2012 at 5:44 pm #14772

Got it. Then I look forward to your tests in the fresh installation. Thanks for your help. :)

Posted: Sunday May 27th, 2012 at 9:22 pm #14788
Sacha Greif
Username: sachag

Actually, I set up a single Paypal button on the old site with a 1 euro subscription, and that worked (sorry, I should have tried that first!). And I also cancelled the subscription after, and that worked too.

So it’s very possible that the problem was a one-time only thing. In any case, I will keep an eye out and let you know if it happens again.

Posted: Sunday May 27th, 2012 at 9:55 pm #14792

Cool!

Sure, please let us know. :)

Posted: Sunday Jun 3rd, 2012 at 11:04 pm #15308
Sacha Greif
Username: sachag

I can confirm that the notifications are only working maybe 50% of the time.

I also checked the PayPal logs, and the transactions that are not sending out notifications also don’t appear in the log.

So it seems that there’s a breakdown of communication somewhere between PayPal and S2Member, but only for some of the transactions.

Posted: Sunday Jun 3rd, 2012 at 11:29 pm #15312

OK, thanks for the update.

So if the transaction gets logged, the notification works, but if there’s no notification, there isn’t a log entry for the transaction either? Then the problem would be with the PayPal integration, not the notifications API, like you said.

What information do you have regarding the transactions that weren’t logged? Are all your PayPal buttons generated with an s2Member shortcode? Or do you have some that were created some other way?

Posted: Sunday Jun 3rd, 2012 at 11:59 pm #15314
Sacha Greif
Username: sachag

OK, I might have an explanation. I’ve compared the profiles of users who trigger notifications and users who don’t, and the difference is that for users who don’t, their “Custom Value” field is empty.

I’m not sure why that is, but maybe it’s because they signed up a long time ago when I was using a different version of S2Member and didn’t have S2Member Pro?

In any case, to test out my theory I’d like to fill in the “Custom Value” field for every user on the site and see if I get more notifications. Is there a quick way to do that by any chance, or should I hack a custom function?

Posted: Monday Jun 4th, 2012 at 3:27 am #15320
Sacha Greif
Username: sachag

OK, I changed the custom values. I don’t know if it’ll have an impact on the problem, but for what it’s worth here’s the code I used to do that, maybe it’ll help others:

/*-----------------------------------------------------------------------------------*/
/*                                 Fill in all custom values                         */
/*-----------------------------------------------------------------------------------*/
add_action('admin_menu', 'fill_custom_values_menu');

function fill_custom_values_menu() {
	add_options_page('Fill Custom Values', 'Custom Values', 'manage_options', 'fill-custom-values', 'fill_custom_values');
}

function fill_custom_values(){
	global $wpdb;
	echo '<table>';
	$sort = "user_nicename";
	$aUsersID = $wpdb->get_col( $wpdb->prepare(
		"SELECT $wpdb->users.ID FROM $wpdb->users ORDER BY %s ASC"
		, $sort ));
	foreach ( $aUsersID as $iUserID ) :
		$user = get_userdata( $iUserID );
		$custom_value =  get_user_meta($iUserID, "wp_s2member_custom", true);
		$new_custom_value = "YOUR_NEW_VALUE";
	
		echo "<tr><td>".$user->first_name ." " .$user->last_name."</td>";
		if($custom_value != $new_custom_value){
			update_user_meta( $iUserID, "wp_s2member_custom", $new_custom_value );
			echo '<td>Changed "'.$custom_value.'" to "'.$new_custom_value.'"</td>';
		}else{
			echo '<td>Nothing to change </td>';
		}
		echo "</tr>";
	endforeach; // end the users loop.
	echo '</table>';
}
Posted: Monday Jun 4th, 2012 at 4:25 am #15324

Oh, I see. Well, it could be a reason. Let me know how it goes! I hope it fixes your problem. :)

Posted: Monday Jun 4th, 2012 at 8:30 am #15355
Sacha Greif
Username: sachag

Nope, didn’t fix the problem… And by the way yes, all my Paypal buttons were created with S2member.

Let me know if you have any idea of how I can debug or at least identify the problem, I’ll keep trying things out as well.

Posted: Monday Jun 4th, 2012 at 10:45 pm #15415

I took a look at a couple of your users and some, although they have the subscr. id, are lacking the payment gateway. You need to set it to paypal if that’s where they have the subscription.

Let me know if it helps.

Posted: Monday Jun 4th, 2012 at 11:08 pm #15417
Sacha Greif
Username: sachag

Thanks a lot for taking a look, I really appreciate you taking the time to help me out!

Some users don’t have payment information because they’re using the site for free.

But even users with all fields correctly filled in (paid subsc gateway, paid subscr id, custom value, etc.) still fail to trigger the notifications when they make a Paypal payment.

Posted: Monday Jun 4th, 2012 at 11:22 pm #15418
Sacha Greif
Username: sachag

OK, I think I got it. The reason for the problem might be that I changed the site’s domain, from nrfight.com to nrfight.tv.

Here’s the profile for a user who is not triggering notifications, and as you can see it still says “nrfight.com”:

The domain change now seems like a pretty obvious reason for the problem. But since I changed all the URLs from within S2Member, I thought PayPal would be smart enough to know about the move…

Now it remains to be seen how I can fix this mess from within PayPal… :(

Oh and by the way, editing a user’s profile within PayPal triggers a S2Member modification notification, so it’s a good way to test which users are hooked up and which are not.

  • This reply was modified 4 years, 7 months ago by  Sacha Greif.
Posted: Tuesday Jun 5th, 2012 at 6:37 am #15462

I see.

Well, the nrfight.com seems to be in the description. You could, to test this, change the custom value in the user’s profile to match the nrfight.com you see in PayPal and test if that fixes it.

Thanks a lot for taking a look, I really appreciate you taking the time to help me out!

No problem. I’m sorry I haven’t found the problem yet. :/

Some users don’t have payment information because they’re using the site for free.

I saw users without subscr id or gateway, but I meant one that had subscr id without the gateway.

Posted: Tuesday Jun 5th, 2012 at 6:54 am #15467
Sacha Greif
Username: sachag

I already changed the custom values for all the users, so I don’t think that was it.

And I don’t know exactly how S2Member works, but I assume that if PayPal was sending the notifications to the right URL, S2Member would receive them… so it seems like the problem is probably with PayPal?

Viewing 25 replies - 1 through 25 (of 35 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.