/** * Deletes the selected payment method from the logged in user's account * @param $pmId ID of payment method to be removed */ public static function removePaymentMethod($pmId) { $zapi = new zApi(); $deleteResult = $zapi->zDelete(array($pmId), 'PaymentMethod'); return $deleteResult; }
function test_Amender_removeRatePlan() { global $EXISTING_CUSTOMER_ACCOUNT_NAME; printResultStart(__FUNCTION__); $messages = array(); try { //Get the Rateplan ID of one of the active plans on this user's subscription $sub = SubscriptionManager::getCurrentSubscriptions($EXISTING_CUSTOMER_ACCOUNT_NAME); $rpId = $sub->active_plans[0]->Id; echo "Removing '" . $sub->active_plans[0]->ProductName . " : " . $sub->active_plans[0]->Name . "' from subscription on account '" . $EXISTING_CUSTOMER_ACCOUNT_NAME . "'<br>"; //Test $amRes = Amender::removeRatePlan($EXISTING_CUSTOMER_ACCOUNT_NAME, $rpId, false); 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); }