/PayPalInvoiceSDK/Invoice/PayPalInvoiceModel.cs
C# | 8249 lines | 5894 code | 915 blank | 1440 comment | 839 complexity | 8779ac375f46d1b301ccc77378a52e23 MD5 | raw file
Possible License(s): BitTorrent-1.0
Large files files are truncated, but you can click here to view the full file
- /*
- * Stub objects for Invoice
- * AUTO_GENERATED_CODE
- */
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Globalization;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Web;
- using System.Xml;
- using PayPal.Util;
- namespace PayPal.Invoice.Model
- {
- /// <summary>
- /// Utility class for Enums with descriptions
- /// </summary>
- public static class EnumUtils
- {
- /// <summary>
- /// Get description for a give enum value
- /// </summary>
- public static string GetDescription(Enum value)
- {
- string description = "";
- DescriptionAttribute[] attributes = (DescriptionAttribute[])value.GetType().GetField(value.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false);
- if (attributes.Length > 0)
- {
- description= attributes[0].Description;
- }
- return description;
- }
-
- /// <summary>
- /// Convert a string to an enum object
- /// </summary>
- public static object GetValue(string value,Type enumType)
- {
- string[] names = Enum.GetNames(enumType);
- foreach(string name in names)
- {
- if (GetDescription((Enum)Enum.Parse(enumType, name)).Equals(value))
- {
- return Enum.Parse(enumType, name);
- }
- }
- return null;
- }
- }
- /// <summary>
- ///
- /// </summary>
- public partial class BaseAddress {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private string line1Field;
- public string line1
- {
- get
- {
- return this.line1Field;
- }
- set
- {
- this.line1Field = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string line2Field;
- public string line2
- {
- get
- {
- return this.line2Field;
- }
- set
- {
- this.line2Field = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string cityField;
- public string city
- {
- get
- {
- return this.cityField;
- }
- set
- {
- this.cityField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string stateField;
- public string state
- {
- get
- {
- return this.stateField;
- }
- set
- {
- this.stateField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string postalCodeField;
- public string postalCode
- {
- get
- {
- return this.postalCodeField;
- }
- set
- {
- this.postalCodeField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string countryCodeField;
- public string countryCode
- {
- get
- {
- return this.countryCodeField;
- }
- set
- {
- this.countryCodeField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string typeField;
- public string type
- {
- get
- {
- return this.typeField;
- }
- set
- {
- this.typeField = value;
- }
- }
-
- /// <summary>
- /// Constructor with arguments
- /// </summary>
- public BaseAddress(string line1, string city, string countryCode)
- {
- this.line1 = line1;
- this.city = city;
- this.countryCode = countryCode;
- }
- /// <summary>
- /// Default Constructor
- /// </summary>
- public BaseAddress()
- {
- }
- public string ToNVPString(string prefix)
- {
- StringBuilder sb = new StringBuilder();
- if (this.line1 != null)
- {
- sb.Append(prefix).Append("line1").Append("=").Append(HttpUtility.UrlEncode(this.line1, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.line2 != null)
- {
- sb.Append(prefix).Append("line2").Append("=").Append(HttpUtility.UrlEncode(this.line2, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.city != null)
- {
- sb.Append(prefix).Append("city").Append("=").Append(HttpUtility.UrlEncode(this.city, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.state != null)
- {
- sb.Append(prefix).Append("state").Append("=").Append(HttpUtility.UrlEncode(this.state, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.postalCode != null)
- {
- sb.Append(prefix).Append("postalCode").Append("=").Append(HttpUtility.UrlEncode(this.postalCode, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.countryCode != null)
- {
- sb.Append(prefix).Append("countryCode").Append("=").Append(HttpUtility.UrlEncode(this.countryCode, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.type != null)
- {
- sb.Append(prefix).Append("type").Append("=").Append(HttpUtility.UrlEncode(this.type, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- return sb.ToString();
- }
- /// <summary>
- /// Factory method for creating new object instances. For use by the de-serialization classes only.
- /// </summary>
- /// <param name="map">NVP map as returned by an API call</param>
- /// <param name="prefix">NVP prefix for this class in the response</param>
- /// <param name="index">For array elements, index of this element in the response</param>
- /// <returns>
- /// A new BaseAddress object created from the passed in NVP map
- /// </returns>
- public static BaseAddress CreateInstance(Dictionary<string, string> map, string prefix, int index)
- {
- BaseAddress baseAddress = null;
- string key;
- int i = 0;
- if(index != -1)
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + "(" + index + ").";
- }
- }
- else
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + ".";
- }
- }
- key = prefix + "line1";
- if (map.ContainsKey(key))
- {
- baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
- baseAddress.line1 = map[key];
- }
- key = prefix + "line2";
- if (map.ContainsKey(key))
- {
- baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
- baseAddress.line2 = map[key];
- }
- key = prefix + "city";
- if (map.ContainsKey(key))
- {
- baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
- baseAddress.city = map[key];
- }
- key = prefix + "state";
- if (map.ContainsKey(key))
- {
- baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
- baseAddress.state = map[key];
- }
- key = prefix + "postalCode";
- if (map.ContainsKey(key))
- {
- baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
- baseAddress.postalCode = map[key];
- }
- key = prefix + "countryCode";
- if (map.ContainsKey(key))
- {
- baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
- baseAddress.countryCode = map[key];
- }
- key = prefix + "type";
- if (map.ContainsKey(key))
- {
- baseAddress = (baseAddress == null) ? new BaseAddress() : baseAddress;
- baseAddress.type = map[key];
- }
- return baseAddress;
- }
- }
- /// <summary>
- /// This type contains the detailed error information resulting
- /// from the service operation.
- /// </summary>
- public partial class ErrorData {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private long? errorIdField;
- public long? errorId
- {
- get
- {
- return this.errorIdField;
- }
- set
- {
- this.errorIdField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string domainField;
- public string domain
- {
- get
- {
- return this.domainField;
- }
- set
- {
- this.domainField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string subdomainField;
- public string subdomain
- {
- get
- {
- return this.subdomainField;
- }
- set
- {
- this.subdomainField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private ErrorSeverity? severityField;
- public ErrorSeverity? severity
- {
- get
- {
- return this.severityField;
- }
- set
- {
- this.severityField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private ErrorCategory? categoryField;
- public ErrorCategory? category
- {
- get
- {
- return this.categoryField;
- }
- set
- {
- this.categoryField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string messageField;
- public string message
- {
- get
- {
- return this.messageField;
- }
- set
- {
- this.messageField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string exceptionIdField;
- public string exceptionId
- {
- get
- {
- return this.exceptionIdField;
- }
- set
- {
- this.exceptionIdField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private List<ErrorParameter> parameterField = new List<ErrorParameter>();
- public List<ErrorParameter> parameter
- {
- get
- {
- return this.parameterField;
- }
- set
- {
- this.parameterField = value;
- }
- }
-
- /// <summary>
- /// Default Constructor
- /// </summary>
- public ErrorData()
- {
- }
- /// <summary>
- /// Factory method for creating new object instances. For use by the de-serialization classes only.
- /// </summary>
- /// <param name="map">NVP map as returned by an API call</param>
- /// <param name="prefix">NVP prefix for this class in the response</param>
- /// <param name="index">For array elements, index of this element in the response</param>
- /// <returns>
- /// A new ErrorData object created from the passed in NVP map
- /// </returns>
- public static ErrorData CreateInstance(Dictionary<string, string> map, string prefix, int index)
- {
- ErrorData errorData = null;
- string key;
- int i = 0;
- if(index != -1)
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + "(" + index + ").";
- }
- }
- else
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + ".";
- }
- }
- key = prefix + "errorId";
- if (map.ContainsKey(key))
- {
- errorData = (errorData == null) ? new ErrorData() : errorData;
- errorData.errorId = System.Convert.ToInt64(map[key], DefaultCulture);
- }
- key = prefix + "domain";
- if (map.ContainsKey(key))
- {
- errorData = (errorData == null) ? new ErrorData() : errorData;
- errorData.domain = map[key];
- }
- key = prefix + "subdomain";
- if (map.ContainsKey(key))
- {
- errorData = (errorData == null) ? new ErrorData() : errorData;
- errorData.subdomain = map[key];
- }
- key = prefix + "severity";
- if (map.ContainsKey(key))
- {
- errorData = (errorData == null) ? new ErrorData() : errorData;
- errorData.severity = (ErrorSeverity)EnumUtils.GetValue(map[key],typeof(ErrorSeverity));
- }
- key = prefix + "category";
- if (map.ContainsKey(key))
- {
- errorData = (errorData == null) ? new ErrorData() : errorData;
- errorData.category = (ErrorCategory)EnumUtils.GetValue(map[key],typeof(ErrorCategory));
- }
- key = prefix + "message";
- if (map.ContainsKey(key))
- {
- errorData = (errorData == null) ? new ErrorData() : errorData;
- errorData.message = map[key];
- }
- key = prefix + "exceptionId";
- if (map.ContainsKey(key))
- {
- errorData = (errorData == null) ? new ErrorData() : errorData;
- errorData.exceptionId = map[key];
- }
- i = 0;
- while(true)
- {
- ErrorParameter parameter = ErrorParameter.CreateInstance(map, prefix + "parameter", i);
- if (parameter != null)
- {
- errorData = (errorData == null) ? new ErrorData() : errorData;
- errorData.parameter.Add(parameter);
- i++;
- }
- else
- {
- break;
- }
- }
- return errorData;
- }
- }
- /// <summary>
- ///
- /// </summary>
- public partial class ErrorParameter {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private string nameField;
- public string name
- {
- get
- {
- return this.nameField;
- }
- set
- {
- this.nameField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string valueField;
- public string value
- {
- get
- {
- return this.valueField;
- }
- set
- {
- this.valueField = value;
- }
- }
-
- /// <summary>
- /// Default Constructor
- /// </summary>
- public ErrorParameter()
- {
- }
- /// <summary>
- /// Factory method for creating new object instances. For use by the de-serialization classes only.
- /// </summary>
- /// <param name="map">NVP map as returned by an API call</param>
- /// <param name="prefix">NVP prefix for this class in the response</param>
- /// <param name="index">For array elements, index of this element in the response</param>
- /// <returns>
- /// A new ErrorParameter object created from the passed in NVP map
- /// </returns>
- public static ErrorParameter CreateInstance(Dictionary<string, string> map, string prefix, int index)
- {
- ErrorParameter errorParameter = null;
- string key;
- int i = 0;
- if(index != -1)
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + "(" + index + ").";
- }
- }
- else
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + ".";
- }
- }
- key = prefix + "name";
- if (map.ContainsKey(key))
- {
- errorParameter = (errorParameter == null) ? new ErrorParameter() : errorParameter;
- errorParameter.name = map[key];
- }
- key = prefix.Substring(0, prefix.Length - 1);
- if (map.ContainsKey(key))
- {
- errorParameter = (errorParameter == null) ? new ErrorParameter() : errorParameter;
- errorParameter.value = map[key];
- }
- return errorParameter;
- }
- }
- /// <summary>
- /// This specifies a fault, encapsulating error data, with
- /// specific error codes.
- /// </summary>
- public partial class FaultMessage {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private ResponseEnvelope responseEnvelopeField;
- public ResponseEnvelope responseEnvelope
- {
- get
- {
- return this.responseEnvelopeField;
- }
- set
- {
- this.responseEnvelopeField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private List<ErrorData> errorField = new List<ErrorData>();
- public List<ErrorData> error
- {
- get
- {
- return this.errorField;
- }
- set
- {
- this.errorField = value;
- }
- }
-
- /// <summary>
- /// Default Constructor
- /// </summary>
- public FaultMessage()
- {
- }
- /// <summary>
- /// Factory method for creating new object instances. For use by the de-serialization classes only.
- /// </summary>
- /// <param name="map">NVP map as returned by an API call</param>
- /// <param name="prefix">NVP prefix for this class in the response</param>
- /// <param name="index">For array elements, index of this element in the response</param>
- /// <returns>
- /// A new FaultMessage object created from the passed in NVP map
- /// </returns>
- public static FaultMessage CreateInstance(Dictionary<string, string> map, string prefix, int index)
- {
- FaultMessage faultMessage = null;
- string key;
- int i = 0;
- if(index != -1)
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + "(" + index + ").";
- }
- }
- else
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + ".";
- }
- }
- ResponseEnvelope responseEnvelope = ResponseEnvelope.CreateInstance(map, prefix + "responseEnvelope", -1);
- if (responseEnvelope != null)
- {
- faultMessage = (faultMessage == null) ? new FaultMessage() : faultMessage;
- faultMessage.responseEnvelope = responseEnvelope;
- }
- i = 0;
- while(true)
- {
- ErrorData error = ErrorData.CreateInstance(map, prefix + "error", i);
- if (error != null)
- {
- faultMessage = (faultMessage == null) ? new FaultMessage() : faultMessage;
- faultMessage.error.Add(error);
- i++;
- }
- else
- {
- break;
- }
- }
- return faultMessage;
- }
- }
- /// <summary>
- /// This specifies the list of parameters with every request to
- /// the service.
- /// </summary>
- public partial class RequestEnvelope {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private DetailLevelCode? detailLevelField;
- public DetailLevelCode? detailLevel
- {
- get
- {
- return this.detailLevelField;
- }
- set
- {
- this.detailLevelField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string errorLanguageField;
- public string errorLanguage
- {
- get
- {
- return this.errorLanguageField;
- }
- set
- {
- this.errorLanguageField = value;
- }
- }
-
- /// <summary>
- /// Default Constructor
- /// </summary>
- public RequestEnvelope()
- {
- }
- public string ToNVPString(string prefix)
- {
- StringBuilder sb = new StringBuilder();
- if (this.detailLevel != null)
- {
- sb.Append(prefix).Append("detailLevel").Append("=").Append(EnumUtils.GetDescription(this.detailLevel));
- sb.Append("&");
- }
- if (this.errorLanguage != null)
- {
- sb.Append(prefix).Append("errorLanguage").Append("=").Append(HttpUtility.UrlEncode(this.errorLanguage, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- return sb.ToString();
- }
- }
- /// <summary>
- /// This specifies a list of parameters with every response from
- /// a service.
- /// </summary>
- public partial class ResponseEnvelope {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private string timestampField;
- public string timestamp
- {
- get
- {
- return this.timestampField;
- }
- set
- {
- this.timestampField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private AckCode? ackField;
- public AckCode? ack
- {
- get
- {
- return this.ackField;
- }
- set
- {
- this.ackField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string correlationIdField;
- public string correlationId
- {
- get
- {
- return this.correlationIdField;
- }
- set
- {
- this.correlationIdField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string buildField;
- public string build
- {
- get
- {
- return this.buildField;
- }
- set
- {
- this.buildField = value;
- }
- }
-
- /// <summary>
- /// Default Constructor
- /// </summary>
- public ResponseEnvelope()
- {
- }
- /// <summary>
- /// Factory method for creating new object instances. For use by the de-serialization classes only.
- /// </summary>
- /// <param name="map">NVP map as returned by an API call</param>
- /// <param name="prefix">NVP prefix for this class in the response</param>
- /// <param name="index">For array elements, index of this element in the response</param>
- /// <returns>
- /// A new ResponseEnvelope object created from the passed in NVP map
- /// </returns>
- public static ResponseEnvelope CreateInstance(Dictionary<string, string> map, string prefix, int index)
- {
- ResponseEnvelope responseEnvelope = null;
- string key;
- int i = 0;
- if(index != -1)
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + "(" + index + ").";
- }
- }
- else
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + ".";
- }
- }
- key = prefix + "timestamp";
- if (map.ContainsKey(key))
- {
- responseEnvelope = (responseEnvelope == null) ? new ResponseEnvelope() : responseEnvelope;
- responseEnvelope.timestamp = map[key];
- }
- key = prefix + "ack";
- if (map.ContainsKey(key))
- {
- responseEnvelope = (responseEnvelope == null) ? new ResponseEnvelope() : responseEnvelope;
- responseEnvelope.ack = (AckCode)EnumUtils.GetValue(map[key],typeof(AckCode));
- }
- key = prefix + "correlationId";
- if (map.ContainsKey(key))
- {
- responseEnvelope = (responseEnvelope == null) ? new ResponseEnvelope() : responseEnvelope;
- responseEnvelope.correlationId = map[key];
- }
- key = prefix + "build";
- if (map.ContainsKey(key))
- {
- responseEnvelope = (responseEnvelope == null) ? new ResponseEnvelope() : responseEnvelope;
- responseEnvelope.build = map[key];
- }
- return responseEnvelope;
- }
- }
- /// <summary>
- /// AckCodeType This code identifies the
- /// acknowledgment code types that could be used to
- /// communicate the status of processing a (request)
- /// message to an application. This code would be
- /// used as part of a response message that contains
- /// an application level acknowledgment element.
- ///
- /// </summary>
- [Serializable]
- public enum AckCode {
- [Description("Success")]SUCCESS,
- [Description("Failure")]FAILURE,
- [Description("Warning")]WARNING,
- [Description("SuccessWithWarning")]SUCCESSWITHWARNING,
- [Description("FailureWithWarning")]FAILUREWITHWARNING
- }
- /// <summary>
- /// DetailLevelCodeType
- ///
- /// </summary>
- [Serializable]
- public enum DetailLevelCode {
- [Description("ReturnAll")]RETURNALL
- }
- /// <summary>
- ///
- /// </summary>
- [Serializable]
- public enum ErrorCategory {
- [Description("System")]SYSTEM,
- [Description("Application")]APPLICATION,
- [Description("Request")]REQUEST
- }
- /// <summary>
- ///
- /// </summary>
- [Serializable]
- public enum ErrorSeverity {
- [Description("Error")]ERROR,
- [Description("Warning")]WARNING
- }
- /// <summary>
- /// Specifies the payment terms for this invoice.
- ///
- /// </summary>
- [Serializable]
- public enum PaymentTermsType {
- [Description("NoDueDate")]NODUEDATE,
- [Description("DueOnReceipt")]DUEONRECEIPT,
- [Description("DueOnDateSpecified")]DUEONDATESPECIFIED,
- [Description("Net10")]NET1,
- [Description("Net15")]NET2,
- [Description("Net30")]NET3,
- [Description("Net45")]NET4
- }
- /// <summary>
- /// Specifies the payment methods that can be used to mark an
- /// invoice as paid.
- ///
- /// </summary>
- [Serializable]
- public enum PaymentMethodsType {
- [Description("BankTransfer")]BANKTRANSFER,
- [Description("Cash")]CASH,
- [Description("Check")]CHECK,
- [Description("CreditCard")]CREDITCARD,
- [Description("DebitCard")]DEBITCARD,
- [Description("Other")]OTHER,
- [Description("PayPal")]PAYPAL,
- [Description("WireTransfer")]WIRETRANSFER
- }
- /// <summary>
- /// Specifies the invoice status.
- ///
- /// </summary>
- [Serializable]
- public enum StatusType {
- [Description("Draft")]DRAFT,
- [Description("Sent")]SENT,
- [Description("Paid")]PAID,
- [Description("MarkedAsPaid")]MARKEDASPAID,
- [Description("Canceled")]CANCELED,
- [Description("Refunded")]REFUNDED,
- [Description("PartiallyRefunded")]PARTIALLYREFUNDED,
- [Description("MarkedAsRefunded")]MARKEDASREFUNDED
- }
- /// <summary>
- /// Specifies the merchant or payer.
- ///
- /// </summary>
- [Serializable]
- public enum OriginType {
- [Description("Web")]WEB,
- [Description("API")]API
- }
- /// <summary>
- /// Specifies the merchant or payer.
- ///
- /// </summary>
- [Serializable]
- public enum ActorType {
- [Description("Merchant")]MERCHANT,
- [Description("Payer")]PAYER
- }
- /// <summary>
- /// Contact information for a company participating in the
- /// invoicing system.
- /// </summary>
- public partial class BusinessInfoType {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private string firstNameField;
- public string firstName
- {
- get
- {
- return this.firstNameField;
- }
- set
- {
- this.firstNameField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string lastNameField;
- public string lastName
- {
- get
- {
- return this.lastNameField;
- }
- set
- {
- this.lastNameField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string businessNameField;
- public string businessName
- {
- get
- {
- return this.businessNameField;
- }
- set
- {
- this.businessNameField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string phoneField;
- public string phone
- {
- get
- {
- return this.phoneField;
- }
- set
- {
- this.phoneField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string faxField;
- public string fax
- {
- get
- {
- return this.faxField;
- }
- set
- {
- this.faxField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string websiteField;
- public string website
- {
- get
- {
- return this.websiteField;
- }
- set
- {
- this.websiteField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string languageField;
- public string language
- {
- get
- {
- return this.languageField;
- }
- set
- {
- this.languageField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string taxIdField;
- public string taxId
- {
- get
- {
- return this.taxIdField;
- }
- set
- {
- this.taxIdField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string customValueField;
- public string customValue
- {
- get
- {
- return this.customValueField;
- }
- set
- {
- this.customValueField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private BaseAddress addressField;
- public BaseAddress address
- {
- get
- {
- return this.addressField;
- }
- set
- {
- this.addressField = value;
- }
- }
-
- /// <summary>
- /// Default Constructor
- /// </summary>
- public BusinessInfoType()
- {
- }
- public string ToNVPString(string prefix)
- {
- StringBuilder sb = new StringBuilder();
- if (this.firstName != null)
- {
- sb.Append(prefix).Append("firstName").Append("=").Append(HttpUtility.UrlEncode(this.firstName, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.lastName != null)
- {
- sb.Append(prefix).Append("lastName").Append("=").Append(HttpUtility.UrlEncode(this.lastName, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.businessName != null)
- {
- sb.Append(prefix).Append("businessName").Append("=").Append(HttpUtility.UrlEncode(this.businessName, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.phone != null)
- {
- sb.Append(prefix).Append("phone").Append("=").Append(HttpUtility.UrlEncode(this.phone, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.fax != null)
- {
- sb.Append(prefix).Append("fax").Append("=").Append(HttpUtility.UrlEncode(this.fax, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.website != null)
- {
- sb.Append(prefix).Append("website").Append("=").Append(HttpUtility.UrlEncode(this.website, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.language != null)
- {
- sb.Append(prefix).Append("language").Append("=").Append(HttpUtility.UrlEncode(this.language, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.taxId != null)
- {
- sb.Append(prefix).Append("taxId").Append("=").Append(HttpUtility.UrlEncode(this.taxId, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.customValue != null)
- {
- sb.Append(prefix).Append("customValue").Append("=").Append(HttpUtility.UrlEncode(this.customValue, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.address != null)
- {
- string newPrefix = prefix + "address" + ".";
- sb.Append(this.addressField.ToNVPString(newPrefix));
- }
- return sb.ToString();
- }
- /// <summary>
- /// Factory method for creating new object instances. For use by the de-serialization classes only.
- /// </summary>
- /// <param name="map">NVP map as returned by an API call</param>
- /// <param name="prefix">NVP prefix for this class in the response</param>
- /// <param name="index">For array elements, index of this element in the response</param>
- /// <returns>
- /// A new BusinessInfoType object created from the passed in NVP map
- /// </returns>
- public static BusinessInfoType CreateInstance(Dictionary<string, string> map, string prefix, int index)
- {
- BusinessInfoType businessInfoType = null;
- string key;
- int i = 0;
- if(index != -1)
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + "(" + index + ").";
- }
- }
- else
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + ".";
- }
- }
- key = prefix + "firstName";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.firstName = map[key];
- }
- key = prefix + "lastName";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.lastName = map[key];
- }
- key = prefix + "businessName";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.businessName = map[key];
- }
- key = prefix + "phone";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.phone = map[key];
- }
- key = prefix + "fax";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.fax = map[key];
- }
- key = prefix + "website";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.website = map[key];
- }
- key = prefix + "language";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.language = map[key];
- }
- key = prefix + "taxId";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.taxId = map[key];
- }
- key = prefix + "customValue";
- if (map.ContainsKey(key))
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.customValue = map[key];
- }
- BaseAddress address = BaseAddress.CreateInstance(map, prefix + "address", -1);
- if (address != null)
- {
- businessInfoType = (businessInfoType == null) ? new BusinessInfoType() : businessInfoType;
- businessInfoType.address = address;
- }
- return businessInfoType;
- }
- }
- /// <summary>
- /// Item information about a service or product listed in the
- /// invoice.
- /// </summary>
- public partial class InvoiceItemType {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private string nameField;
- public string name
- {
- get
- {
- return this.nameField;
- }
- set
- {
- this.nameField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string descriptionField;
- public string description
- {
- get
- {
- return this.descriptionField;
- }
- set
- {
- this.descriptionField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string dateField;
- public string date
- {
- get
- {
- return this.dateField;
- }
- set
- {
- this.dateField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? quantityField;
- public decimal? quantity
- {
- get
- {
- return this.quantityField;
- }
- set
- {
- this.quantityField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? unitPriceField;
- public decimal? unitPrice
- {
- get
- {
- return this.unitPriceField;
- }
- set
- {
- this.unitPriceField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? discountPercentField;
- public decimal? discountPercent
- {
- get
- {
- return this.discountPercentField;
- }
- set
- {
- this.discountPercentField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? discountAmountField;
- public decimal? discountAmount
- {
- get
- {
- return this.discountAmountField;
- }
- set
- {
- this.discountAmountField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string taxNameField;
- public string taxName
- {
- get
- {
- return this.taxNameField;
- }
- set
- {
- this.taxNameField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? taxRateField;
- public decimal? taxRate
- {
- get
- {
- return this.taxRateField;
- }
- set
- {
- this.taxRateField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? taxAmountField;
- public decimal? taxAmount
- {
- get
- {
- return this.taxAmountField;
- }
- set
- {
- this.taxAmountField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string imageUrlField;
- public string imageUrl
- {
- get
- {
- return this.imageUrlField;
- }
- set
- {
- this.imageUrlField = value;
- }
- }
-
- /// <summary>
- /// Constructor with arguments
- /// </summary>
- public InvoiceItemType(string name, decimal? quantity, decimal? unitPrice)
- {
- this.name = name;
- this.quantity = quantity;
- this.unitPrice = unitPrice;
- }
- /// <summary>
- /// Default Constructor
- /// </summary>
- public InvoiceItemType()
- {
- }
- public string ToNVPString(string prefix)
- {
- StringBuilder sb = new StringBuilder();
- if (this.name != null)
- {
- sb.Append(prefix).Append("name").Append("=").Append(HttpUtility.UrlEncode(this.name, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.description != null)
- {
- sb.Append(prefix).Append("description").Append("=").Append(HttpUtility.UrlEncode(this.description, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.date != null)
- {
- sb.Append(prefix).Append("date").Append("=").Append(HttpUtility.UrlEncode(this.date, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.quantity != null)
- {
- sb.Append(prefix).Append("quantity").Append("=").Append(Convert.ToString(this.quantity, DefaultCulture)).Append("&");
- }
- if (this.unitPrice != null)
- {
- sb.Append(prefix).Append("unitPrice").Append("=").Append(Convert.ToString(this.unitPrice, DefaultCulture)).Append("&");
- }
- if (this.discountPercent != null)
- {
- sb.Append(prefix).Append("discountPercent").Append("=").Append(Convert.ToString(this.discountPercent, DefaultCulture)).Append("&");
- }
- if (this.discountAmount != null)
- {
- sb.Append(prefix).Append("discountAmount").Append("=").Append(Convert.ToString(this.discountAmount, DefaultCulture)).Append("&");
- }
- if (this.taxName != null)
- {
- sb.Append(prefix).Append("taxName").Append("=").Append(HttpUtility.UrlEncode(this.taxName, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.taxRate != null)
- {
- sb.Append(prefix).Append("taxRate").Append("=").Append(Convert.ToString(this.taxRate, DefaultCulture)).Append("&");
- }
- if (this.taxAmount != null)
- {
- sb.Append(prefix).Append("taxAmount").Append("=").Append(Convert.ToString(this.taxAmount, DefaultCulture)).Append("&");
- }
- if (this.imageUrl != null)
- {
- sb.Append(prefix).Append("imageUrl").Append("=").Append(HttpUtility.UrlEncode(this.imageUrl, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- return sb.ToString();
- }
- /// <summary>
- /// Factory method for creating new object instances. For use by the de-serialization classes only.
- /// </summary>
- /// <param name="map">NVP map as returned by an API call</param>
- /// <param name="prefix">NVP prefix for this class in the response</param>
- /// <param name="index">For array elements, index of this element in the response</param>
- /// <returns>
- /// A new InvoiceItemType object created from the passed in NVP map
- /// </returns>
- public static InvoiceItemType CreateInstance(Dictionary<string, string> map, string prefix, int index)
- {
- InvoiceItemType invoiceItemType = null;
- string key;
- int i = 0;
- if(index != -1)
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + "(" + index + ").";
- }
- }
- else
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + ".";
- }
- }
- key = prefix + "name";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.name = map[key];
- }
- key = prefix + "description";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.description = map[key];
- }
- key = prefix + "date";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.date = map[key];
- }
- key = prefix + "quantity";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.quantity = System.Convert.ToDecimal(map[key], DefaultCulture);
- }
- key = prefix + "unitPrice";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.unitPrice = System.Convert.ToDecimal(map[key], DefaultCulture);
- }
- key = prefix + "discountPercent";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.discountPercent = System.Convert.ToDecimal(map[key], DefaultCulture);
- }
- key = prefix + "discountAmount";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.discountAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
- }
- key = prefix + "taxName";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.taxName = map[key];
- }
- key = prefix + "taxRate";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.taxRate = System.Convert.ToDecimal(map[key], DefaultCulture);
- }
- key = prefix + "taxAmount";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.taxAmount = System.Convert.ToDecimal(map[key], DefaultCulture);
- }
- key = prefix + "imageUrl";
- if (map.ContainsKey(key))
- {
- invoiceItemType = (invoiceItemType == null) ? new InvoiceItemType() : invoiceItemType;
- invoiceItemType.imageUrl = map[key];
- }
- return invoiceItemType;
- }
- }
- /// <summary>
- /// A list of invoice items.
- /// </summary>
- public partial class InvoiceItemListType {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private List<InvoiceItemType> itemField = new List<InvoiceItemType>();
- public List<InvoiceItemType> item
- {
- get
- {
- return this.itemField;
- }
- set
- {
- this.itemField = value;
- }
- }
-
- /// <summary>
- /// Constructor with arguments
- /// </summary>
- public InvoiceItemListType(List<InvoiceItemType> item)
- {
- this.item = item;
- }
- /// <summary>
- /// Default Constructor
- /// </summary>
- public InvoiceItemListType()
- {
- }
- public string ToNVPString(string prefix)
- {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < this.item.Count; i++)
- {
- if (this.item[i] != null)
- {
- string newPrefix = prefix + "item" + "(" + i + ").";
- sb.Append(this.item[i].ToNVPString(newPrefix));
- }
- }
- return sb.ToString();
- }
- /// <summary>
- /// Factory method for creating new object instances. For use by the de-serialization classes only.
- /// </summary>
- /// <param name="map">NVP map as returned by an API call</param>
- /// <param name="prefix">NVP prefix for this class in the response</param>
- /// <param name="index">For array elements, index of this element in the response</param>
- /// <returns>
- /// A new InvoiceItemListType object created from the passed in NVP map
- /// </returns>
- public static InvoiceItemListType CreateInstance(Dictionary<string, string> map, string prefix, int index)
- {
- InvoiceItemListType invoiceItemListType = null;
- string key;
- int i = 0;
- if(index != -1)
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + "(" + index + ").";
- }
- }
- else
- {
- if (prefix.Length > 0 && !prefix.EndsWith("."))
- {
- prefix = prefix + ".";
- }
- }
- i = 0;
- while(true)
- {
- InvoiceItemType item = InvoiceItemType.CreateInstance(map, prefix + "item", i);
- if (item != null)
- {
- invoiceItemListType = (invoiceItemListType == null) ? new InvoiceItemListType() : invoiceItemListType;
- invoiceItemListType.item.Add(item);
- i++;
- }
- else
- {
- break;
- }
- }
- return invoiceItemListType;
- }
- }
- /// <summary>
- /// Invoice details about the merchant, payer, totals and terms.
- ///
- /// </summary>
- public partial class InvoiceType {
-
- // Default US culture info
- private static CultureInfo DefaultCulture = new CultureInfo("en-US");
- /// <summary>
- ///
- /// </summary>
- private string merchantEmailField;
- public string merchantEmail
- {
- get
- {
- return this.merchantEmailField;
- }
- set
- {
- this.merchantEmailField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string payerEmailField;
- public string payerEmail
- {
- get
- {
- return this.payerEmailField;
- }
- set
- {
- this.payerEmailField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string numberField;
- public string number
- {
- get
- {
- return this.numberField;
- }
- set
- {
- this.numberField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private BusinessInfoType merchantInfoField;
- public BusinessInfoType merchantInfo
- {
- get
- {
- return this.merchantInfoField;
- }
- set
- {
- this.merchantInfoField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private InvoiceItemListType itemListField;
- public InvoiceItemListType itemList
- {
- get
- {
- return this.itemListField;
- }
- set
- {
- this.itemListField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private bool? taxCalculatedAfterDiscountField;
- public bool? taxCalculatedAfterDiscount
- {
- get
- {
- return this.taxCalculatedAfterDiscountField;
- }
- set
- {
- this.taxCalculatedAfterDiscountField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string currencyCodeField;
- public string currencyCode
- {
- get
- {
- return this.currencyCodeField;
- }
- set
- {
- this.currencyCodeField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string invoiceDateField;
- public string invoiceDate
- {
- get
- {
- return this.invoiceDateField;
- }
- set
- {
- this.invoiceDateField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string dueDateField;
- public string dueDate
- {
- get
- {
- return this.dueDateField;
- }
- set
- {
- this.dueDateField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private PaymentTermsType? paymentTermsField;
- public PaymentTermsType? paymentTerms
- {
- get
- {
- return this.paymentTermsField;
- }
- set
- {
- this.paymentTermsField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? discountPercentField;
- public decimal? discountPercent
- {
- get
- {
- return this.discountPercentField;
- }
- set
- {
- this.discountPercentField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? discountAmountField;
- public decimal? discountAmount
- {
- get
- {
- return this.discountAmountField;
- }
- set
- {
- this.discountAmountField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? totalItemDiscountAmountField;
- public decimal? totalItemDiscountAmount
- {
- get
- {
- return this.totalItemDiscountAmountField;
- }
- set
- {
- this.totalItemDiscountAmountField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private bool? taxInclusiveField;
- public bool? taxInclusive
- {
- get
- {
- return this.taxInclusiveField;
- }
- set
- {
- this.taxInclusiveField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string termsField;
- public string terms
- {
- get
- {
- return this.termsField;
- }
- set
- {
- this.termsField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string noteField;
- public string note
- {
- get
- {
- return this.noteField;
- }
- set
- {
- this.noteField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string merchantMemoField;
- public string merchantMemo
- {
- get
- {
- return this.merchantMemoField;
- }
- set
- {
- this.merchantMemoField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string receiptDetailsField;
- public string receiptDetails
- {
- get
- {
- return this.receiptDetailsField;
- }
- set
- {
- this.receiptDetailsField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private BusinessInfoType billingInfoField;
- public BusinessInfoType billingInfo
- {
- get
- {
- return this.billingInfoField;
- }
- set
- {
- this.billingInfoField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private BusinessInfoType shippingInfoField;
- public BusinessInfoType shippingInfo
- {
- get
- {
- return this.shippingInfoField;
- }
- set
- {
- this.shippingInfoField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? shippingAmountField;
- public decimal? shippingAmount
- {
- get
- {
- return this.shippingAmountField;
- }
- set
- {
- this.shippingAmountField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string shippingTaxNameField;
- public string shippingTaxName
- {
- get
- {
- return this.shippingTaxNameField;
- }
- set
- {
- this.shippingTaxNameField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? shippingTaxRateField;
- public decimal? shippingTaxRate
- {
- get
- {
- return this.shippingTaxRateField;
- }
- set
- {
- this.shippingTaxRateField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? shippingTaxAmountField;
- public decimal? shippingTaxAmount
- {
- get
- {
- return this.shippingTaxAmountField;
- }
- set
- {
- this.shippingTaxAmountField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string logoUrlField;
- public string logoUrl
- {
- get
- {
- return this.logoUrlField;
- }
- set
- {
- this.logoUrlField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string referrerCodeField;
- public string referrerCode
- {
- get
- {
- return this.referrerCodeField;
- }
- set
- {
- this.referrerCodeField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private string customAmountLabelField;
- public string customAmountLabel
- {
- get
- {
- return this.customAmountLabelField;
- }
- set
- {
- this.customAmountLabelField = value;
- }
- }
-
- /// <summary>
- ///
- /// </summary>
- private decimal? customAmountValueField;
- public decimal? customAmountValue
- {
- get
- {
- return this.customAmountValueField;
- }
- set
- {
- this.customAmountValueField = value;
- }
- }
-
- /// <summary>
- /// Constructor with arguments
- /// </summary>
- public InvoiceType(string merchantEmail, string payerEmail, InvoiceItemListType itemList, string currencyCode)
- {
- this.merchantEmail = merchantEmail;
- this.payerEmail = payerEmail;
- this.itemList = itemList;
- this.currencyCode = currencyCode;
- }
- /// <summary>
- /// Default Constructor
- /// </summary>
- public InvoiceType()
- {
- }
- public string ToNVPString(string prefix)
- {
- StringBuilder sb = new StringBuilder();
- if (this.merchantEmail != null)
- {
- sb.Append(prefix).Append("merchantEmail").Append("=").Append(HttpUtility.UrlEncode(this.merchantEmail, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.payerEmail != null)
- {
- sb.Append(prefix).Append("payerEmail").Append("=").Append(HttpUtility.UrlEncode(this.payerEmail, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.number != null)
- {
- sb.Append(prefix).Append("number").Append("=").Append(HttpUtility.UrlEncode(this.number, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.merchantInfo != null)
- {
- string newPrefix = prefix + "merchantInfo" + ".";
- sb.Append(this.merchantInfoField.ToNVPString(newPrefix));
- }
- if (this.itemList != null)
- {
- string newPrefix = prefix + "itemList" + ".";
- sb.Append(this.itemListField.ToNVPString(newPrefix));
- }
- if (this.taxCalculatedAfterDiscount != null)
- {
- sb.Append(prefix).Append("taxCalculatedAfterDiscount").Append("=").Append(Convert.ToString(this.taxCalculatedAfterDiscount, DefaultCulture)).Append("&");
- }
- if (this.currencyCode != null)
- {
- sb.Append(prefix).Append("currencyCode").Append("=").Append(HttpUtility.UrlEncode(this.currencyCode, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.invoiceDate != null)
- {
- sb.Append(prefix).Append("invoiceDate").Append("=").Append(HttpUtility.UrlEncode(this.invoiceDate, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.dueDate != null)
- {
- sb.Append(prefix).Append("dueDate").Append("=").Append(HttpUtility.UrlEncode(this.dueDate, BaseConstants.ENCODING_FORMAT)).Append("&");
- }
- if (this.paymentTerms != null)
- {
- sb.Append(prefix)…
Large files files are truncated, but you can click here to view the full file