/// <summary> /// Initializes a new instance of the <see cref="Address"/> class, resolving the given API Type /// </summary> /// <param name="fromType">From type.</param> public Address(customerAddressType fromType) { this.City = fromType.city; this.Company = fromType.company; this.Country = fromType.country; this.Last = fromType.lastName; this.First = fromType.firstName; this.Street = fromType.address; this.Fax = fromType.faxNumber; this.Phone = fromType.phoneNumber; this.Zip = fromType.zip; this.State = fromType.state; }
public static AuthorizeNet.APICore.customerAddressType MapAddressTypeToCustomerAddressType(this IAddressType request) { var result = new AuthorizeNet.APICore.customerAddressType(); result.address = String.Format("{0} {1}", request.AddressLine1, request.AddressLine2); result.city = request.City; result.country = request.Country; result.company = request.Company; result.state = request.State; result.zip = request.PostalCode; result.phoneNumber = request.PhoneNumber; return result; }
/// <summary> /// Creates an API type for use with outbound requests to the Gateway. Mostly for internal use. /// </summary> /// <returns></returns> public customerAddressType ToAPIType() { var result = new customerAddressType(); result.address = this.Street; result.city = this.City; result.company = this.Company; result.country = this.Country; result.faxNumber = this.Fax; result.firstName = this.First; result.lastName = this.Last; result.phoneNumber = this.Phone; result.state = this.State; result.zip = this.Zip; return result; }