예제 #1
0
        /// <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;
        }
예제 #2
0
 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;
     
 }
예제 #3
0
 /// <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;
 }