Exemplo n.º 1
0
        public void deletePaymentSource()
        {
            conekta.Api.apiKey  = "key_eYvWV7gSDkNYXsmr";
            conekta.Api.version = "2.0.0";

            Customer customer = new conekta.Customer().create(@"{
			    ""name"": ""Emiliano Cabrera"",
			    ""phone"": ""+5215544443333"",
			    ""email"": ""*****@*****.**""
			}"            );

            PaymentSource payment_source = customer.createPaymentSource(@"{
			    ""token_id"": ""tok_test_visa_4242"",
			    ""type"": ""card""
			}"            );

            payment_source = payment_source.update(@"{
				""name"": ""Emiliano Suarez""
			}"            );

            Assert.AreEqual(payment_source.name, "Emiliano Suarez");

            payment_source = payment_source.destroy();

            Assert.AreEqual(payment_source.name, "Emiliano Suarez");
        }
Exemplo n.º 2
0
        public void createPaymentSource()
        {
            conekta.Api.apiKey  = "key_eYvWV7gSDkNYXsmr";
            conekta.Api.version = "2.0.0";

            Customer customer = new conekta.Customer().create(@"{
			    ""name"": ""Emiliano Cabrera"",
			    ""phone"": ""+5215544443333"",
			    ""email"": ""*****@*****.**"",
			    ""corporate"": true,
			    ""payment_sources"": []
			}"            );

            PaymentSource payment_source = customer.createPaymentSource(@"{
			    ""token_id"": ""tok_test_visa_4242"",
			    ""type"": ""card""
			}"            );

            Assert.AreEqual(payment_source.type, "card");
            Assert.AreEqual(payment_source.name, "Jorge Lopez");
        }