コード例 #1
0
        /// <summary>
        /// Creates xml representation of directory request
        /// </summary>
        public override string ToXml(ISignatureProvider signatureProvider)
        {
            var directoryRequestXmlMessage = new XDocument(
                new XDeclaration("1.0", "UTF-8", null),
                new XElement(Xml.Ns + "DirectoryReq",
                    new XAttribute("version", "3.3.1"),
                    new XElement(Xml.Ns + "createDateTimestamp", CreateDateTimestamp),
                    new XElement(Xml.Ns + "Merchant",
                        new XElement(Xml.Ns + "merchantID", MerchantId.PadLeft(9, '0')),
                        new XElement(Xml.Ns + "subID", "0"))));

            return signatureProvider.SignRequestXml(directoryRequestXmlMessage);
        }
コード例 #2
0
        public override string ToXml(ISignatureProvider signatureProvider)
        {
            var directoryRequestXmlMessage = new XDocument(
                new XDeclaration("1.0", "UTF-8", null),
                new XElement(Xml.Ns + "AcquirerTrxReq",
                    new XAttribute("version", "3.3.1"),
                    new XElement(Xml.Ns + "createDateTimestamp", CreateDateTimestamp),
                    new XElement(Xml.Ns + "Issuer",
                        new XElement(Xml.Ns + "issuerID", IssuerId.PadLeft(4, '0'))),
                    new XElement(Xml.Ns + "Merchant",
                        new XElement(Xml.Ns + "merchantID", MerchantId.PadLeft(9, '0')),
                        new XElement(Xml.Ns + "subID", "0"),
                        new XElement(Xml.Ns + "merchantReturnURL", MerchantReturnUrl)),
                    new XElement(Xml.Ns + "Transaction",
                        new XElement(Xml.Ns + "purchaseID", PurchaseId),
                        new XElement(Xml.Ns + "amount", Amount.ToString("0.##", CultureInfo.InvariantCulture)),
                        new XElement(Xml.Ns + "currency", "EUR"),
                        new XElement(Xml.Ns + "expirationPeriod",
                            "PT" + Convert.ToInt32(Math.Floor(ExpirationPeriod.Value.TotalSeconds)) + "S"),
                        new XElement(Xml.Ns + "language", "nl"),
                        new XElement(Xml.Ns + "description", Description),
                        new XElement(Xml.Ns + "entranceCode", EntranceCode))));

            return signatureProvider.SignRequestXml(directoryRequestXmlMessage);
        }