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


C# TransactionRequest类代码示例

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


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


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