listSubscriptions($priceplanId, $endUserAreaId, $endUserId, $activeOnly);
if ($api->hasErrors()){
sendError($api->getErrorMessage());
return;
}
$error='';
if (!$res){
$error=__('There was an error while trying to list the active subscriptions', 'bachbill');
}
if ($res['error']){
$error=$res['error']['message'];
}else {
$res=$res['GetUserSubscriptionsResponse'];
if ($res['code']==0){
}else {
$error=__('There was an error while trying to list the active subscriptions', 'bachbill');
}
}
get_header();
?>
';
if ($res['Subscription'] && !$res['Subscription']['id']){
$res=$res['Subscription'];
}
echo renderSubscriptions($res);
// foreach ($res as $x){
// echo renderSubscriptions($x);
// }
}
?>
calncelSubscription($priceplanId, $endUserAreaId, $endUserId, $subscriptionId);
if ($api->hasErrors()){
sendError($api->getErrorMessage());
return;
}
$error='';
if (!$res){
$error=__('There was an error while trying to cancel the subscription', 'bachbill');
}
if ($res['error']){
$error=$res['error']['message'];
}else {
$res=$res['PurchaseResponse'];
if ($res['code']==0){
$redirect='selfcare.php?action=list';
wp_redirect($redirect);
return;
}else {
$error=__('There was an error while trying to cancel the subscription', 'bachbill');
}
}
get_header();
?>