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

C# Sdk.cardType类代码示例

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

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



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

示例1: authInfo

 public void authInfo()
 {
     captureGivenAuth capturegivenauth = new captureGivenAuth();
     capturegivenauth.amount = 106;
     capturegivenauth.orderId = "12344";
     authInformation authInfo = new authInformation();
     DateTime authDate = new DateTime(2002, 10, 9);
     authInfo.authDate = authDate;
     authInfo.authCode = "543216";
     authInfo.authAmount = 12345;
     fraudResult fraudresult = new fraudResult();
     fraudresult.avsResult = "12";
     fraudresult.cardValidationResult = "123";
     fraudresult.authenticationResult = "1";
     fraudresult.advancedAVSResult = "123";
     authInfo.fraudResult = fraudresult;
     capturegivenauth.authInformation = authInfo;
     capturegivenauth.orderSource = orderSourceType.ecommerce;
     cardType card = new cardType();
     card.type = methodOfPaymentTypeEnum.VI;
     card.number = "4100000000000000";
     card.expDate = "1210";
     capturegivenauth.card=card;
     captureGivenAuthResponse response = litle.CaptureGivenAuth(capturegivenauth);
     Assert.AreEqual("Approved", response.message);
 }
开发者ID:rynohawk,项目名称:litle-sdk-for-dotNet,代码行数:26,代码来源:TestCaptureGivenAuth.cs


示例2: testAccountUpdate

        public void testAccountUpdate()
        {
            accountUpdate accountUpdate = new accountUpdate();
            accountUpdate.reportGroup = "Planets";
            accountUpdate.orderId = "12344";
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "4100000000000002";
            card.expDate = "1210";
            accountUpdate.card = card;

            var mockLitleResponse = new Mock<litleResponse>();
            var mockLitleXmlSerializer = new Mock<litleXmlSerializer>();

            mockXmlReader.SetupSequence(XmlReader => XmlReader.ReadOuterXml())
                .Returns("<accountUpdateResponse reportGroup=\"Merch01ReportGrp\" xmlns=\"http://www.litle.com/schema\"><litleTxnId>123</litleTxnId><orderId>MERCH01-0002</orderId><response>000</response><responseTime>2010-04-11T15:44:26</responseTime><message>Approved</message></accountUpdateResponse>")
                .Returns("<accountUpdateResponse reportGroup=\"Merch01ReportGrp\" xmlns=\"http://www.litle.com/schema\"><litleTxnId>124</litleTxnId><orderId>MERCH01-0002</orderId><response>000</response><responseTime>2010-04-11T15:44:26</responseTime><message>Approved</message></accountUpdateResponse>");

            batchResponse mockLitleBatchResponse = new batchResponse();
            mockLitleBatchResponse.setAccountUpdateResponseReader(mockXmlReader.Object);

            mockLitleResponse.Setup(litleResponse => litleResponse.nextBatchResponse()).Returns(mockLitleBatchResponse);
            litleResponse mockedLitleResponse = mockLitleResponse.Object;

            mockLitleXmlSerializer.Setup(litleXmlSerializer => litleXmlSerializer.DeserializeObjectFromFile(It.IsAny<String>())).Returns(mockedLitleResponse);

            Communications mockedCommunication = mockCommunications.Object;
            litle.setCommunication(mockedCommunication);

            litleXmlSerializer mockedLitleXmlSerializer = mockLitleXmlSerializer.Object;
            litle.setLitleXmlSerializer(mockedLitleXmlSerializer);

            litleFile mockedLitleFile = mockLitleFile.Object;
            litle.setLitleFile(mockedLitleFile);

            litle.setLitleTime(mockLitleTime.Object);

            batchRequest litleBatchRequest = new batchRequest();
            litleBatchRequest.setLitleFile(mockedLitleFile);
            litleBatchRequest.setLitleTime(mockLitleTime.Object);
            litleBatchRequest.addAccountUpdate(accountUpdate);
            litleBatchRequest.addAccountUpdate(accountUpdate);
            litle.addBatch(litleBatchRequest);

            string batchFileName = litle.sendToLitle();
            litleResponse actualLitleResponse = litle.receiveFromLitle(batchFileName);
            batchResponse actualLitleBatchResponse = actualLitleResponse.nextBatchResponse();
            accountUpdateResponse actualAccountUpdateResponse1 = actualLitleBatchResponse.nextAccountUpdateResponse();
            accountUpdateResponse actualAccountUpdateResponse2 = actualLitleBatchResponse.nextAccountUpdateResponse();
            accountUpdateResponse nullAccountUpdateResponse = actualLitleBatchResponse.nextAccountUpdateResponse();

            Assert.AreEqual(123, actualAccountUpdateResponse1.litleTxnId);
            Assert.AreEqual("000", actualAccountUpdateResponse1.response);
            Assert.AreEqual(124, actualAccountUpdateResponse2.litleTxnId);
            Assert.AreEqual("000", actualAccountUpdateResponse2.response);
            Assert.IsNull(nullAccountUpdateResponse);

            mockCommunications.Verify(Communications => Communications.FtpDropOff(It.IsAny<String>(), mockFileName, It.IsAny<Dictionary<String, String>>()));
            mockCommunications.Verify(Communications => Communications.FtpPickUp(It.IsAny<String>(), It.IsAny<Dictionary<String, String>>(), mockFileName));
        }
开发者ID:hriyer,项目名称:litle-sdk-for-dotNet,代码行数:60,代码来源:TestBatch.cs


示例3: posWithoutCapabilityAndEntryMode

        public void posWithoutCapabilityAndEntryMode()
        {
            authorization authorization = new authorization();
            authorization.reportGroup = "Planets";
            authorization.orderId = "12344";
            authorization.amount = 106;
            authorization.orderSource = orderSourceType.ecommerce;
            pos pos = new pos();
            pos.cardholderId = posCardholderIdTypeEnum.pin;
            authorization.pos = pos;
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "4100000000000002";
            card.expDate = "1210";
            authorization.card = card; //This needs to compile

            customBilling cb = new customBilling();
            cb.phone = "1112223333"; //This needs to compile too

            try
            {
                litle.Authorize(authorization);
                //expected exception;
            }
            catch (LitleOnlineException e)
            {
                Assert.True(e.Message.StartsWith("Error validating xml data against the schema"));
            }
        }
开发者ID:wessiyad,项目名称:litle-sdk-for-dotNet,代码行数:29,代码来源:TestAuth.cs


示例4: complexCaptureGivenAuth

 public void complexCaptureGivenAuth()
 {
     captureGivenAuth capturegivenauth = new captureGivenAuth();
     capturegivenauth.amount = 106;
     capturegivenauth.orderId = "12344";
     authInformation authInfo = new authInformation();
     DateTime authDate = new DateTime(2002, 10, 9);
     authInfo.authDate = authDate;
     authInfo.authCode = "543216";
     authInfo.authAmount = 12345;
     capturegivenauth.authInformation = authInfo;
     contact contact = new contact();
     contact.name = "Bob";
     contact.city = "lowell";
     contact.state = "MA";
     contact.email ="litle.com";
     capturegivenauth.billToAddress = contact;
     processingInstructions processinginstructions = new processingInstructions();
     processinginstructions.bypassVelocityCheck = true;
     capturegivenauth.processingInstructions = processinginstructions;
     capturegivenauth.orderSource = orderSourceType.ecommerce;
     cardType card = new cardType();
     card.type = methodOfPaymentTypeEnum.VI;
     card.number = "4100000000000000";
     card.expDate = "1210";
     capturegivenauth.card = card;
     captureGivenAuthResponse response = litle.CaptureGivenAuth(capturegivenauth);
     Assert.AreEqual("Approved", response.message);
 }
开发者ID:rynohawk,项目名称:litle-sdk-for-dotNet,代码行数:29,代码来源:TestCaptureGivenAuth.cs


示例5: TestSimple

        public void TestSimple()
        {
            updateSubscription update = new updateSubscription();
            update.billingDate = new DateTime(2002, 10, 9);
            contact billToAddress = new contact();
            billToAddress.name = "Greg Dake";
            billToAddress.city = "Lowell";
            billToAddress.state = "MA";
            billToAddress.email = "[email protected]";
            update.billToAddress = billToAddress;
            cardType card = new cardType();
            card.number = "4100000000000001";
            card.expDate = "1215";
            card.type = methodOfPaymentTypeEnum.VI;
            update.card = card;
            update.planCode = "abcdefg";
            update.subscriptionId = 12345;

            var mock = new Mock<Communications>();

            mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<litleOnlineRequest.*?<updateSubscription>\r\n<subscriptionId>12345</subscriptionId>\r\n<planCode>abcdefg</planCode>\r\n<billToAddress>\r\n<name>Greg Dake</name>.*?</billToAddress>\r\n<card>\r\n<type>VI</type>.*?</card>\r\n<billingDate>2002-10-09</billingDate>\r\n</updateSubscription>\r\n</litleOnlineRequest>.*?.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>()))
                .Returns("<litleOnlineResponse version='8.20' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><updateSubscriptionResponse ><litleTxnId>456</litleTxnId><response>000</response><message>Approved</message><responseTime>2013-09-04</responseTime><subscriptionId>12345</subscriptionId></updateSubscriptionResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;
            litle.setCommunication(mockedCommunication);
            updateSubscriptionResponse response = litle.UpdateSubscription(update);
            Assert.AreEqual("12345", response.subscriptionId);
            Assert.AreEqual("456", response.litleTxnId);
            Assert.AreEqual("000", response.response);
            Assert.NotNull(response.responseTime);
        }
开发者ID:GrimDerp,项目名称:litle-sdk-for-dotNet,代码行数:31,代码来源:TestUpdateSubscription.cs


示例6: simpleForceCaptureWithCard

 public void simpleForceCaptureWithCard()
 {
     forceCapture forcecapture = new forceCapture();
     forcecapture.amount = 106;
     forcecapture.orderId = "12344";
     forcecapture.orderSource = orderSourceType.ecommerce;
     cardType card = new cardType();
     card.type = methodOfPaymentTypeEnum.VI;
     card.number = "4100000000000001";
     card.expDate = "1210";
     forcecapture.card = card;
     forceCaptureResponse response = litle.ForceCapture(forcecapture);
     Assert.AreEqual("Approved", response.message);
 }
开发者ID:rynohawk,项目名称:litle-sdk-for-dotNet,代码行数:14,代码来源:TestForceCapture.cs


示例7: SimpleSaleWithCard

        public void SimpleSaleWithCard()
        {
            sale saleObj = new sale();
            saleObj.amount = 106;
            saleObj.litleTxnId = 123456;
            saleObj.orderId = "12344";
            saleObj.orderSource = orderSourceType.ecommerce;
            cardType cardObj = new cardType();
            cardObj.type = methodOfPaymentTypeEnum.VI;
            cardObj.number = "4100000000000000";
            cardObj.expDate = "1210";
            saleObj.card = cardObj;

            saleResponse responseObj = litle.Sale(saleObj);
            StringAssert.AreEqualIgnoringCase("Approved", responseObj.message);
        }
开发者ID:rynohawk,项目名称:litle-sdk-for-dotNet,代码行数:16,代码来源:TestSale.cs


示例8: SimpleCreditWithCard

        public void SimpleCreditWithCard()
        {
            credit creditObj = new credit();
            creditObj.amount = 106;
            creditObj.orderId = "2111";
            creditObj.orderSource = orderSourceType.ecommerce;
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "4100000000000001";
            card.expDate = "1210";

            creditObj.card = card;

            creditResponse response = litle.Credit(creditObj);
            Assert.AreEqual("Approved", response.message);
        }
开发者ID:wessiyad,项目名称:litle-sdk-for-dotNet,代码行数:16,代码来源:TestCredit.cs


示例9: testAddAccountUpdate

        public void testAddAccountUpdate()
        {
            accountUpdate accountUpdate = new accountUpdate();
            accountUpdate.reportGroup = "Planets";
            accountUpdate.orderId = "12344";
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "4100000000000002";
            card.expDate = "1210";
            accountUpdate.card = card;

            batchRequest.addAccountUpdate(accountUpdate);

            Assert.AreEqual(1, batchRequest.getNumAccountUpdates());

            mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<String>(), mockLitleTime.Object));
            mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, accountUpdate.Serialize()));
        }
开发者ID:BBTS,项目名称:litle-sdk-for-dotNet,代码行数:18,代码来源:TestBatchRequest.cs


示例10: test11

        public void test11()
        {
            authorization authorization = new authorization();
            authorization.orderId = "11";
            authorization.amount = 60000;
            authorization.orderSource = orderSourceType.ecommerce;
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.MC;
            card.number = "5112010140000004";
            card.expDate = "1111";
            authorization.card = card;
            authorization.allowPartialAuth = true;

            authorizationResponse response = litle.Authorize(authorization);
            Assert.AreEqual("010", response.response);
            Assert.AreEqual("Partially Approved", response.message);
            Assert.AreEqual("48000", response.approvedAmount);
        }
开发者ID:rynohawk,项目名称:litle-sdk-for-dotNet,代码行数:18,代码来源:TestCert1Base.cs


示例11: accountUpdateBatch

        public void accountUpdateBatch()
        {
            batchRequest litleBatchRequest = new batchRequest();

            accountUpdate accountUpdate1 = new accountUpdate();
            accountUpdate1.orderId = "1111";
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "414100000000000000";
            card.expDate = "1210";
            accountUpdate1.card = card;

            litleBatchRequest.addAccountUpdate(accountUpdate1);

            accountUpdate accountUpdate2 = new accountUpdate();
            accountUpdate2.orderId = "1112";
            accountUpdate2.card = card;

            litleBatchRequest.addAccountUpdate(accountUpdate2);

            litle.addBatch(litleBatchRequest);
            string batchName = litle.sendToLitle();

            litle.blockAndWaitForResponse(batchName, estimatedResponseTime(0, 1 * 2));

            litleResponse litleResponse = litle.receiveFromLitle(batchName);

            Assert.NotNull(litleResponse);
            Assert.AreEqual("0", litleResponse.response);
            Assert.AreEqual("Valid Format", litleResponse.message);

            batchResponse litleBatchResponse = litleResponse.nextBatchResponse();
            while (litleBatchResponse != null)
            {
                accountUpdateResponse accountUpdateResponse = litleBatchResponse.nextAccountUpdateResponse();
                while (accountUpdateResponse != null)
                {
                    Assert.AreEqual("301", accountUpdateResponse.response);

                    accountUpdateResponse = litleBatchResponse.nextAccountUpdateResponse();
                }
                litleBatchResponse = litleResponse.nextBatchResponse();
            }
        }
开发者ID:BBTS,项目名称:litle-sdk-for-dotNet,代码行数:44,代码来源:TestBatch.cs


示例12: SimpleAuthWithCard

        public void SimpleAuthWithCard()
        {
            authorization authorization = new authorization();
            authorization.reportGroup = "Planets";
            authorization.orderId = "12344";
            authorization.amount = 106;
            authorization.orderSource = orderSourceType.ecommerce;
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "414100000000000000";
            card.expDate = "1210";
            authorization.card = card; //This needs to compile

            customBilling cb = new customBilling();
            cb.phone = "1112223333"; //This needs to compile too

            authorizationResponse response = litle.Authorize(authorization);
            Assert.AreEqual("000", response.response);
        }
开发者ID:wessiyad,项目名称:litle-sdk-for-dotNet,代码行数:19,代码来源:TestAuth.cs


示例13: test15

        public void test15()
        {
            authorization authorization = new authorization();
            authorization.orderId = "15";
            authorization.amount = 3000;
            authorization.orderSource = orderSourceType.ecommerce;
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.MC;
            card.number = "5500000254444445";
            card.expDate = "0312";
            authorization.card = card;

            authorizationResponse response = litle.Authorize(authorization);
            Assert.AreEqual("000", response.response);
            Assert.AreEqual("Approved", response.message);
            Assert.AreEqual(fundingSourceTypeEnum.PREPAID, response.enhancedAuthResponse.fundingSource.type);
            Assert.AreEqual("2000", response.enhancedAuthResponse.fundingSource.availableBalance);
            Assert.AreEqual("YES", response.enhancedAuthResponse.fundingSource.reloadable);
            Assert.AreEqual("PAYROLL", response.enhancedAuthResponse.fundingSource.prepaidCardType);
        }
开发者ID:GrimDerp,项目名称:litle-sdk-for-dotNet,代码行数:20,代码来源:TestCert2AuthEnhanced.cs


示例14: test32

        public void test32()
        {
            authorization auth = new authorization();
            auth.orderId = "32";
            auth.amount = 10010;
            auth.orderSource = orderSourceType.ecommerce;
            contact billToAddress = new contact();
            billToAddress.name = "John Smith";
            billToAddress.addressLine1 = "1 Main St.";
            billToAddress.city = "Burlington";
            billToAddress.state = "MA";
            billToAddress.zip = "01803-3747";
            billToAddress.country = countryTypeEnum.US;
            auth.billToAddress = billToAddress;
            cardType card = new cardType();
            card.number = "4457010000000009";
            card.expDate = "0112";
            card.cardValidationNum = "349";
            card.type = methodOfPaymentTypeEnum.VI;
            auth.card = card;

            authorizationResponse authorizeResponse = litle.Authorize(auth);
            Assert.AreEqual("000", authorizeResponse.response);
            Assert.AreEqual("Approved", authorizeResponse.message);
            Assert.AreEqual("11111 ", authorizeResponse.authCode);
            Assert.AreEqual("01", authorizeResponse.fraudResult.avsResult);
            Assert.AreEqual("M", authorizeResponse.fraudResult.cardValidationResult);

            capture capture = new capture();
            capture.litleTxnId = authorizeResponse.litleTxnId;
            capture.amount = 5005;
            captureResponse captureResponse = litle.Capture(capture);
            Assert.AreEqual("000", captureResponse.response);
            Assert.AreEqual("Approved", captureResponse.message);

            authReversal reversal = new authReversal();
            reversal.litleTxnId = authorizeResponse.litleTxnId;
            authReversalResponse reversalResponse = litle.AuthReversal(reversal);
            Assert.AreEqual("111", reversalResponse.response);
            Assert.AreEqual("Authorization amount has already been depleted", reversalResponse.message);
        }
开发者ID:wessiyad,项目名称:litle-sdk-for-dotNet,代码行数:41,代码来源:TestCert3AuthReversal.cs


示例15: testAddAuthorization

        public void testAddAuthorization()
        {
            authorization authorization = new authorization();
            authorization.reportGroup = "Planets";
            authorization.orderId = "12344";
            authorization.amount = 106;
            authorization.orderSource = orderSourceType.ecommerce;
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "4100000000000002";
            card.expDate = "1210";
            authorization.card = card;

            batchRequest.addAuthorization(authorization);

            Assert.AreEqual(1, batchRequest.getNumAuthorization());
            Assert.AreEqual(authorization.amount, batchRequest.getSumOfAuthorization());

            mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<String>(), mockLitleTime.Object));
            mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, authorization.Serialize()));
        }
开发者ID:BBTS,项目名称:litle-sdk-for-dotNet,代码行数:21,代码来源:TestBatchRequest.cs


示例16: ProcessingInstructionAndAmexData

        public void ProcessingInstructionAndAmexData()
        {
            credit creditObj = new credit();
            creditObj.amount = 2000;
            creditObj.orderId = "12344";
            creditObj.orderSource = orderSourceType.ecommerce;

            processingInstructions processingInstructionsObj = new processingInstructions();
            processingInstructionsObj.bypassVelocityCheck = true;

            creditObj.processingInstructions = processingInstructionsObj;

            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "4100000000000001";
            card.expDate = "1210";

            creditObj.card = card;

            creditResponse response = litle.Credit(creditObj);
            Assert.AreEqual("Approved", response.message);
        }
开发者ID:hriyer,项目名称:litle-sdk-for-dotNet,代码行数:22,代码来源:TestCredit.cs


示例17: AuthWithAmpersand

 public void AuthWithAmpersand()
 {
     authorization authorization = new authorization();
     authorization.orderId = "1";
     authorization.amount = 10010;
     authorization.orderSource = orderSourceType.ecommerce;
     contact contact = new contact();
     contact.name = "John & Jane Smith";
     contact.addressLine1 = "1 Main St.";
     contact.city = "Burlington";
     contact.state = "MA";
     contact.zip = "01803-3747";
     contact.country = countryTypeEnum.US;
     authorization.billToAddress = contact;
     cardType card = new cardType();
     card.type = methodOfPaymentTypeEnum.VI;
     card.number = "4457010000000009";
     card.expDate = "0112";
      card.cardValidationNum = "349";
      authorization.card = card;
      authorizationResponse response = litle.Authorize(authorization);
     Assert.AreEqual("000", response.response);
 }
开发者ID:GrimDerp,项目名称:litle-sdk-for-dotNet,代码行数:23,代码来源:TestAuth.cs


示例18: TestAuth

        public void TestAuth()
        {
            authorization authorization = new authorization();
            authorization.reportGroup = "Planets";
            authorization.orderId = "12344";
            authorization.amount = 106;
            authorization.orderSource = orderSourceType.ecommerce;
            cardType card = new cardType();
            card.type = methodOfPaymentTypeEnum.VI;
            card.number = "4100000000000002";
            card.expDate = "1210";
            authorization.card = card;

            var mock = new Mock<Communications>();

            mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<litleOnlineRequest.*<authorization.*<card>.*<number>4100000000000002</number>.*</card>.*</authorization>.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>()))
                .Returns("<litleOnlineResponse version='8.10' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><authorizationResponse><litleTxnId>123</litleTxnId></authorizationResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;
            litle.setCommunication(mockedCommunication);
            authorizationResponse authorize = litle.Authorize(authorization);
            Assert.AreEqual(123, authorize.litleTxnId);
        }
开发者ID:wessiyad,项目名称:litle-sdk-for-dotNet,代码行数:23,代码来源:TestLitleOnline.cs


示例19: testUpdateSubscription

        public void testUpdateSubscription()
        {
            updateSubscription update = new updateSubscription();
            update.billingDate = new DateTime(2002, 10, 9);
            contact billToAddress = new contact();
            billToAddress.name = "Greg Dake";
            billToAddress.city = "Lowell";
            billToAddress.state = "MA";
            billToAddress.email = "[email protected]";
            update.billToAddress = billToAddress;
            cardType card = new cardType();
            card.number = "4100000000000001";
            card.expDate = "1215";
            card.type = methodOfPaymentTypeEnum.VI;
            update.card = card;
            update.planCode = "abcdefg";
            update.subscriptionId = 12345;

            var mockLitleResponse = new Mock<litleResponse>();
            var mockLitleXmlSerializer = new Mock<litleXmlSerializer>();

            mockXmlReader.SetupSequence(XmlReader => XmlReader.ReadOuterXml())
                .Returns("<updateSubscriptionResponse xmlns=\"http://www.litle.com/schema\"><litleTxnId>54321</litleTxnId><response>000</response><message>Approved</message><responseTime>2013-09-04T21:55:14</responseTime><subscriptionId>12345</subscriptionId></updateSubscriptionResponse>")
                .Returns("<updateSubscriptionResponse xmlns=\"http://www.litle.com/schema\"><litleTxnId>12345</litleTxnId><response>000</response><message>Approved</message><responseTime>2013-09-04T21:55:14</responseTime><subscriptionId>54321</subscriptionId></updateSubscriptionResponse>");

            batchResponse mockLitleBatchResponse = new batchResponse();
            mockLitleBatchResponse.setUpdateSubscriptionResponseReader(mockXmlReader.Object);

            mockLitleResponse.Setup(litleResponse => litleResponse.nextBatchResponse()).Returns(mockLitleBatchResponse);
            litleResponse mockedLitleResponse = mockLitleResponse.Object;

            mockLitleXmlSerializer.Setup(litleXmlSerializer => litleXmlSerializer.DeserializeObjectFromFile(It.IsAny<String>())).Returns(mockedLitleResponse);

            Communications mockedCommunication = mockCommunications.Object;
            litle.setCommunication(mockedCommunication);

            litleXmlSerializer mockedLitleXmlSerializer = mockLitleXmlSerializer.Object;
            litle.setLitleXmlSerializer(mockedLitleXmlSerializer);

            litleFile mockedLitleFile = mockLitleFile.Object;
            litle.setLitleFile(mockedLitleFile);

            litle.setLitleTime(mockLitleTime.Object);

            batchRequest litleBatchRequest = new batchRequest();
            litleBatchRequest.setLitleFile(mockedLitleFile);
            litleBatchRequest.setLitleTime(mockLitleTime.Object);
            litleBatchRequest.addUpdateSubscription(update);
            litle.addBatch(litleBatchRequest);

            string batchFileName = litle.sendToLitle();
            litleResponse actualLitleResponse = litle.receiveFromLitle(batchFileName);
            batchResponse actualLitleBatchResponse = actualLitleResponse.nextBatchResponse();

            Assert.AreSame(mockLitleBatchResponse, actualLitleBatchResponse);
            Assert.AreEqual("12345", actualLitleBatchResponse.nextUpdateSubscriptionResponse().subscriptionId);
            Assert.AreEqual("54321", actualLitleBatchResponse.nextUpdateSubscriptionResponse().subscriptionId);
            Assert.IsNull(actualLitleBatchResponse.nextUpdateSubscriptionResponse());

            mockCommunications.Verify(Communications => Communications.FtpDropOff(It.IsAny<String>(), mockFileName, It.IsAny<Dictionary<String, String>>()));
            mockCommunications.Verify(Communications => Communications.FtpPickUp(It.IsAny<String>(), It.IsAny<Dictionary<String, String>>(), mockFileName));
        }
开发者ID:hriyer,项目名称:litle-sdk-for-dotNet,代码行数:62,代码来源:TestBatch.cs


示例20: test33

        public void test33()
        {
            authorization auth = new authorization();
            auth.orderId = "33";
            auth.amount = 20020;
            auth.orderSource = orderSourceType.ecommerce;
            contact billToAddress = new contact();
            billToAddress.name = "Mike J. Hammer";
            billToAddress.addressLine1 = "2 Main St.";
            billToAddress.addressLine2 = "Apt. 222";
            billToAddress.city = "Riverside";
            billToAddress.state = "RI";
            billToAddress.zip = "02915";
            billToAddress.country = countryTypeEnum.US;
            auth.billToAddress = billToAddress;
            cardType card = new cardType();
            card.number = "5112010000000003";
            card.expDate = "0212";
            card.cardValidationNum = "261";
            card.type = methodOfPaymentTypeEnum.MC;
            auth.card = card;
            fraudCheckType fraud = new fraudCheckType();
            fraud.authenticationValue = "BwABBJQ1AgAAAAAgJDUCAAAAAAA=";
            auth.cardholderAuthentication = fraud;

            authorizationResponse authorizeResponse = litle.Authorize(auth);
            Assert.AreEqual("000", authorizeResponse.response);
            Assert.AreEqual("Approved", authorizeResponse.message);
            Assert.AreEqual("22222", authorizeResponse.authCode);
            Assert.AreEqual("10", authorizeResponse.fraudResult.avsResult);
            Assert.AreEqual("M", authorizeResponse.fraudResult.cardValidationResult);

            authReversal reversal = new authReversal();
            reversal.litleTxnId = authorizeResponse.litleTxnId;
            authReversalResponse reversalResponse = litle.AuthReversal(reversal);
            Assert.AreEqual("000", reversalResponse.response);
            Assert.AreEqual("Approved", reversalResponse.message);
        }
开发者ID:wessiyad,项目名称:litle-sdk-for-dotNet,代码行数:38,代码来源:TestCert3AuthReversal.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Sdk.contact类代码示例发布时间:2022-05-26
下一篇:
C# Sdk.batchRequest类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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