I’ve actually had pretty good success with the Paypal sandbox in its latest form and can do just about everything in a local install. This project is finally just about ready to go on a test site online for more testing before going live.
I searched a bit more and found out that custom capabilities and the success="" parameter don’t mix as success only fires when the transaction is related to a new member. I had to do
I ultimately did the following which works…though may not be the best way of handling this:
In s2Member API/Notifications>Payment Notifications, I added the following which is in the url from what paypal returns:
http://127.0.0.1/coa101307/my-page/?s2member_paypal_xco=s2member_pro_paypal_checkout_return
I have a separate php file located in the mu-plugins folder that has the following check:
add_filter(‘ws_plugin__s2member_pro_paypal_checkout_post_attr’, function ($attr) {
if (!empty($_GET[‘s2member_paypal_xco’]) && $_GET[‘s2member_paypal_xco’] === ‘s2member_pro_paypal_checkout_return’) {
Then inside the if function I have the following redirect code (in addition to some other stuff)
$redirect_url = get_site_url() . ‘/my-thank-you-page/’;
wp_redirect($redirect_url);
exit;
This actually circumvents the confirmation s2Member will send to the purchaser, but that is ok as I was going to have to do this anyway for a custom function.