public AmendResponseHolder DoTermsAndConditionsAmendment(String subscriptionId, DateTime effectiveDate, String termType, int initialTerm, int renewalTerm, AmendOptions ao = null, PreviewOptions po = null) { AmendRequest amendRequest = new AmendRequest(); Amendment amendment = new Amendment(); if (ao != null) { amendRequest.AmendOptions = ao; } if (po != null) { amendRequest.PreviewOptions = po; } amendment.Name = "T's and C's amendment"; amendment.Type = "TermsAndConditions"; amendment.ContractEffectiveDate = effectiveDate; amendment.ContractEffectiveDateSpecified = true; if(termType != null) amendment.TermType = termType; amendment.InitialTerm = initialTerm; amendment.InitialTermSpecified = true; amendment.RenewalTerm = renewalTerm; amendment.RenewalTermSpecified = true; amendment.SubscriptionId = subscriptionId; amendRequest.Amendments = new Amendment[] { amendment }; return zs.Amend(new List<AmendRequest> { amendRequest })[0]; }
public AmendResponseHolder DoAddProductAmendment(String subscriptionId, DateTime effectiveDate, String productRatePlanId, AmendOptions ao = null, PreviewOptions po = null) { AmendRequest amendRequest = new AmendRequest(); Amendment amendment = new Amendment(); amendment.Name = "Add Product Amendment"; amendment.Type = "NewProduct"; amendment.ContractEffectiveDate = effectiveDate; amendment.ContractEffectiveDateSpecified = true; amendment.SubscriptionId = subscriptionId; RatePlanData ratePlanData = new RatePlanData(); RatePlan ratePlan = new RatePlan(); ratePlan.ProductRatePlanId = productRatePlanId; ratePlanData.RatePlan = ratePlan; amendment.RatePlanData = ratePlanData; if (ao != null) { amendRequest.AmendOptions = ao; } if (po != null) { amendRequest.PreviewOptions = po; } amendRequest.Amendments = new Amendment[] { amendment }; return zs.Amend(new List<AmendRequest> { amendRequest })[0]; }
public AmendResponseHolder DoRenewalAmendment(String subscriptionId, DateTime effectiveDate, AmendOptions ao = null, PreviewOptions po = null) { AmendRequest amendRequest = new AmendRequest(); Amendment amendment = new Amendment(); if (ao != null) { amendRequest.AmendOptions = ao; } if (po != null) { amendRequest.PreviewOptions = po; } amendment.Name = "Renewal amendment"; amendment.Type = "Renewal"; amendment.ContractEffectiveDate = effectiveDate; amendment.ContractEffectiveDateSpecified = true; amendment.SubscriptionId = subscriptionId; amendRequest.Amendments = new Amendment[] { amendment }; return zs.Amend(new List<AmendRequest> { amendRequest })[0]; }
public AmendRequest CreateAmendRequest(String subscriptionId, String type) { AmendRequest amendRequest = new AmendRequest(); Amendment amendment = new Amendment(); if (type == "tsandcs") { amendment.Name = "t's and c's amendment"; amendment.Type = "TermsAndConditions"; amendment.ContractEffectiveDate = DateTime.Now; amendment.ContractEffectiveDateSpecified = true; amendment.TermType = "TERMED"; amendment.InitialTerm = 12; amendment.InitialTermSpecified = true; amendment.RenewalTerm = 24; amendment.RenewalTermSpecified = true; amendment.SubscriptionId = subscriptionId; } amendRequest.Amendments = new Amendment[] { amendment }; return amendRequest; }