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


C# Transaction.Create方法代码示例

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


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

示例1: CreateTransactionNewAccount

        public void CreateTransactionNewAccount()
        {
            var account = NewAccountWithBillingInfo();
            var transaction = new Transaction(account, 5000, "USD");

            transaction.Create();

            transaction.CreatedAt.Should().NotBe(default(DateTime));
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:9,代码来源:TransactionTest.cs

示例2: CreateTransactionExistingAccount

        public void CreateTransactionExistingAccount()
        {
            var acct = CreateNewAccountWithBillingInfo();
            var transaction = new Transaction(acct.AccountCode, 3000, "USD");

            transaction.Create();

            transaction.CreatedAt.Should().NotBe(default(DateTime));
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:9,代码来源:TransactionTest.cs

示例3: RefundTransactionPartial

        public void RefundTransactionPartial()
        {
            var account = NewAccountWithBillingInfo();
            var transaction = new Transaction(account, 5000, "USD");
            transaction.Create();

            transaction.Refund(2500);

            account.GetTransactions().Should().HaveCount(2);
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:10,代码来源:TransactionTest.cs

示例4: RefundTransactionFull

        public void RefundTransactionFull()
        {
            var acct = NewAccountWithBillingInfo();
            var transaction = new Transaction(acct, 5000, "USD");
            transaction.Create();

            transaction.Refund();

            transaction.Status.Should().Be(Transaction.TransactionState.Voided);
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:10,代码来源:TransactionTest.cs

示例5: LookupTransaction

        public void LookupTransaction()
        {
            var acct = CreateNewAccountWithBillingInfo();
            var transaction = new Transaction(acct, 5000, "USD");
            transaction.Create();

            var fromService = Transactions.Get(transaction.Uuid);

            transaction.Should().Be(fromService);
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:10,代码来源:TransactionTest.cs

示例6: ListSuccessfulTransactions

        public void ListSuccessfulTransactions()
        {
            for (var x = 0; x < 2; x++)
            {
                var account = CreateNewAccountWithBillingInfo();
                var transaction = new Transaction(account.AccountCode, 3000 + x, "USD");
                transaction.Create();
            }

            var transactions = Transactions.List(TransactionList.TransactionState.Successful);
            transactions.Should().NotBeEmpty();
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:12,代码来源:TransactionListTest.cs

示例7: ListVoidedTransactions

        public void ListVoidedTransactions()
        {
            for (var x = 0; x < 2; x++)
            {
                var account = CreateNewAccountWithBillingInfo();
                var transaction = new Transaction(account.AccountCode, 3000 + x, "USD");
                transaction.Create();
                transaction.Refund();
            }

            var list = Transactions.List(TransactionList.TransactionState.Voided);
            list.Should().NotBeEmpty();
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:13,代码来源:TransactionListTest.cs

示例8: ListTransactionsForAccount

        public void ListTransactionsForAccount()
        {
            var account = CreateNewAccountWithBillingInfo();

            var transaction1 = new Transaction(account.AccountCode, 3000, "USD");
            transaction1.Create();

            var transaction2 = new Transaction(account.AccountCode, 200, "USD");
            transaction2.Create();

            var list = account.GetTransactions();
            list.Should().NotBeEmpty();
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:13,代码来源:TransactionListTest.cs

示例9: CreateTransactionExistingAccountNewBillingInfo

        public void CreateTransactionExistingAccountNewBillingInfo()
        {
            var account = new Account(GetUniqueAccountCode())
            {
                FirstName = "John",
                LastName = "Smith"
            };
            account.Create();
            account.BillingInfo = NewBillingInfo(account);
            var transaction = new Transaction(account, 5000, "USD");

            transaction.Create();

            transaction.CreatedAt.Should().NotBe(default(DateTime));
        }
开发者ID:RobertDyball,项目名称:recurly-client-net,代码行数:15,代码来源:TransactionTest.cs

示例10: CreateTransactionNewAccount

        public void CreateTransactionNewAccount()
        {
            var account = NewAccountWithBillingInfo();
            var transaction = new Transaction(account, 5000, "USD");
            transaction.Description = "Description";

            transaction.Create();

            transaction.CreatedAt.Should().NotBe(default(DateTime));
            
            var fromService = Transactions.Get(transaction.Uuid);
            var invoice = fromService.GetInvoice();
            var line_items = invoice.Adjustments;
            
            line_items[0].Description.Should().Be(transaction.Description);
            
        }
开发者ID:kylelengling,项目名称:recurly-client-net,代码行数:17,代码来源:TransactionTest.cs


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