示例#1
0
        public void CreateSync_StateUnderTest_ExpectedBehavior()
        {
            // Arrange
            FinTsClient client   = null;
            string      Segments = null;

            // Act
            var result = FinTSMessage.CreateSync(
                client,
                Segments);

            // Assert
            Assert.True(false);
        }
示例#2
0
        public static async Task <String> Init_HKSYN(FinTsClient client)
        {
            Log.Write("Starting Synchronisation");

            string segments;
            var    connectionDetails = client.ConnectionDetails;

            if (connectionDetails.HbciVersion == Convert.ToInt16(HBCI.v220))
            {
                string segments_ =
                    "HKIDN:" + SEG_NUM.Seg3 + ":2+" + SEG_Country.Germany + ":" + connectionDetails.BlzPrimary + "+" + connectionDetails.UserId + "+0+1'" +
                    "HKVVB:" + SEG_NUM.Seg4 + ":2+0+0+0+" + FinTsGlobals.ProductId + "+" + FinTsGlobals.Version + "'" +
                    "HKSYN:" + SEG_NUM.Seg5 + ":2+0'";

                segments = segments_;
            }
            else if (connectionDetails.HbciVersion == Convert.ToInt16(HBCI.v300))
            {
                string segments_ =
                    "HKIDN:" + SEG_NUM.Seg3 + ":2+" + SEG_Country.Germany + ":" + connectionDetails.BlzPrimary + "+" + connectionDetails.UserId + "+0+1'" +
                    "HKVVB:" + SEG_NUM.Seg4 + ":3+0+0+0+" + FinTsGlobals.ProductId + "+" + FinTsGlobals.Version + "'" +
                    "HKSYN:" + SEG_NUM.Seg5 + ":3+0'";

                segments = segments_;
            }
            else
            {
                //Since connectionDetails is a re-usable object, this shouldn't be cleared.
                //connectionDetails.UserId = string.Empty;
                //connectionDetails.Pin = null;

                Log.Write("HBCI version not supported");

                throw new Exception("HBCI version not supported");
            }

            client.SEGNUM = Convert.ToInt16(SEG_NUM.Seg5);

            string message  = FinTSMessage.CreateSync(client, segments);
            string response = await FinTSMessage.Send(client, message);

            Helper.Parse_Segments(client, response);

            return(response);
        }