本文整理汇总了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));
}
示例2: CreateTransactionExistingAccount
public void CreateTransactionExistingAccount()
{
var acct = CreateNewAccountWithBillingInfo();
var transaction = new Transaction(acct.AccountCode, 3000, "USD");
transaction.Create();
transaction.CreatedAt.Should().NotBe(default(DateTime));
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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));
}
示例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);
}