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.

PayPal ProfileID

Home Forums Community Forum PayPal ProfileID

This topic contains 9 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 3 months ago.

Topic Author Topic
Posted: Friday Aug 24th, 2012 at 2:36 pm #22994

I am using S2 Pro with PayPal Pro and I need to access user information in PP via the API. I have tried using wp_s2member_subscr_id as the PP profile ID, but it does not accept it. It looks like wp_s2member_subscr_id is 17 characters long and PP’s is supposed to be 19 characters long. How can I get a hold of the PP profile ID?

I have to say that if there were a few more data points stored in the DB for price, expire date, next renew date, etc… it would make life MUCH easier on people using S2.

Thanks for your help!

List Of Topic Replies

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Saturday Aug 25th, 2012 at 6:50 am #23042

Hi Brett.

It looks like wp_s2member_subscr_id is 17 characters long and PP’s is supposed to be 19 characters long. How can I get a hold of the PP profile ID?

I’ll email Jason asking him this.

I have to say that if there were a few more data points stored in the DB for price, expire date, next renew date, etc… it would make life MUCH easier on people using S2.

Yes, we are already hard at work on those with the new s2Member being developed. :)

Posted: Monday Aug 27th, 2012 at 2:00 pm #23182

Thanks for helping Cristian! I’ll keep an eye out for a response from Jason.

Any idea when the new S2Member with subscription info locally stored will be out?

Posted: Tuesday Aug 28th, 2012 at 7:13 am #23255

No, no date yet. We’ll make an announcement when we it’s ready for release. :)

Posted: Tuesday Aug 28th, 2012 at 1:04 pm #23316

Any word on the PayPal profile ID? I’m stuck until I hear back from you…

Posted: Tuesday Aug 28th, 2012 at 11:42 pm #23372
Staff Member

Thanks for the heads up on this thread.

19 characters is generally used with older PayPal Recurring Profiles. PayPal Profile IDs are now 14 characters in length, and PayPal Transaction IDs are usually 17 characters in length. So it sounds to me like the original transaction recorded by s2Member, and subsequently stored inside wp_s2member_subscr_id, is actually a “Buy Now” transaction ID, and not actually a Recurring Profile ID.

If problems persist, I would go back to your s2Member Shortcode, and check to see if the billing details specify any recurring fees. If it does not, then wp_s2member_subscr_id contains the Transaction ID, and not a Recurring Profile ID (i.e. there were no recurring charges).

See also: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_ManageRecurringPaymentsProfileStatus

I should also note that s2Member Pro makes a utility function available, which makes it easy for site owners to communicate with the PayPal Pro API. I’ve provided a code sample here:
http://www.primothemes.com/forums/viewtopic.php?f=4&t=2062#p7407

The same concept you’ll see in that thread, also applies to almost all PayPal API calls.

<?php
$paypal = array(); // Your input array of data to send to the PayPal API.
if (($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_api_response ($paypal)) && empty($paypal&#91;"__error"&#93;))
 print_r($paypal); // Output array. See PayPal API docs for response variables that come from PayPal.
?>
Posted: Thursday Aug 30th, 2012 at 4:55 pm #23619

So if the value in wp_s2member_subscr_id is indeed a non recurring charge, how can I get information on it? Specifically, the item in question is a subscription that should have a start and end date. When I run your PHP code, I am getting an error message back saying that the profile ID is invalid. Am I at a dead end at this point?

Posted: Monday Sep 3rd, 2012 at 2:36 am #23901
Staff Member

Thanks for the follow-up.

In the case of a “Buy Now” transaction, there is never a Recurring Profile to reference at PayPal, because s2Member did not need to create one (e.g. the subscription was paid for with a single charge only). In other words, there are NO recurring fees.

However, what you’ve mentioned here, is that s2Member DOES make it possible to specify a start/end date, even for Buy Now transactions. In this case, there is only a single “Buy Now” transaction, and NO Recurring Profile is generated. The start date of the subscription begins on the date of purchase, and the end date/time is established with an automatic EOT Time, which s2Member stores locally in your WordPress database.

You can find the end date/time for a particular customer by running the following code snippet.

<?php
$user_id = 123;
$eot_time = get_user_option('s2member_auto_eot_time');
// This is the end time, in the form of a UNIX UTC timestamp.
?>
Posted: Monday Sep 10th, 2012 at 4:51 pm #24774

This worked great. Thanks Jason & Cristian!

Posted: Tuesday Sep 11th, 2012 at 7:26 am #24871

Great! Thanks for the update. :)

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