Exemplo n.º 1
0
 public static Subscription SubsCancel(Subscription obj)
 {
     return null;
 }
Exemplo n.º 2
0
        public static Subscription SubsCreate()
        {
            //any plan
            var plan = Plan.GetAllPlans().First();

            //fake credit card
            var card = new Card
            {
                CardNumber = "5367624274512386", //master card
                HolderName = "Jose Silva",
                Cvv = "547",
                CardExpirationDate = "0822"
            };

            //gererating a hash to be used for subscription
            var hash = card.GenerateHash();

            //client data
            var customer = new Customer
            {
                Email = "*****@*****.**",
                Name = "José Silva",
                Phones = new List<Phone> { new Phone { Ddd = "11", Ddi = "+55", Number = "987456321" } }
            };
            var obj = new Subscription
            {
                PlanId = plan.Id,
                Customer = customer,
                CardHash = hash
            };
            obj.Create();
            return obj;
        }
Exemplo n.º 3
0
 public static Subscription SubsUpdate(Subscription obj)
 {
     return null;
 }