当前位置: 首页>>代码示例>>C#>>正文


C# Card.Save方法代码示例

本文整理汇总了C#中Card.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Card.Save方法的具体用法?C# Card.Save怎么用?C# Card.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Card的用法示例。


在下文中一共展示了Card.Save方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: createNonCreditableCard

 protected Card createNonCreditableCard()
 {
     Card card = new Card();
     card.name = "Georg Telemann";
     card.number = "4111111111111111";
     card.expiration_month = 12;
     card.expiration_year = 2016;
     card.Save();
     return card;
 }
开发者ID:NSAKHAN,项目名称:balanced-csharp,代码行数:10,代码来源:BaseTest.cs

示例2: createCreditableCard

 protected Card createCreditableCard()
 {
     Card card = new Card();
     card.name = "Johannes Bach";
     card.number = "4342561111111118";
     card.expiration_month = 05;
     card.expiration_year = 2016;
     card.Save();
     return card;
 }
开发者ID:NSAKHAN,项目名称:balanced-csharp,代码行数:10,代码来源:BaseTest.cs

示例3: createCard

        protected Card createCard()
        {
            Dictionary<string, string> address = new Dictionary<string, string>();
            address.Add("line1", "123 Fake Street");
            address.Add("city", "Jollywood");
            address.Add("postal_code", "90210");

            Card card = new Card();
            card.name = "Homer Jay";
            card.number = "4112344112344113";
            card.cvv = "123";
            card.expiration_month = 12;
            card.expiration_year = 2016;
            card.address = address;
            card.Save();
            return card;
        }
开发者ID:remear,项目名称:balanced-csharp,代码行数:17,代码来源:BaseTest.cs

示例4: TestCardDelete

        public void TestCardDelete()
        {
            Card card = new Card();
            card.name = "John Jameson";
            card.number = "5105105105105100";
            card.expiration_month = 12;
            card.expiration_year = 2020;
            card.cvv = "123";
            card.Save();

            string href = card.href;

            card.Unstore();

            Card deletedCard = Balanced.Card.Fetch(href);
            Assert.AreEqual(false, deletedCard.can_debit);
        }
开发者ID:NSAKHAN,项目名称:balanced-csharp,代码行数:17,代码来源:CardTest.cs

示例5: TestDispute

        public void TestDispute()
        {
            Customer customer = createPersonCustomer();

            Card card = new Card();
            card.number = "6500000000000002";
            card.cvv = "123";
            card.expiration_month = 12;
            card.expiration_year = 3000;
            card.Save();

            card.AssociateToCustomer(customer);

            Dictionary<string, object> payload = new Dictionary<string, object>();
            payload.Add("amount", 100000);
            payload.Add("description", "Donuts");

            String debit_href = card.Debit(payload).href;
            Dispute dispute = null;

            for (int i = 0; i <= 100; i++)
            {
                Debit debit = Balanced.Debit.Fetch(debit_href);
                if (debit.dispute != null)
                {
                    dispute = debit.dispute;
                    break;
                }
                Console.WriteLine("polling disputes...");
                Thread.Sleep(10000);
            }

            Assert.IsNotNull(dispute);
            Assert.AreEqual(100000, dispute.amount);
            Assert.AreEqual("fraud", dispute.reason);
            Assert.AreEqual("pending", dispute.status);
        }
开发者ID:NSAKHAN,项目名称:balanced-csharp,代码行数:37,代码来源:DisputeTest.cs

示例6: TestCardCreate

        public void TestCardCreate()
        {
            Dictionary<string, string> meta = new Dictionary<string, string>();
            meta.Add("user_id", "0192837465");
            meta.Add("my-own-customer-id", "12345");

            Dictionary<string, string> address = new Dictionary<string, string>();
            address.Add("line1", "123 PL SE");
            address.Add("city", "San Francisco");
            address.Add("state", "CA");
            address.Add("postal_code", "98405");
            address.Add("country_code", "USA");

            Card card = new Card();

            card.name = "John Jameson";
            card.number = "5105105105105100";
            card.expiration_month = 12;
            card.expiration_year = 2020;
            card.cvv = "123";
            card.address = address;
            card.meta = meta;

            card.Save();

            Assert.IsTrue(card.is_verified);
            Assert.AreEqual("MasterCard", card.brand);
            Assert.IsNull(card.customer);
            Assert.IsNotNull(card.number);
            Assert.AreEqual(12, card.expiration_month);
            Assert.AreEqual(2020, card.expiration_year);
            Assert.AreEqual("xxx", card.cvv);
            Assert.AreEqual("John Jameson", card.name);
            Assert.AreEqual("98405", card.address["postal_code"]);
            Assert.AreEqual("123 PL SE", card.address["line1"]);
            Assert.AreEqual("12345", card.meta["my-own-customer-id"]);
        }
开发者ID:NSAKHAN,项目名称:balanced-csharp,代码行数:37,代码来源:CardTest.cs

示例7: TestCreateCreditCardRequireName

        public void TestCreateCreditCardRequireName()
        {
            // prefund escrow
            Card fundingCard = createCard();
            Dictionary<string, object> debitPayload = new Dictionary<string, object>();
            debitPayload.Add("amount", 250000);
            fundingCard.Debit(debitPayload);

            // attempt to credit funds to Card
            Card card = new Card();
            card.number = "4342561111111118";
            card.expiration_month = 05;
            card.expiration_year = 2016;
            card.Save();

            Dictionary<string, object> creditPayload = new Dictionary<string, object>();
            creditPayload.Add("amount", 250000);

            try
            {
                card.Credit(creditPayload);
            }
            catch (APIException e)
            {
                Assert.AreEqual(400, e.status_code);
                Assert.AreEqual("name-required-to-credit", e.category_code);
            }
        }
开发者ID:NSAKHAN,项目名称:balanced-csharp,代码行数:28,代码来源:CreditTest.cs


注:本文中的Card.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。