• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TransactionRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TransactionRequest的典型用法代码示例。如果您正苦于以下问题:C# TransactionRequest类的具体用法?C# TransactionRequest怎么用?C# TransactionRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TransactionRequest类属于命名空间,在下文中一共展示了TransactionRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ToXml_Includes_DeviceSessionId

        public void ToXml_Includes_DeviceSessionId()
        {
            TransactionRequest request = new TransactionRequest();
            request.DeviceSessionId = "my_dsid";

            Assert.IsTrue(request.ToXml().Contains("my_dsid"));
        }
开发者ID:braintree,项目名称:braintree_dotnet,代码行数:7,代码来源:TransactionRequestTest.cs


示例2: ToXml_InludesPaymentMethodNonce

        public void ToXml_InludesPaymentMethodNonce()
        {
            TransactionRequest request = new TransactionRequest();
            request.PaymentMethodNonce = "1232131232";

            Assert.IsTrue(request.ToXml().Contains("1232131232"));
        }
开发者ID:braintree,项目名称:braintree_dotnet,代码行数:7,代码来源:TransactionRequestTest.cs


示例3: ToXml_Includes_FraudMerchantId

        public void ToXml_Includes_FraudMerchantId()
        {
            TransactionRequest request = new TransactionRequest();
            request.FraudMerchantId = "my_fmid";

            Assert.IsTrue(request.ToXml().Contains("my_fmid"));
        }
开发者ID:braintree,项目名称:braintree_dotnet,代码行数:7,代码来源:TransactionRequestTest.cs


示例4: GetDeviceTransaction

 public deviceTransaction GetDeviceTransaction(TransactionRequest transactionRequest)
 {
     string response = "";
     Dictionary<string, string> responseMap = doRequest(GetURL(), "POST", Serializer<TransactionRequest>.Serialize(transactionRequest).InnerXml);
     responseMap.TryGetValue(MESSAGE, out response);
     return Serializer<deviceTransaction>.Deserialize(response);
 }
开发者ID:rehabayar,项目名称:mastercard-api-csharp,代码行数:7,代码来源:RetrieveTransactionsService.cs


示例5: Generate_ReturnsTransactionsSettledOnAGivenDay

        public void Generate_ReturnsTransactionsSettledOnAGivenDay()
        {
            TransactionRequest request = new TransactionRequest
            {
                Amount = 1000M,
                CreditCard = new TransactionCreditCardRequest
                {
                    Number = "4111111111111111",
                    ExpirationDate = "05/2012",
                    CardholderName = "Tom Smith",
                },
                Options = new TransactionOptionsRequest
                {
                    SubmitForSettlement = true
                },
            };

            Transaction transaction = gateway.Transaction.Sale(request).Target;
            Transaction settlementResult = gateway.TestTransaction.Settle(transaction.Id);
            var settlementDate = settlementResult.SettlementBatchId.Substring(0,10);
            transaction = gateway.Transaction.Find(transaction.Id);
            var result = gateway.SettlementBatchSummary.Generate(System.DateTime.Parse(settlementDate));
            var visas = new List<IDictionary<string,string>>();
            foreach (var row in result.Target.Records)
            {
                if (CreditCardCardType.VISA.ToString().Equals(row["card_type"]))
                {
                    visas.Add(row);
                }
            }

            Assert.AreEqual(1, visas.Count);
        }
开发者ID:braintree,项目名称:braintree_dotnet,代码行数:33,代码来源:SettlementBatchSummaryIntegrationTest.cs


示例6: Main

        private static void Main()
        {
            // Valid transaction
            Console.WriteLine("Begin Transaction...");
            Thread.Sleep(1000);
            var validTransactionRequest = new TransactionRequest
            {
                CardNumber = "123-456-78",
                CardPin = "1234",
                RequestedAmount = 200
            };

            ProcessTransaction(validTransactionRequest);
            Console.WriteLine("End Transaction...\n");
            Thread.Sleep(1000);

            // Invalid card number
            Console.WriteLine("Begin Transaction...");
            Thread.Sleep(1000);
            var invalidCardNumberTransaction = new TransactionRequest
            {
                CardNumber = "111-11-11-111",
                CardPin = "1234",
                RequestedAmount = 200
            };

            ProcessTransaction(invalidCardNumberTransaction);
            Console.WriteLine("End Transaction...\n");
            Thread.Sleep(1000);

            // Invalid card pin
            Console.WriteLine("Begin Transaction...");
            Thread.Sleep(1000);
            var invalidCardPinTransaction = new TransactionRequest
            {
                CardNumber = "111-11-111",
                CardPin = "12345",
                RequestedAmount = 200
            };

            ProcessTransaction(invalidCardPinTransaction);
            Console.WriteLine("End Transaction...\n");
            Thread.Sleep(1000);

            // Invalid money request
            Console.WriteLine("Begin Transaction...");
            Thread.Sleep(1000);
            var invalidMoneyRequestTransaction = new TransactionRequest
            {
                CardNumber = "111-11-111",
                CardPin = "1234",
                RequestedAmount = -200
            };

            ProcessTransaction(invalidMoneyRequestTransaction);
            Console.WriteLine("End Transaction...\n");
            Thread.Sleep(1000);
        }
开发者ID:b-slavov,项目名称:Telerik-Software-Academy,代码行数:58,代码来源:ConsoleClient.cs


示例7: ToXML_EscapesGeneratedXMLForString

        public void ToXML_EscapesGeneratedXMLForString()
        {
            TransactionRequest request = new TransactionRequest
            {
                OrderId = "<>&\"'"
            };

            TestHelper.AssertIncludes("<order-id>&lt;&gt;&amp;&quot;&#39;</order-id>", request.ToXml());
        }
开发者ID:braintree,项目名称:braintree_dotnet,代码行数:9,代码来源:RequestTest.cs


示例8: HashIsComputedCorrectly0

        public void HashIsComputedCorrectly0()
        {
            var request = new TransactionRequest();
            request.Add("KEY1", "VALUE1");
            var client = GetClient();
            client.SetHash(request);

            Assert.AreEqual("05b2372310c2897729f9c185517a25168e6891f2c7749329255f494e1483f181", request["HASH"]);
        }
开发者ID:gitter-badger,项目名称:Be2BillNet,代码行数:9,代码来源:Be2BillClientTests.cs


示例9: HashIsComputedCorrectly1

        public void HashIsComputedCorrectly1()
        {
            var request = new TransactionRequest();
            request.Add("ORDERID", "VALUE1");
            request.Add("DATE", "VALUE2");
            var client = GetClient();
            client.SetHash(request);

            Assert.AreEqual("b7c312f5d79aebc472d91b7395ba855b00bcfee5e15b13a01af85a9f64737a89", request["HASH"]);
        }
开发者ID:gitter-badger,项目名称:Be2BillNet,代码行数:10,代码来源:Be2BillClientTests.cs


示例10: HashIsComputedCorrectly0_Verify

        public void HashIsComputedCorrectly0_Verify()
        {
            var hash = "05b2372310c2897729f9c185517a25168e6891f2c7749329255f494e1483f181";
            var request = new TransactionRequest();
            request.Add("KEY1", "VALUE1");
            var client = GetClient();
            var result = client.VerifyParameters(request, GetClientConfiguration().ApiKey, hash);

            Assert.IsTrue(result);
        }
开发者ID:gitter-badger,项目名称:Be2BillNet,代码行数:10,代码来源:Be2BillClientTests.cs


示例11: TestService

 public void TestService()
 {
     request = new TransactionRequest();
     request.TokenUniqueId = "DWSPMC00000000010906a349d9ca4eb1a4d53e3c90a11d9c";
     request.AuditInfo.UserId = "testUser";
     request.AuditInfo.UserName = "Test User";
     request.AuditInfo.Organization = "Test Org";
     response = service.GetDeviceTransaction(request);
     Assert.IsNotNull(response.Transactions);
 }
开发者ID:rehabayar,项目名称:mastercard-api-csharp,代码行数:10,代码来源:RetrieveTransactionsServiceTest.cs


示例12: ToXml_Includes_DeviceData

        public void ToXml_Includes_DeviceData()
        {
            TransactionRequest request = new TransactionRequest();
            request.DeviceData = "{\"device_session_id\":\"my_dsid\", \"fraud_merchant_id\":\"my_fmid\"}";

            Assert.IsTrue(request.ToXml().Contains("device-data"));
            Assert.IsTrue(request.ToXml().Contains("device_session_id"));
            Assert.IsTrue(request.ToXml().Contains("my_dsid"));
            Assert.IsTrue(request.ToXml().Contains("fraud_merchant_id"));
            Assert.IsTrue(request.ToXml().Contains("my_fmid"));
        }
开发者ID:braintree,项目名称:braintree_dotnet,代码行数:11,代码来源:TransactionRequestTest.cs


示例13: OnPaymentFinished

            public void OnPaymentFinished(string orderId, TransactionRequest originalRequest, IDictionary<String, String> result, ApiPaymentCompletedStatus status)
            {
                //handle payment finished
                string textResult = "Order ID: " + orderId + "\n" + "Status: " + status + "\n";

                foreach(KeyValuePair<string, string> entry in result)
                {
                    textResult = textResult + entry.Key + ": " + entry.Value + "\n";
                }

                this.paymentDataView.Text = textResult;
            }
开发者ID:xojan,项目名称:PointPayApi-Xamarin,代码行数:12,代码来源:ResultActivity.cs


示例14: ToXML_EscapesGeneratedXMLForNestedSearchCriteria

        public void ToXML_EscapesGeneratedXMLForNestedSearchCriteria()
        {
            TransactionRequest request = new TransactionRequest
            {
                Customer = new CustomerRequest
                {
                    FirstName = "<John>"
                }
            };

            TestHelper.AssertIncludes("<first-name>&lt;John&gt;</first-name>", request.ToXml());
        }
开发者ID:braintree,项目名称:braintree_dotnet,代码行数:12,代码来源:RequestTest.cs


示例15: ProcessTransaction

 private static void ProcessTransaction(TransactionRequest transactionRequest)
 {
     try
     {
         AtmDbData.WithdrawMoney(transactionRequest);
         Console.WriteLine("\tRequested transaction was successful!");
     }
     catch (Exception)
     {
         Console.WriteLine("\tRequested transaction was not successful!");
     }
 }
开发者ID:b-slavov,项目名称:Telerik-Software-Academy,代码行数:12,代码来源:ConsoleClient.cs


示例16: TransactionRequest

        bool ITransactionProcessor.AddRequest(int tickerIndex, double quantity)
        {
            if (!quoteContext.GetTickerDescription(tickerIndex).CanBeBought) return false;

            var req = new TransactionRequest(tickerIndex, quantity < 0 ? 0 : quantity, delay.Value);
            if (delay.Value == 0)
                return ProcessTransactionRequest(req);
            else
                transactionRequests.Add(req);

            return true;
        }
开发者ID:nabuk,项目名称:IstLight,代码行数:12,代码来源:TransactionProcessor.cs


示例17: Sign_Transaction

 public void Sign_Transaction()
 {
     //Just checking for no errors here- not yet sure how we verify this,
     //unless we call into another way of signing and verify the two match
     TransactionRequest t = new TransactionRequest()
     {
         AmountInCents = 124,
         CurrencyCode = Currency.GBP,
         Description = "test description"
     };
     RecurlyJs signer = new RecurlyJs("testkey","testapi");
     var signedString = signer.SignString(t.ToSignableString());
 }
开发者ID:tomgallard,项目名称:recurly-client-net,代码行数:13,代码来源:RecurlyJsTest.cs


示例18: WithdrawMoney

        public void WithdrawMoney(TransactionRequest transactionRequest)
        {
            using (var transaction = new AtmDbContext().Database.BeginTransaction())
            {
                try
                {
                    if (!this.validator.IsValidCardNumber(transactionRequest.CardNumber))
                    {
                        throw new ArgumentException("Invalid card number. Current transaction is aborted!");
                    }

                    if (!this.validator.IsValidCardPin(transactionRequest.CardPin))
                    {
                        throw new ArgumentException("Invalid Card PIN Code. Current transaction is aborted!");
                    }

                    var cardAccount = this.atmDbContext.CardAccounts
                        .FirstOrDefault(ca => ca.CardNumber == transactionRequest.CardNumber &&
                                              ca.CardPin == transactionRequest.CardPin);
                    if (cardAccount == null)
                    {
                        throw new ArgumentException(
                            "There is no Card account with the given Card number. Current transaction is aborted!");
                    }

                    if (!this.validator.IsPinCodeMatches(transactionRequest.CardPin, cardAccount.CardPin))
                    {
                        throw new ArgumentException(
                            "Chosen Card PIN Code does not matches the actual PIN Code of the card account. Current transaction is aborted!");
                    }

                    if (
                        !this.validator.IsPermittedWithdrawalAmount(transactionRequest.RequestedAmount,
                            cardAccount.CardCash))
                    {
                        throw new ArgumentException(
                            "Invalid withdrawal money amount to retrieve. Current transaction is aborted!");
                    }

                    cardAccount.CardCash -= transactionRequest.RequestedAmount;

                    transaction.Commit();
                    this.atmDbContext.SaveChanges();
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    Console.WriteLine("\t" + ex.Message);
                }
            }
        }
开发者ID:b-slavov,项目名称:Telerik-Software-Academy,代码行数:51,代码来源:AtmDbData.cs


示例19: CreateAuthorizationParameters

        /// <summary>
        /// Creates the authorization/payment parameters. You have to call SetPayWithForm or SetPayWithAlias after.
        /// </summary>
        /// <param name="uniqueOrderId">The unique order unique identifier (you have to create it).</param>
        /// <param name="userId">The user unique identifier.</param>
        /// <param name="userEmail">The user email.</param>
        /// <param name="description">The description of the payment.</param>
        /// <param name="amountInEuro">The amount information euro (not in cents).</param>
        /// <param name="createAlias">if set to <c>true</c> [create alias] (to do oneclick later).</param>
        /// <param name="displayCreateAlias">if set to <c>true</c> the payment form will ask whether to save the card information.</param>
        /// <param name="authorizationInsteadOfPayment">if set to <c>true</c> [authorization instead of payment]. Call Capture to complete the transaction.</param>
        /// <param name="language">The language.</param>
        /// <returns></returns>
        public TransactionRequest CreateAuthorizationParameters(
            string uniqueOrderId,
            string userId,
            string userEmail,
            string description,
            decimal amountInEuro,
            bool createAlias = false,
            bool displayCreateAlias = false,
            bool authorizationInsteadOfPayment = false,
            Be2BillLanguage language = Be2BillLanguage.EN)
        {
            // http://developer.be2bill.com/platform

            var collection = new TransactionRequest();

            if (authorizationInsteadOfPayment)
            {
                collection.Add(Names.Params.OperationType, Names.Params.OperationTypeAuthorization);
            }
            else
            {
                collection.Add(Names.Params.OperationType, Names.Params.OperationTypePayment);
            }

            collection.Add(Names.Params.Description, description);
            collection.Add(Names.Params.OrderId, uniqueOrderId); // be2bill seems to accept only 1 tentative per ORDERID
            collection.Add(Names.Params.Amount, Math.Round(amountInEuro * 100).ToString());
            collection.Add(Names.Params.Version, Names.ApiVersion);
            collection.Add(Names.Params.ClientIdent, userId);
            collection.Add(Names.Params.Language, language.ToString());

            if (createAlias)
            {
                collection.Add(Names.Params.CreateAlias, Names.Params.Yes); // allow one-click for later transactions (force)
            }

            if (displayCreateAlias)
            {
                collection.Add(Names.Params.DisplayCreateAlias, Names.Params.Yes); // allow one-click for later transactions (ask user)
            }

            collection.Add(Names.Params.Identifier, configuration.ApiIdentifier);

            if (userEmail != null)
            {
                collection.Add(Names.Params.ClientEmail, userEmail);
            }

            return collection;
        }
开发者ID:gitter-badger,项目名称:Be2BillNet,代码行数:63,代码来源:Be2BillClient.cs


示例20: Get

 public IList<Transaction> Get(TransactionRequest request)
 {
     var transactions = new List<Transaction>();
     for (int i = 1; i < 30; i++)
     {
         transactions.Add(new Transaction()
         {
             Date = DateTime.Now.AddDays(i),
             Details = "Transaction " + i,
             CreditAmount = 10 + i,
             DebitAmount = 10 - i
         });
     }
     return transactions;
 }
开发者ID:rbanks54,项目名称:Transpaction,代码行数:15,代码来源:TransactionService.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TransactionResponse类代码示例发布时间:2022-05-24
下一篇:
C# TransactionMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap