PriMoThemes — now s2Member® (official notice)
This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™
<?php
add_action ('ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars', 'my_clickbank_return');
function my_clickbank_return () {
if ($_REQUEST['s2member_paypal_proxy'] === 'clickbank') {
echo '<script type="text/javascript">' . "\n";
echo "window.location = 'http://yoursite.com/custom-thankyou';" . "\n";
echo '</script>' . "\n";
/*
Note. Don't use wp_redirect() or header("Location: xxx") here.
The cookies set by s2Member may not be read properly.
Always use window.location = ''; ( as shown above ).
*/
exit ();
}
}
?>
$by_default = $users_can_register = $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["allow_subscribers_in"];
if (is_multisite () && ws_plugin__s2member_is_multisite_farm () && is_main_site ())
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "0"), get_defined_vars ());
eznichepages.com/?s2member_pro_clickbank_return=1&item=1&cbreceipt=XXXXXX&time=1306167574&cbpop=XXXXXX&cbaffi=0&cname=XXXXXX&cemail=XXXXXX&ccountry=US&czip=Zipcode&s2_invoice=1&s2_desc=EZNicheBuilder+Content+Site+Builder+++Unique+Articles&s2_custom=eznichepages.com
array (
'item' => '1',
'cbreceipt' => 'XXXXXX',
'time' => '1306167574',
'cbpop' => 'XXXXX',
'cbaffi' => '0',
'cname' => 'XXXXXX',
'cemail' => 'XXXXXX',
'ccountry' => 'US',
'czip' => 'XXXXXX',
's2_invoice' => '1',
's2_desc' => 'EZNicheBuilder Content Site Builder Unique Articles',
's2_custom' => 'eznichepages.com',
's2member_log' =>
array (
0 => 'Return-Data received on: Mon May 23, 2011 7:45:54 pm UTC',
1 => 's2Member POST vars verified with ClickBank®.',
2 => 'Sleeping for 5 seconds. Giving ClickBank® a chance to finalize processing.',
3 => 'Awake. It\'s Mon May 23, 2011 7:45:59 pm UTC. Processing will continue.',
4 => 'Order API variables have been obtained from ClickBank®.',
5 => 'ClickBank® transaction identified as (SALE/STANDARD).',
6 => 'Return-Data reformulated. Piping through s2Member\'s core/standard PayPal® processor as txn_type (web_accept).',
7 => 'Please check PayPal® RTN logs for further processing details.',
8 => 'http://eznichepages.com/?s2member_paypal_return=1&s2member_paypal_proxy=s2member-pro-module&s2member_paypal_proxy_use=standard-emails&s2member_paypal_proxy_verification=XXXXXXX&txn_type=web_accept&txn_id=XXXXXX&custom=eznichepages.com&mc_gross=XXXXX&mc_currency=USD&tax=0.00&payer_email=XXXXXX&first_name=XXXXXX&last_name=XXXXXX&option_name1&option_selection1&item_number=1&item_name=EZNicheBuilder+Content+Site+Builder+++Unique+Articles',
),
's2vars' =>
array (
's2_invoice' => '1',
's2_desc' => 'EZNicheBuilder Content Site Builder Unique Articles',
's2_custom' => 'eznichepages.com',
),
)
eznichepages.com/?s2member_paypal_return=1&s2member_paypal_proxy=s2member-pro-module&s2member_paypal_proxy_use=standard-emails&s2member_paypal_proxy_verification=XXXXXX&txn_type=web_accept&txn_id=XXXXXX&custom=eznichepages.com&mc_gross=XXXXXX&mc_currency=USD&tax=0.00&payer_email=XXXXXX&first_name=XXXXXX&last_name=XXXXXX&option_name1&option_selection1&item_number=1&item_name=EZNicheBuilder+Content+Site+Builder+++Unique+Articles
array (
'txn_type' => 'web_accept',
'txn_id' => 'XXXXXX',
'custom' => 'eznichepages.com',
'mc_gross' => 'XXXXXX',
'mc_currency' => 'USD',
'tax' => '0.00',
'payer_email' => 'XXXXXX',
'first_name' => 'XXXXXX',
'last_name' => 'XXXXXX',
'option_name1' => '',
'option_selection1' => '',
'item_number' => '1',
'item_name' => 'EZNicheBuilder Content Site Builder Unique Articles',
'proxy_verified' => 's2member-pro-module',
's2member_log' =>
array (
0 => 'Return-Data received on: Mon May 23, 2011 6:43:48 pm UTC',
1 => 's2Member POST vars verified through a POST back to PayPal®.',
2 => 's2Member originating domain ( _SERVER[HTTP_HOST] ) validated.',
3 => 's2Member txn_type identified as (web_accept|subscr_signup|subscr_payment).',
4 => 's2Member txn_type identified as (web_accept|subscr_signup|subscr_payment) w/o update vars.',
5 => 'Registration Cookies set on (web_accept|subscr_signup|subscr_payment) w/o update vars.',
6 => 'Redirecting Customer to Registration Page. They need to Register now.',
),
'subscr_id' => 'XXXXXX',
'eotper' => NULL,
'ccaps' => NULL,
'level' => '1',
's2member_paypal_proxy' => 's2member-pro-module',
's2member_paypal_proxy_use' => 'standard-emails',
's2member_paypal_proxy_verification' => 'XXXXXX',
)
add_action ('ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars', 'clickbank_handler');
function clickbank_handler() {
echo '<script type="text/javascript">' . "\n";
echo "window.location = 'http://www.eznichebuilder.com/thank-you?full_name=".$_REQUEST['first_name']." ".$_REQUEST['last_name']."&email=".$_REQUEST['payer_email']."';";
echo '</script>' . "\n";
exit();
}
thuynh wrote:Line 103:
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "0"), get_defined_vars ());
Shouldn't this be:
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register == "0"), get_defined_vars ());
Line 110:
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register = "1"), get_defined_vars ());
Shouldn't this be:
return apply_filters ("ws_plugin__s2member_check_register_access", ($users_can_register == "1"), get_defined_vars ());
Cristián is correct. The value is being assigned, not compared.Cristián Lávaque wrote:The value is being assigned, not compared, so = is fine.
So the flow is this. We have a sale site on eznichebuilder.com sitting on a separate Single WP installation. Users click on Buy Now from this site and get sent to Clickbank. Upon payment completion, user is sent to eznichepages.com which is where the s2member lives. eznichepages.com is the main site of the farm. You can see the button on http://www.eznichebuilder.com/buy-now/. After users come back from Clickbank, s2member set cookies then the hook ws_plugin__s2member_during_paypal_return_during_subscr_signup_wo_update_vars will send them back to eznichebuilder.com/thank-you. This is one of clickbank's requirement so we had to send users back to the sale site. From the sale site, there's a link to go back to eznichepages.com to register.
This link simply points to http://eznichepages.com/wp-login.php?action=register.
Since cookies are already set, s2member should be able to pick it up and continue. However, it just says Registration disabled. Without that ==, it won't work.
Users browsing this forum: No registered users and 4 guests