Community Support Forums — WordPress® ( Users Helping Users ) — 2011-03-04T22:02:07-05:00 http://www.primothemes.com/forums/feed.php?f=36&t=2062 2011-03-04T22:02:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2062&p=7407#p7407 <![CDATA[Re: API Call to check status of subscription]]>
Code:
<?php
$user_id 
= "1";
$subscr_id = get_user_option("s2member_subscr_id", $user_id);
$paypal = array ("METHOD" => "GetRecurringPaymentsProfileDetails", "PROFILEID" => $subscr_id);
if (($paypal = c_ws_plugin__s2member_paypal_utilities::paypal_api_response ($paypal)) && !$paypal["__error"])
    $status = $paypal["STATUS"];
?>
* this code snippet requires s2Member Pro v1.5+

Possible values for $status are:
Code:
ActiveProfile
PendingProfile
CancelledProfile
SuspendedProfile
ExpiredProfile

Other details about the Recurring Profile are also available in the $paypal array. The fields in this array are documented in the PayPal® Pro API guide, which is included with the latest version of s2Member Pro. Please check your account at s2Member.com for the /s2m-pro-extras.zip file. Inside the zip you will find the API doc. Its file name is: paypal-pro-api.pdf. In the PDF, you'll want to read the section on the Response Vars for "GetRecurringPaymentsProfileDetails".
Code:
print_r($paypal); // spits out a full list of variables during testing.

Statistics: Posted by Jason Caldwell — March 4th, 2011, 10:02 pm


]]>
2011-02-03T06:30:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2062&p=6292#p6292 <![CDATA[API Call to check status of subscription]]>
am just evaluating s2member for my project and have been through the nice tutorial videos.

is there any way like this
Code:
check_subscription($user_id)

to check the current status of a subscription?

Or would I need to use the notification API to store the current status per user by myself?

cheers
cord

Statistics: Posted by MailBeez — February 3rd, 2011, 6:30 am


]]>