示例#1
0
文件: HKCCM.cs 项目: mode777/libfintx
        /// <summary>
        /// Collective transfer
        /// </summary>
        public static string Init_HKCCM(ConnectionDetails connectionDetails, List <pain00100203_ct_data> PainData, string NumberofTransactions, decimal TotalAmount)
        {
            Log.Write("Starting job HKCCM: Collective transfer money");

            SEG.NUM = SEGNUM.SETInt(3);

            var TotalAmount_ = TotalAmount.ToString().Replace(",", ".");

            string segments = "HKCCM:" + SEG.NUM + ":1+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + TotalAmount_ + ":EUR++" + " + urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.002.03+@@";

            var painMessage = pain00100203.Create(connectionDetails.AccountHolder, connectionDetails.IBAN, connectionDetails.BIC, PainData, NumberofTransactions, TotalAmount, new DateTime(1999, 1, 1));

            segments = segments.Replace("@@", "@" + (painMessage.Length - 1) + "@") + painMessage;

            if (Helper.IsTANRequired("HKCCM"))
            {
                SEG.NUM  = SEGNUM.SETInt(4);
                segments = HKTAN.Init_HKTAN(segments);
            }

            string message  = FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM);
            var    response = FinTSMessage.Send(connectionDetails.Url, message);

            Segment.HITAN = Helper.Parse_String(Helper.Parse_String(response, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(response);

            return(response);
        }
示例#2
0
文件: HKDSE.cs 项目: mode777/libfintx
        /// <summary>
        /// Collect
        /// </summary>
        public static string Init_HKDSE(ConnectionDetails connectionDetails, string Payer, string PayerIBAN, string PayerBIC, decimal Amount, string Usage, DateTime SettlementDate, string MandateNumber, DateTime MandateDate, string CreditorIDNumber)
        {
            Log.Write("Starting job HKDSE: Collect money");

            SEG.NUM = SEGNUM.SETInt(4);

            string segments = "HKDSE:" + SEG.NUM + ":1+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.008.002.02+@@";

            var message = pain00800202.Create(connectionDetails.AccountHolder, connectionDetails.IBAN, connectionDetails.BIC, Payer, PayerIBAN, PayerBIC, Amount, Usage, SettlementDate, MandateNumber, MandateDate, CreditorIDNumber);

            segments = segments.Replace("@@", "@" + (message.Length - 1) + "@") + message;

            if (Helper.IsTANRequired("HKDSE"))
            {
                SEG.NUM  = SEGNUM.SETInt(4);
                segments = HKTAN.Init_HKTAN(segments);
            }

            var TAN = FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM));

            Segment.HITAN = Helper.Parse_String(Helper.Parse_String(TAN, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(TAN);

            return(TAN);
        }
示例#3
0
文件: HKDSE.cs 项目: iwen65/libfintx
        /// <summary>
        /// Collect
        /// </summary>
        public static async Task <String> Init_HKDSE(FinTsClient client, string Payer, string PayerIBAN, string PayerBIC, decimal Amount, string Usage, DateTime SettlementDate, string MandateNumber, DateTime MandateDate, string CreditorIDNumber)
        {
            Log.Write("Starting job HKDSE: Collect money");

            client.SEGNUM = SEGNUM.SETInt(4);

            var    connectionDetails = client.ConnectionDetails;
            string segments          = "HKDSE:" + client.SEGNUM + ":1+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.008.002.02+@@";

            var message = pain00800202.Create(connectionDetails.AccountHolder, connectionDetails.Iban, connectionDetails.Bic, Payer, PayerIBAN, PayerBIC, Amount, Usage, SettlementDate, MandateNumber, MandateDate, CreditorIDNumber);

            segments = segments.Replace("@@", "@" + (message.Length - 1) + "@") + message;

            if (Helper.IsTANRequired("HKDSE"))
            {
                client.SEGNUM = SEGNUM.SETInt(4);
                segments      = HKTAN.Init_HKTAN(client, segments);
            }

            var TAN = await FinTSMessage.Send(client, FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS));

            client.HITAN = Helper.Parse_String(Helper.Parse_String(TAN, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(client, TAN);

            return(TAN);
        }
示例#4
0
文件: Tan4.cs 项目: Zengage/libfintx
        /// <summary>
        /// TAN process 4
        /// </summary>
        public static async Task <String> Send_TAN4(FinTsClient client, string TAN, string MediumName)
        {
            Log.Write("Starting job TAN process 4");

            string segments = string.Empty;

            // Version 3
            if (client.HITANS == 3)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + client.HITANS + "+4+++++++" + MediumName + "'";
            }
            // Version 4
            else if (client.HITANS == 4)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + client.HITANS + "+4++++++++" + MediumName + "'";
            }
            // Version 5
            else if (client.HITANS == 5)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + client.HITANS + "+4++++++++++" + MediumName + "'";
            }

            client.SEGNUM = SEGNUM.SETInt(3);

            return(await FinTSMessage.Send(client, FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS + ":" + TAN)));
        }
示例#5
0
        /// <summary>
        /// Collective collect
        /// </summary>
        public static async Task <String> Init_HKDME(FinTsClient client, DateTime SettlementDate, List <Pain00800202CcData> PainData, string NumberofTransactions, decimal TotalAmount)
        {
            Log.Write("Starting job HKDME: Collective collect money");

            client.SEGNUM = SEGNUM.SETInt(3);

            var TotalAmount_ = TotalAmount.ToString().Replace(",", ".");

            var connectionDetails = client.ConnectionDetails;
            // TODO: Anscheinend wird totalAmount nur in der Version 2 unterstützt, diese hat jedoch nicht jede Bank implementiert.
            //string segments = "HKDME:" + client.SEGNUM + ":2+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "+" + TotalAmount_ + ":EUR++" + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.008.002.02+@@";
            string segments = "HKDME:" + client.SEGNUM + ":1+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "++" + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.008.002.02+@@";

            var message = pain00800202.Create(connectionDetails.AccountHolder, connectionDetails.Iban, connectionDetails.Bic, SettlementDate, PainData, NumberofTransactions, TotalAmount);

            segments = segments.Replace("@@", "@" + (message.Length - 1) + "@") + message;

            if (Helper.IsTANRequired("HKDME"))
            {
                client.SEGNUM = SEGNUM.SETInt(4);
                segments      = HKTAN.Init_HKTAN(client, segments);
            }

            var TAN = await FinTSMessage.Send(client, FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS));

            client.HITAN = Helper.Parse_String(Helper.Parse_String(TAN, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(client, TAN);

            return(TAN);
        }
示例#6
0
        /// <summary>
        /// TAN process 4
        /// </summary>
        public static async Task <String> Send_TAN4(FinTsClient client, string TAN, string MediumName)
        {
            Log.Write("Starting job TAN process 4");

            var    connectionDetails = client.ConnectionDetails;
            string segments          = string.Empty;

            var HITANS = !String.IsNullOrEmpty(client.HITANS.Substring(0, 1)) ? int.Parse(client.HITANS.Substring(0, 1)) : 0;

            // Version 3
            if (HITANS == 3)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + client.HITANS.Substring(0, 1) + "+4+++++++" + MediumName + "'";
            }
            // Version 4
            else if (HITANS == 4)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + client.HITANS.Substring(0, 1) + "+4++++++++" + MediumName + "'";
            }
            // Version 5
            else if (HITANS == 5)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + client.HITANS.Substring(0, 1) + "+4++++++++++" + MediumName + "'";
            }

            client.SEGNUM = SEGNUM.SETInt(3);

            return(await FinTSMessage.Send(client, FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS + ":" + TAN)));
        }
示例#7
0
文件: HKDME.cs 项目: mode777/libfintx
        /// <summary>
        /// Collective collect
        /// </summary>
        public static string Init_HKDME(ConnectionDetails connectionDetails, DateTime SettlementDate, List <pain00800202_cc_data> PainData, string NumberofTransactions, decimal TotalAmount)
        {
            Log.Write("Starting job HKDME: Collective collect money");

            SEG.NUM = SEGNUM.SETInt(3);

            var TotalAmount_ = TotalAmount.ToString().Replace(",", ".");

            string segments = "HKDME:" + SEG.NUM + ":2+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + "+" + TotalAmount_ + ":EUR++" + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.008.002.02+@@";

            var message = pain00800202.Create(connectionDetails.AccountHolder, connectionDetails.IBAN, connectionDetails.BIC, SettlementDate, PainData, NumberofTransactions, TotalAmount);

            segments = segments.Replace("@@", "@" + (message.Length - 1) + "@") + message;

            if (Helper.IsTANRequired("HKDME"))
            {
                SEG.NUM  = SEGNUM.SETInt(4);
                segments = HKTAN.Init_HKTAN(segments);
            }

            var TAN = FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM));

            Segment.HITAN = Helper.Parse_String(Helper.Parse_String(TAN, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(TAN);

            return(TAN);
        }
示例#8
0
        /// <summary>
        /// Delete terminated transfer
        /// </summary>
        public static async Task <string> Init_HKCSA(FinTsClient client, string OrderId, string Receiver, string ReceiverIBAN, string ReceiverBIC, decimal Amount, string Usage, DateTime ExecutionDay)
        {
            Log.Write("Starting job HKCSA: Modify terminated transfer");

            client.SEGNUM = SEGNUM.SETInt(3);
            var    connectionDetails = client.ConnectionDetails;
            string segments          = "HKCSA:" + client.SEGNUM + ":1+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.001.03+@@";

            var sepaMessage = pain00100103.Create(connectionDetails.AccountHolder, connectionDetails.Iban, connectionDetails.Bic, Receiver, ReceiverIBAN, ReceiverBIC, Amount, Usage, ExecutionDay).Replace("'", "");

            segments = segments.Replace("@@", "@" + sepaMessage.Length + "@") + sepaMessage;

            segments += "+" + OrderId;

            segments += "'";

            if (Helper.IsTANRequired("HKCSA"))
            {
                client.SEGNUM = SEGNUM.SETInt(4);
                segments      = HKTAN.Init_HKTAN(client, segments, "HKCSA");
            }

            string message = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS);
            var    TAN     = await FinTSMessage.Send(client, message);

            Helper.Parse_Message(client, TAN);

            return(TAN);
        }
示例#9
0
文件: TAN4.cs 项目: mode777/libfintx
        /// <summary>
        /// TAN process 4
        /// </summary>
        public static string Send_TAN4(ConnectionDetails connectionDetails, string TAN, string MediumName)
        {
            Log.Write("Starting job TAN process 4");

            string segments = string.Empty;

            var HITANS = !String.IsNullOrEmpty(Segment.HITANS.Substring(0, 1)) ? Int32.Parse(Segment.HITANS.Substring(0, 1)) : 0;

            // Version 3
            if (HITANS == 3)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + Segment.HITANS.Substring(0, 1) + "+4+++++++" + MediumName + "'";
            }
            // Version 4
            if (HITANS == 4)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + Segment.HITANS.Substring(0, 1) + "+4++++++++" + MediumName + "'";
            }
            // Version 5
            if (HITANS == 5)
            {
                segments = "HKTAN:" + SEGNUM.SETVal(3) + ":" + Segment.HITANS.Substring(0, 1) + "+4++++++++++" + MediumName + "'";
            }

            SEG.NUM = SEGNUM.SETInt(3);

            return(FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS + ":" + TAN, SEG.NUM)));
        }
示例#10
0
文件: HKSAL.cs 项目: iwen65/libfintx
        /// <summary>
        /// Balance
        /// </summary>
        public static async Task <String> Init_HKSAL(FinTsClient client)
        {
            Log.Write("Starting job HKSAL: Request balance");

            var    connectionDetails = client.ConnectionDetails;
            string segments          = string.Empty;

            client.SEGNUM = SEGNUM.SETInt(3);

            if (Convert.ToInt16(client.HISALS) >= 7)
            {
                segments = "HKSAL:" + client.SEGNUM + ":" + client.HISALS + "+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "+N'";
            }
            else
            {
                segments = "HKSAL:" + client.SEGNUM + ":" + client.HISALS + "+" + connectionDetails.Account + "::280:" + connectionDetails.Blz + "+N'";
            }

            if (Helper.IsTANRequired("HKSAL"))
            {
                client.SEGNUM = SEGNUM.SETInt(4);
                segments      = HKTAN.Init_HKTAN(client, segments);
            }

            string message  = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS);
            string response = await FinTSMessage.Send(client, message);

            client.HITAN = Helper.Parse_String(Helper.Parse_String(response, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(client, response);

            return(response);
        }
示例#11
0
        /// <summary>
        /// Collective transfer terminated
        /// </summary>
        public static string Init_HKCME(int BLZ, string Accountholder, string AccountholderIBAN, string AccountholderBIC,
                                        List <pain00100203_ct_data> PainData, string NumberofTransactions, decimal TotalAmount, string ExecutionDay,
                                        string URL, int HBCIVersion, string UserID, string PIN)
        {
            Log.Write("Starting job HKCME: Collective transfer money terminated");

            var TotalAmount_ = TotalAmount.ToString().Replace(",", ".");

            string segments = "HKCME:" + SEGNUM.SETVal(3) + ":1+" + AccountholderIBAN + ":" + AccountholderBIC + TotalAmount_ + ":EUR++" + " + urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.002.03+@@";

            var message = pain00100203.Create(Accountholder, AccountholderIBAN, AccountholderBIC, PainData, NumberofTransactions, TotalAmount, ExecutionDay);

            segments = segments.Replace("@@", "@" + (message.Length - 1) + "@") + message;

            segments = segments + "HKTAN:" + SEGNUM.SETVal(4) + ":" + Segment.HITANS + "'";

            SEG.NUM = SEGNUM.SETInt(4);

            var TAN = FinTSMessage.Send(URL, FinTSMessage.Create(HBCIVersion, Segment.HNHBS, Segment.HNHBK, BLZ, UserID, PIN, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM));

            Segment.HITAN = Helper.Parse_String(Helper.Parse_String(TAN, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(TAN);

            return(TAN);
        }
示例#12
0
文件: HKCME.cs 项目: iwen65/libfintx
        /// <summary>
        /// Collective transfer terminated
        /// </summary>
        public static async Task <String> Init_HKCME(FinTsClient client, List <Pain00100203CtData> PainData, string NumberofTransactions, decimal TotalAmount, DateTime ExecutionDay)
        {
            Log.Write("Starting job HKCME: Collective transfer money terminated");

            var TotalAmount_ = TotalAmount.ToString().Replace(",", ".");

            client.SEGNUM = SEGNUM.SETInt(3);

            var    connectionDetails = client.ConnectionDetails;
            string segments          = "HKCME:" + client.SEGNUM + ":1+" + connectionDetails.Iban + ":" + connectionDetails.Bic + TotalAmount_ + ":EUR++" + " + urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.002.03+@@";

            var painMessage = pain00100203.Create(connectionDetails.AccountHolder, connectionDetails.Iban, connectionDetails.Bic, PainData, NumberofTransactions, TotalAmount, ExecutionDay);

            segments = segments.Replace("@@", "@" + (painMessage.Length - 1) + "@") + painMessage;

            if (Helper.IsTANRequired("HKCME"))
            {
                client.SEGNUM = SEGNUM.SETInt(4);
                segments      = HKTAN.Init_HKTAN(client, segments);
            }

            string message  = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS);
            var    response = await FinTSMessage.Send(client, message);

            client.HITAN = Helper.Parse_String(Helper.Parse_String(response, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(client, response);

            return(response);
        }
示例#13
0
文件: HKCDL.cs 项目: Zengage/libfintx
        /// <summary>
        /// Delete banker's order
        /// </summary>
        public static async Task <String> Init_HKCDL(FinTsClient client, string OrderId, string Receiver, string ReceiverIBAN, string ReceiverBIC, decimal Amount, string Usage, DateTime FirstTimeExecutionDay, TimeUnit timeUnit, string Rota, int ExecutionDay, DateTime?LastExecutionDay)
        {
            Log.Write("Starting job HKCDL: Delete bankers order");

            client.SEGNUM = SEGNUM.SETInt(3);
            var    connectionDetails = client.ConnectionDetails;
            string segments          = "HKCDL:" + client.SEGNUM + ":1+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.001.03+@@";

            var sepaMessage = pain00100103.Create(connectionDetails.AccountHolder, connectionDetails.Iban, connectionDetails.Bic, Receiver, ReceiverIBAN, ReceiverBIC, Amount, Usage, new DateTime(1999, 1, 1)).Replace("'", "");

            segments = segments.Replace("@@", "@" + sepaMessage.Length + "@") + sepaMessage;

            segments += "++" + OrderId + "+" + FirstTimeExecutionDay.ToString("yyyyMMdd") + ":" + (char)timeUnit + ":" + Rota + ":" + ExecutionDay;
            if (LastExecutionDay != null)
            {
                segments += ":" + LastExecutionDay.Value.ToString("yyyyMMdd");
            }

            segments += "'";

            if (Helper.IsTANRequired("HKCDL"))
            {
                client.SEGNUM = SEGNUM.SETInt(4);
                segments      = HKTAN.Init_HKTAN(client, segments, "HKCDL");
            }

            string message = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS);
            var    TAN     = await FinTSMessage.Send(client, message);

            Helper.Parse_Message(client, TAN);

            return(TAN);
        }
示例#14
0
文件: HKCUM.cs 项目: mode777/libfintx
        /// <summary>
        /// Rebooking
        /// </summary>
        public static string Init_HKCUM(ConnectionDetails connectionDetails, string Receiver, string ReceiverIBAN, string ReceiverBIC, decimal Amount, string Usage)
        {
            Log.Write("Starting job HKCUM: Rebooking money");

            SEG.NUM = SEGNUM.SETInt(3);

            string segments = "HKCUM:" + SEG.NUM + ":1+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.002.03+@@";

            var message = pain00100203.Create(connectionDetails.AccountHolder, connectionDetails.IBAN, connectionDetails.BIC, Receiver, ReceiverIBAN, ReceiverBIC, Amount, Usage, new DateTime(1999, 1, 1));

            segments = segments.Replace("@@", "@" + (message.Length - 1) + "@") + message;

            if (Helper.IsTANRequired("HKCUM"))
            {
                SEG.NUM  = SEGNUM.SETInt(4);
                segments = HKTAN.Init_HKTAN(segments);
            }

            var TAN = FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM));

            Segment.HITAN = Helper.Parse_String(Helper.Parse_String(TAN, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(TAN);

            return(TAN);
        }
示例#15
0
        /// <summary>
        /// Rebooking
        /// </summary>
        public static async Task <String> Init_HKCUM(FinTsClient client, string Receiver, string ReceiverIBAN, string ReceiverBIC, decimal Amount, string Usage)
        {
            Log.Write("Starting job HKCUM: Rebooking money");

            client.SEGNUM = SEGNUM.SETInt(3);

            var    connectionDetails = client.ConnectionDetails;
            string segments          = "HKCUM:" + client.SEGNUM + ":1+" + connectionDetails.Iban + ":" + connectionDetails.Bic + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.002.03+@@";

            var message = pain00100203.Create(connectionDetails.AccountHolder, connectionDetails.Iban, connectionDetails.Bic, Receiver, ReceiverIBAN, ReceiverBIC, Amount, Usage, new DateTime(1999, 1, 1));

            segments = segments.Replace("@@", "@" + (message.Length - 1) + "@") + message;

            if (Helper.IsTANRequired("HKCUM"))
            {
                client.SEGNUM = SEGNUM.SETInt(4);
                segments      = HKTAN.Init_HKTAN(client, segments, "HKCUM");
            }

            var TAN = await FinTSMessage.Send(client, FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS));

            Helper.Parse_Message(client, TAN);

            return(TAN);
        }
示例#16
0
        /// <summary>
        /// Balance
        /// </summary>
        public static string Init_HKSAL(ConnectionDetails connectionDetails)
        {
            Log.Write("Starting job HKSAL: Request balance");

            string segments = string.Empty;

            SEG.NUM = SEGNUM.SETInt(3);

            if (Convert.ToInt16(Segment.HISALS) >= 7)
            {
                segments = "HKSAL:" + SEG.NUM + ":" + Segment.HISALS + "+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + "+N'";
            }
            else
            {
                segments = "HKSAL:" + SEG.NUM + ":" + Segment.HISALS + "+" + connectionDetails.Account + "::280:" + connectionDetails.Blz + "+N'";
            }

            if (Helper.IsTANRequired("HKSAL"))
            {
                SEG.NUM  = SEGNUM.SETInt(4);
                segments = HKTAN.Init_HKTAN(segments);
            }

            string message  = FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM);
            string response = FinTSMessage.Send(connectionDetails.Url, message);

            Segment.HITAN = Helper.Parse_String(Helper.Parse_String(response, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(response);

            return(response);
        }
示例#17
0
        /// <summary>
        /// Submit bankers order
        /// </summary>
        public static string Init_HKCDE(ConnectionDetails connectionDetails, string Receiver, string ReceiverIBAN, string ReceiverBIC, decimal Amount, string Usage, DateTime FirstTimeExecutionDay, TimeUnit timeUnit, string Rota, int ExecutionDay)
        {
            Log.Write("Starting job HKCDE: Submit bankers order");

            SEG.NUM = SEGNUM.SETInt(3);

            string segments = "HKCDE:" + SEG.NUM + ":1+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.001.03+@@";

            var sepaMessage = pain00100103.Create(connectionDetails.AccountHolder, connectionDetails.IBAN, connectionDetails.BIC, Receiver, ReceiverIBAN, ReceiverBIC, Amount, Usage, new DateTime(1999, 1, 1)).Replace("'", "");

            segments = segments.Replace("@@", "@" + sepaMessage.Length + "@") + sepaMessage;

            segments += "+" + FirstTimeExecutionDay.ToString("yyyyMMdd") + ":" + (char)timeUnit + ":" + Rota + ":" + ExecutionDay + "'";

            if (Helper.IsTANRequired("HKCDE"))
            {
                SEG.NUM  = SEGNUM.SETInt(4);
                segments = HKTAN.Init_HKTAN(segments);
            }

            string message  = FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM);
            var    response = FinTSMessage.Send(connectionDetails.Url, message);

            Segment.HITAN = Helper.Parse_String(Helper.Parse_String(response, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(response);

            return(response);
        }
示例#18
0
        /// <summary>
        /// Get bankers orders
        /// </summary>
        public static string Init_HKCSB(ConnectionDetails connectionDetails)
        {
            Log.Write("Starting job HKCSB: Get bankers order");

            string segments = "HKCSB:" + SEGNUM.SETVal(3) + ":1+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + "+sepade?:xsd?:pain.001.001.03.xsd'";

            SEG.NUM = SEGNUM.SETInt(3);

            return(FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.Blz, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM)));
        }
示例#19
0
文件: HKCDB.cs 项目: feliwir/libfintx
        /// <summary>
        /// Get bankers orders
        /// </summary>
        public static string Init_HKCDB(ConnectionDetails connectionDetails)
        {
            Log.Write("Starting job HKCDB: Get bankers order");

            string segments = "HKCDB:" + SEGNUM.SETVal(3) + ":1+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + "+urn?:iso?:std?:iso?:20022?:tech?:xsd?:pain.001.001.03'";

            SEG.NUM = SEGNUM.SETInt(3);

            string message = FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM);

            return(FinTSMessage.Send(connectionDetails.Url, message));
        }
示例#20
0
        /// <summary>
        /// End of dialog
        /// </summary>
        /// <param name="connectionDetails"></param>
        /// <param name="dialogID"></param>
        public static string Init_HKEND(ConnectionDetails connectionDetails, string dialogID)
        {
            Log.Write("Starting job HKEND: End of dialog");

            string segments = string.Empty;

            segments = "HKEND:" + SEGNUM.SETVal(3) + "1+" + dialogID + "'";

            SEG.NUM = SEGNUM.SETInt(3);

            return(FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.Blz, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM)));
        }
示例#21
0
        /// <summary>
        /// Request TAN medium name
        /// </summary>
        public static string Init_HKTAB(ConnectionDetails connectionDetails)
        {
            Log.Write("Starting job HKTAB: Request tan medium name");

            string segments = string.Empty;

            segments = "HKTAB:" + SEGNUM.SETVal(3) + ":4+0+A'";

            SEG.NUM = SEGNUM.SETInt(3);

            return(FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM)));
        }
示例#22
0
        /// <summary>
        /// Request SEPA account connection
        /// </summary>
        /// <param name="connectionDetails"></param>
        /// <returns></returns>
        public static string Init_HKSPA(ConnectionDetails connectionDetails)
        {
            Log.Write("Starting job HKSPA: Request SEPA account connection");

            string segments = string.Empty;

            segments = "HKEND:" + SEGNUM.SETVal(3) + "1'";

            SEG.NUM = SEGNUM.SETInt(3);

            return(FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.Blz, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM)));
        }
示例#23
0
文件: HKSPA.cs 项目: iwen65/libfintx
        /// <summary>
        /// Request SEPA account connection
        /// </summary>
        /// <param name="connectionDetails"></param>
        /// <returns></returns>
        public static async Task <String> Init_HKSPA(FinTsClient client)
        {
            Log.Write("Starting job HKSPA: Request SEPA account connection");

            var    connectionDetails = client.ConnectionDetails;
            string segments          = string.Empty;

            segments = "HKEND:" + SEGNUM.SETVal(3) + "1'";

            client.SEGNUM = SEGNUM.SETInt(3);

            return(await FinTSMessage.Send(client, FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS)));
        }
示例#24
0
        /// <summary>
        /// Balance
        /// </summary>
        public static async Task <String> Init_HKSAL(FinTsClient client)
        {
            Log.Write("Starting job HKSAL: Request balance");

            var connectionDetails = client.ConnectionDetails;
            AccountInformation activeAccount;

            if (client.activeAccount != null)
            {
                activeAccount = client.activeAccount;
            }
            else
            {
                activeAccount = new AccountInformation()
                {
                    AccountNumber   = connectionDetails.Account,
                    AccountBankCode = connectionDetails.Blz.ToString(),
                    AccountIban     = connectionDetails.Iban,
                    AccountBic      = connectionDetails.Bic,
                }
            };


            string segments = string.Empty;

            client.SEGNUM = SEGNUM.SETInt(3);

            if (Convert.ToInt16(client.HISALS) >= 7)
            {
                segments = "HKSAL:" + client.SEGNUM + ":" + client.HISALS + "+" + activeAccount.AccountIban + ":" + activeAccount.AccountBic + "+N'";
            }
            else
            {
                segments = "HKSAL:" + client.SEGNUM + ":" + client.HISALS + "+" + activeAccount.AccountNumber + "::280:" + activeAccount.AccountBankCode + "+N'";
            }

            if (Helper.IsTANRequired("HKSAL"))
            {
                client.SEGNUM = SEGNUM.SETInt(4);
                segments      = HKTAN.Init_HKTAN(client, segments, "HKSAL");
            }

            string message  = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS);
            string response = await FinTSMessage.Send(client, message);

            Helper.Parse_Message(client, response);

            return(response);
        }
    }
示例#25
0
        /// <summary>
        /// End of dialog
        /// </summary>
        /// <param name="connectionDetails"></param>
        /// <param name="dialogID"></param>
        public static async Task <String> Init_HKEND(FinTsClient client, string dialogID)
        {
            Log.Write("Starting job HKEND: End of dialog");

            var    connectionDetails = client.ConnectionDetails;
            string segments          = string.Empty;

            segments = "HKEND:" + SEGNUM.SETVal(3) + "1+" + dialogID + "'";

            client.SEGNUM = SEGNUM.SETInt(3);

            string message = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS);

            return(await FinTSMessage.Send(client, message));
        }
示例#26
0
        /// <summary>
        /// Request TAN medium name
        /// </summary>
        public static async Task <String> Init_HKTAB(FinTsClient client)
        {
            Log.Write("Starting job HKTAB: Request tan medium name");

            var    connectionDetails = client.ConnectionDetails;
            string segments          = string.Empty;

            segments = "HKTAB:" + SEGNUM.SETVal(3) + ":4+0+A'";

            client.SEGNUM = SEGNUM.SETInt(3);

            string message = FinTSMessage.Create(client, client.HNHBS, client.HNHBK, segments, client.HIRMS);

            return(await FinTSMessage.Send(client, message));
        }
示例#27
0
文件: HKSYN.cs 项目: iwen65/libfintx
        public static async Task <String> Init_HKSYN(FinTsClient client)
        {
            Log.Write("Starting Synchronisation");

            string segments;
            var    connectionDetails = client.ConnectionDetails;

            if (connectionDetails.HbciVersion == 220)
            {
                string segments_ =
                    "HKIDN:" + SEGNUM.SETVal(3) + ":2+280:" + connectionDetails.BlzPrimary + "+" + connectionDetails.UserId + "+0+1'" +
                    "HKVVB:" + SEGNUM.SETVal(4) + ":2+0+0+0+" + FinTsConfig.ProductId + "+" + FinTsConfig.Version + "'" +
                    "HKSYN:" + SEGNUM.SETVal(5) + ":2+0'";

                segments = segments_;
            }
            else if (connectionDetails.HbciVersion == 300)
            {
                string segments_ =
                    "HKIDN:" + SEGNUM.SETVal(3) + ":2+280:" + connectionDetails.BlzPrimary + "+" + connectionDetails.UserId + "+0+1'" +
                    "HKVVB:" + SEGNUM.SETVal(4) + ":3+0+0+0+" + FinTsConfig.ProductId + "+" + FinTsConfig.Version + "'" +
                    "HKSYN:" + SEGNUM.SETVal(5) + ":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 = SEGNUM.SETInt(5);

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

            Helper.Parse_Segment(client, response);

            return(response);
        }
示例#28
0
        /// <summary>
        /// Load prepaid
        /// </summary>
        public static string Init_HKPPD(ConnectionDetails connectionDetails, int MobileServiceProvider, string PhoneNumber, int Amount)
        {
            Log.Write("Starting job HKPPD: Load prepaid");

            string segments = "HKPPD:" + SEGNUM.SETVal(3) + ":2+" + connectionDetails.IBAN + ":" + connectionDetails.BIC + "+" + MobileServiceProvider + "+" + PhoneNumber + "+" + Amount + ",:EUR'";

            segments = HKTAN.Init_HKTAN(segments);

            SEG.NUM = SEGNUM.SETInt(4);

            var TAN = FinTSMessage.Send(connectionDetails.Url, FinTSMessage.Create(connectionDetails.HBCIVersion, Segment.HNHBS, Segment.HNHBK, connectionDetails.Blz, connectionDetails.UserId, connectionDetails.Pin, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM));

            Segment.HITAN = Helper.Parse_String(Helper.Parse_String(TAN, "HITAN", "'").Replace("?+", "??"), "++", "+").Replace("??", "?+");

            Helper.Parse_Message(TAN);

            return(TAN);
        }
示例#29
0
        public static string Init_HKSYN(ConnectionDetails connectionDetails)
        {
            Log.Write("Starting Synchronisation");

            string segments;

            if (connectionDetails.HBCIVersion == 220)
            {
                string segments_ =
                    "HKIDN:" + SEGNUM.SETVal(3) + ":2+280:" + connectionDetails.BlzPrimary + "+" + connectionDetails.UserId + "+0+1'" +
                    "HKVVB:" + SEGNUM.SETVal(4) + ":2+0+0+0+" + Program.ProductId + "+" + Program.Version + "'" +
                    "HKSYN:" + SEGNUM.SETVal(5) + ":2+0'";

                segments = segments_;
            }
            else if (connectionDetails.HBCIVersion == 300)
            {
                string segments_ =
                    "HKIDN:" + SEGNUM.SETVal(3) + ":2+280:" + connectionDetails.BlzPrimary + "+" + connectionDetails.UserId + "+0+1'" +
                    "HKVVB:" + SEGNUM.SETVal(4) + ":3+0+0+0+" + Program.ProductId + "+" + Program.Version + "'" +
                    "HKSYN:" + SEGNUM.SETVal(5) + ":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");
            }

            SEG.NUM = SEGNUM.SETInt(5);

            string message  = FinTSMessage.Create(connectionDetails.HBCIVersion, MSG.SETVal(1), DLG.SETVal(0), connectionDetails.BlzPrimary, connectionDetails.UserId, connectionDetails.Pin, SYS.SETVal(0), segments, null, SEG.NUM);
            string response = FinTSMessage.Send(connectionDetails.Url, message);

            Helper.Parse_Segment(connectionDetails.UserId, connectionDetails.Blz, connectionDetails.HBCIVersion, response);

            return(response);
        }
示例#30
0
文件: HKSAL.cs 项目: eBerdnA/libfintx
        /// <summary>
        /// Balance
        /// </summary>
        public static string Init_HKSAL(string Konto, int BLZ, string IBAN, string BIC, string URL, int HBCIVersion, string UserID, string PIN)
        {
            Log.Write("Starting job HKSAL: Request balance");

            string segments = string.Empty;

            if (Convert.ToInt16(Segment.HISALS) >= 7)
            {
                segments = "HKSAL:" + SEGNUM.SETVal(3) + ":" + Segment.HISALS + "+" + IBAN + ":" + BIC + "+N'";
            }
            else
            {
                segments = "HKSAL:" + SEGNUM.SETVal(3) + ":" + Segment.HISALS + "+" + Konto + "::280:" + BLZ + "+N'";
            }

            SEG.NUM = SEGNUM.SETInt(3);

            return(FinTSMessage.Send(URL, FinTSMessage.Create(HBCIVersion, Segment.HNHBS, Segment.HNHBK, BLZ, UserID, PIN, Segment.HISYN, segments, Segment.HIRMS, SEG.NUM)));
        }