예제 #1
0
function getSubscriptions()
{
    global $messages;
    $userSub = SubscriptionManager::getCurrentSubscriptions($_SESSION['accountId']);
    $messages = $userSub;
}
예제 #2
0
function test_Amender_updateRatePlan()
{
    global $EXISTING_CUSTOMER_ACCOUNT_NAME;
    printResultStart(__FUNCTION__);
    $messages = array();
    try {
        //Get the Rateplan ID of an updatable active plan on this user's subscription
        $sub = SubscriptionManager::getCurrentSubscriptions($EXISTING_CUSTOMER_ACCOUNT_NAME);
        $rpId = null;
        foreach ($sub->active_plans as $rp) {
            if ($rp->uom != null) {
                $rpId = $rp->Id;
            }
        }
        if ($rpId == null) {
            echo "This must have an updatable rate plan to run this test.";
            printResultEnd($messages);
            return;
        }
        echo "Updating quantity of Rate Plan '" . $rpId . "' on account '" . $EXISTING_CUSTOMER_ACCOUNT_NAME . "'<br>";
        //Test
        $amRes = Amender::updateRatePlan($EXISTING_CUSTOMER_ACCOUNT_NAME, $rpId, 4, true);
        print_r_html($amRes);
        /*
        		if($amRes->results->Success){
        			echo "<br>RemoveProduct amendment successfully created.<br>";
        
        			$zapi = new zApi();
        			echo "Deleting created amendment.<br>";
        			$deleteResult = $zapi->zDelete(array($amRes->results->AmendmentIds),'Amendment');
        			print_r_html($deleteResult);
        
        		}*/
    } catch (Exception $e) {
        array_push($messages, $e->getMessage());
    }
    printResultEnd($messages);
}