public void TestSimpleRequestWithApplepay()
        {
            RegisterTokenRequestType register = new RegisterTokenRequestType();
            register.OrderId = "12344";
            ApplepayType applepay = new ApplepayType();
            ApplepayHeaderType applepayHeaderType = new ApplepayHeaderType();
            applepayHeaderType.ApplicationData = "454657413164";
            applepayHeaderType.EphemeralPublicKey = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
            applepayHeaderType.PublicKeyHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
            applepayHeaderType.TransactionId = "1234";
            applepay.Header = applepayHeaderType;
            applepay.Data = "user";
            applepay.Signature = "sign";
            applepay.Version = "1";
            register.Applepay = applepay;

            var mock = new Mock<Communications>();

            mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<registerTokenRequest.*<applepay>.*?<data>user</data>.*?</applepay>.*?</registerTokenRequest>.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>()))
                .Returns("<litleOnlineResponse version='8.14' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><registerTokenResponse><litleTxnId>4</litleTxnId><response>801</response><message>Token Successfully Registered</message><responseTime>2012-10-10T10:17:03</responseTime></registerTokenResponse></litleOnlineResponse>");

            Communications mockedCommunication = mock.Object;
            litle.SetCommunication(mockedCommunication);
            litle.RegisterToken(register);
        }
        public void SimpleSaleWithApplepayAndSecondaryAmountAndWallet()
        {
            Sale saleObj = new Sale();
            saleObj.Amount = 110;
            saleObj.SecondaryAmount = 50;
            saleObj.LitleTxnId = 123456;
            saleObj.OrderId = "12344";
            saleObj.OrderSource = OrderSourceType.Ecommerce;
            ApplepayType applepay = new ApplepayType();
            ApplepayHeaderType applepayHeaderType = new ApplepayHeaderType();
            applepayHeaderType.ApplicationData = "454657413164";
            applepayHeaderType.EphemeralPublicKey = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
            applepayHeaderType.PublicKeyHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
            applepayHeaderType.TransactionId = "1234";
            applepay.Header = applepayHeaderType;
            applepay.Data = "user";
            applepay.Signature = "sign";
            applepay.Version = "1";
            saleObj.Applepay = applepay;
            Wallet wallet = new Wallet();
            wallet.WalletSourceTypeId = "123";
            wallet.WalletSourceType = WalletWalletSourceType.MasterPass;
            saleObj.Wallet = wallet;

            SaleResponse responseObj = litle.Sale(saleObj);
            Assert.AreEqual("Insufficient Funds", responseObj.Message);
            Assert.AreEqual("110", responseObj.ApplepayResponse.TransactionAmount);
        }
 public void SimpleTokenWithApplepay()
 {
     RegisterTokenRequestType registerTokenRequest = new RegisterTokenRequestType();
     registerTokenRequest.OrderId = "12344";
     registerTokenRequest.ReportGroup = "Planets";
     ApplepayType applepay = new ApplepayType();
     ApplepayHeaderType applepayHeaderType = new ApplepayHeaderType();
     applepayHeaderType.ApplicationData = "454657413164";
     applepayHeaderType.EphemeralPublicKey = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
     applepayHeaderType.PublicKeyHash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
     applepayHeaderType.TransactionId = "1234";
     applepay.Header = applepayHeaderType;
     applepay.Data = "user";
     applepay.Signature = "sign";
     applepay.Version = "1";
     registerTokenRequest.Applepay = applepay;
     RegisterTokenResponse rtokenResponse = litle.RegisterToken(registerTokenRequest);
     StringAssert.AreEqualIgnoringCase("Account number was successfully registered", rtokenResponse.Message);
     Assert.AreEqual("0", rtokenResponse.ApplepayResponse.TransactionAmount);
 }