public virtual void AddToStringBuilder(StringBuilder sb)
 {
     foreach (var pair in _extraData)
     {
         PartsHelper.AddString(sb, pair.Key, pair.Value);
     }
 }
        public void AddToStringBuilder(StringBuilder sb)
        {
            sb.Append("<PAYMENT>");

            PartsHelper.AddString(sb, ProfileToken, "PROFILETOKEN", 40);
            PartsHelper.AddNullableLong(sb, PaymentProductId, "PAYMENTPRODUCTID");
            PartsHelper.AddNullableLong(sb, Amount, "AMOUNT");
            PartsHelper.AddString(sb, CurrencyCode, "CURRENCYCODE", 3);
            PartsHelper.AddString(sb, LanguageCode, "LANGUAGECODE", 2);
            PartsHelper.AddString(sb, CountryCode, "COUNTRYCODE", 2);
            PartsHelper.AddString(sb, ReturnUrl, "RETURNURL", 512);
            PartsHelper.AddNullableInt(sb, DateCollect, "DATECOLLECT");
            PartsHelper.AddNullableLong(sb, OrderId, "ORDERID");
            PartsHelper.AddNullableInt(sb, EffortId, "EFFORTID");
            PartsHelper.AddNullableInt(sb, AttemptId, "ATTEMPTID");
            PartsHelper.AddString(sb, MerchantReference, "MERCHANTREFERENCE", 30);

            if (UseAuthenticationIndicator)
            {
                PartsHelper.AddString(sb, "1", "AUTHENTICATIONINDICATOR");
            }

            _extraData.AddToStringBuilder(sb);

            sb.Append("</PAYMENT>");
        }
        public void AddToStringBuilder(StringBuilder sb)
        {
            sb.Append("<META>");

            PartsHelper.AddLong(sb, MerchantId, "MERCHANTID");
            PartsHelper.AddString(sb, IpAddress, "IPADDRESS", 32);
            PartsHelper.AddString(sb, Version, "VERSION", 10);

            sb.Append("</META>");
        }
        public void AddToStringBuilder(StringBuilder sb)
        {
            sb.Append("<GENERAL>");

            PartsHelper.AddNullableLong(sb, PaymentProductId, "PAYMENTPRODUCTID");
            PartsHelper.AddString(sb, CountryCode, "COUNTRYCODE", 2);
            PartsHelper.AddString(sb, CurrencyCode, "CURRENCYCODE", 3);
            PartsHelper.AddString(sb, LanguageCode, "LANGUAGECODE", 2);

            sb.Append("</GENERAL>");
        }
Beispiel #5
0
        public void AddToStringBuilder(StringBuilder sb)
        {
            sb.Append("<ORDER>");

            PartsHelper.AddNullableLong(sb, OrderId, "ORDERID");
            PartsHelper.AddNullableLong(sb, MerchantOrderId, "MERCHANTORDERID");
            PartsHelper.AddNullableLong(sb, Amount, "AMOUNT");
            PartsHelper.AddString(sb, CurrencyCode, "CURRENCYCODE", 3);
            PartsHelper.AddString(sb, LanguageCode, "LANGUAGECODE", 2);
            PartsHelper.AddString(sb, CountryCode, "COUNTRYCODE", 2);
            PartsHelper.AddString(sb, MerchantReference, "MERCHANTREFERENCE");

            if (BillingAddress != null)
            {
                PartsHelper.AddString(sb, BillingAddress.FirstName, "FIRSTNAME", 15);
                PartsHelper.AddString(sb, BillingAddress.LastName, "SURNAME", 35);
                PartsHelper.AddString(sb, BillingAddress.PhoneNumber, "PHONENUMBER", 20);
                PartsHelper.AddString(sb, BillingAddress.StreetLine1, "STREET", 50);
                PartsHelper.AddString(sb, BillingAddress.StreetLine2, "ADDITIONALADDRESSINFO", 50);
                PartsHelper.AddString(sb, BillingAddress.City, "CITY", 40);
                PartsHelper.AddString(sb, BillingAddress.IpAddress, "IPADDRESSCUSTOMER", 32);
                PartsHelper.AddString(sb, BillingAddress.Email, "EMAIL", 70);
                PartsHelper.AddString(sb, BillingAddress.Zip, "ZIP", 9);
                PartsHelper.AddString(sb, BillingAddress.State, "STATE", 35);
                PartsHelper.AddString(sb, BillingAddress.CompanyName, "COMPANYNAME", 40);
            }

            if (ShippingAddress != null)
            {
                PartsHelper.AddString(sb, ShippingAddress.FirstName, "SHIPPINGFIRSTNAME", 15);
                PartsHelper.AddString(sb, ShippingAddress.LastName, "SHIPPINGSURNAME", 35);
                PartsHelper.AddString(sb, ShippingAddress.StreetLine1, "SHIPPINGSTREET", 50);
                PartsHelper.AddString(sb, ShippingAddress.StreetLine2, "SHIPPINGADDITIONALADDRESSINFO", 50);
                PartsHelper.AddString(sb, ShippingAddress.City, "SHIPPINGCITY", 40);
                PartsHelper.AddString(sb, ShippingAddress.CountryCode, "SHIPPINGCOUNTRYCODE", 2);
                PartsHelper.AddString(sb, ShippingAddress.Zip, "SHIPPINGZIP", 10);
                PartsHelper.AddString(sb, ShippingAddress.State, "SHIPPINGSTATE", 35);
                PartsHelper.AddString(sb, ShippingAddress.CompanyName, "SHIPPINGCOMPANYNAME", 40);                 // ?? This is not found in the specifications. :-S
            }

            _extraData.AddToStringBuilder(sb);

            sb.Append("</ORDER>");
        }
 public void AddToStringBuilder(StringBuilder sb)
 {
     PartsHelper.AddString(sb, Name, "ACTION");
 }