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.

grabbing extra fields on pay pal pro chekout

Home Forums Community Forum grabbing extra fields on pay pal pro chekout

This topic contains 6 replies, has 2 voices. Last updated by  Marlin Cobb 4 years, 3 months ago.

Topic Author Topic
Posted: Thursday Sep 13th, 2012 at 2:08 pm #25200

I have put a couple of extra fields in the paypal pro checkout form . I want to access them to store and was told to use the ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars action hook, but that does not ever seem to get called. I invoke the form using a

<?php echo (c_ws_plugin__s2member_pro_paypal_form::sc_paypal_form($attr)); ?>

I am stuck . I just need to grab the $POST on submit.


add_action('ws_plugin__s2member_during_paypal_notify_during_subscr_signup_w_update_vars', 'save_xtra_checkout_fields');
function save_xtra_checkout_fields($vars = array()) {
echo ("You re in this function");
askfjsaf;
$xtrafields = array("CC4" => "cc4", "REF" => "ref", "Gender" => "gender"); 
$userid = $vars['user_id'];
foreach ($xtrafields as $fieldname) {      
    update_user_meta( $userid, $fieldname, $_POST[$fieldname] ); 
    asfsafsaf ;
    }
}   

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Thursday Sep 13th, 2012 at 11:53 pm #25240
Raam Dev
Username: Raam
Staff Member

Marlin,

Using askfjsaf; in your code will produce a PHP notice about an undefined constant. I’m not sure why you have those lines in there, as they do nothing.

Also, all the data you need can be found in the $vars array; you don’t retrieve it from the $_POST var.

Try adding the following two lines after your echo statement to see everything that’s inside the $var array:

print_r($vars);
exit;

Once you know where the data is inside the $var array, you can retrieve the necessary data and do your update.

Posted: Friday Sep 14th, 2012 at 12:05 am #25243

That is in there to try and error out to see if it gets called. That function Nevers gets called. I have tried print_r etc.. But the routine never gets entered.

Posted: Friday Sep 14th, 2012 at 12:45 am #25254
Raam Dev
Username: Raam
Staff Member

Marlin,

I believe you’re using the wrong hook. That hook is only for *upgrades*, not first-time registrations. Please try using ws_plugin__s2member_during_paypal_notify_during_subscr_signup_wo_update_vars (docs here).

Posted: Friday Sep 14th, 2012 at 6:22 am #25278

That does not appear to get called either. I just don;t get any indication, although I get a successful paypal sandbox checkout, that this function gets called at all.

Posted: Sunday Sep 16th, 2012 at 10:50 pm #25527
Raam Dev
Username: Raam
Staff Member

Have you tried testing using a live $0.01 transaction instead of the PayPal Sandbox? I know the hook works, as others are using it.

Posted: Sunday Sep 16th, 2012 at 10:58 pm #25530

I ended up using: ws_plugin__s2member_before_paypal_api_response

Which gives the $_POST values before they go to PPal, it works great. I am sure it is a sandbox issue as far as getting the the other call to work.

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