public ActionResult CreateSubscriber(SiteSubscriber obj)
 {
     if (ModelState.IsValid)
     {
         Guid guid = new Guid();
         Random rnmd = new Random();
         PinPaymentsDbEntities db = new PinPaymentsDbEntities();
         if (ModelState.IsValid)
         {
             tblCustomer obtbl = new tblCustomer();
             CustomerModel model = new CustomerModel();
             int cutomerid = model.AddCustomer(obj);
             xml = "<subscriber><customer-id>" + cutomerid + "</customer-id><screen-name>" + obj.FirstName + obj.LastName + "</screen-name></subscriber>";
             site = ConfigurationManager.AppSettings["apiUrl"].ToString();
             url = string.Format("https://subs.pinpayments.com/api/v4/{0}/subscribers.xml", site);
             CreateSubscriberApi(url, xml, "Post");
             CardDetail obj1 = new CardDetail();
             obj1.token = GenrateInvoice(obj.SubscriptionId, cutomerid.ToString(), obj.FirstName, obj.Email);
             obj1.firstName = obj.FirstName;
             obj1.lastName = obj.LastName;
             ViewBag.year = DBCommon.BindYear();
             ViewBag.month = DBCommon.BindMonth();
             return RedirectToAction("AddCardDetail", obj1);
         }
         return View("CreateSubscriber");
     }
     else
     {
         return View(obj);
     }
 }
 public ActionResult CreateSubscriber(string id)
 {
     try
     {
         IList<Plans> plans = GetPlans();
         var f = plans.FirstOrDefault(x => x.Name == id);
         SiteSubscriber obj = new SiteSubscriber();
         obj.SubscriptionId = f.Id.ToString();
         return View("CreateSubscriber", obj);
     }
     catch
     {
         return null;
     }
 }