示例#1
0
 // CreateCustomerPaymentProfile
 public static long CreateCustomerPaymentProfile(long profile_id, CreditCardInfo info)
 {
     LastError = String.Empty;
     CustomerProfileWS.CustomerPaymentProfileType new_payment_profile = new CustomerProfileWS.CustomerPaymentProfileType();
     CustomerProfileWS.PaymentType    new_payment = new CustomerProfileWS.PaymentType();
     CustomerProfileWS.CreditCardType new_card    = new CustomerProfileWS.CreditCardType();
     new_card.cardNumber         = info.CardNumber;
     new_card.expirationDate     = String.Format("{0:0000}-{1:00}", info.ExpirationYear, info.ExpirationMonth);
     new_card.cardCode           = info.CardCode;
     new_payment.Item            = new_card;
     new_payment_profile.payment = new_payment;
     CustomerProfileWS.CreateCustomerPaymentProfileResponseType response = SoapAPIUtilities.Service.CreateCustomerPaymentProfile(SoapAPIUtilities.MerchantAuthentication, profile_id, new_payment_profile, SoapAPIUtilities.IsTestingMode ? CustomerProfileWS.ValidationModeEnum.testMode : CustomerProfileWS.ValidationModeEnum.none);
     if (response.resultCode == Vauction.CustomerProfileWS.MessageTypeEnum.Error)
     {
         SetLastError(response.messages);
     }
     return(response.customerPaymentProfileId);
 }
示例#2
0
 // CreateCustomerShippingAddress
 public static long CreateCustomerShippingAddress(long profile_id, Address BillingAddress, string CountryTitle)
 {
     LastError = String.Empty;
     CustomerProfileWS.CustomerPaymentProfileType new_payment_profile = new CustomerProfileWS.CustomerPaymentProfileType();
     CustomerProfileWS.PaymentType         new_payment = new CustomerProfileWS.PaymentType();
     CustomerProfileWS.CustomerAddressType cat         = new CustomerProfileWS.CustomerAddressType();
     cat.firstName   = BillingAddress.FirstName;
     cat.lastName    = BillingAddress.LastName;
     cat.address     = String.Format("{0} {1}", BillingAddress.Address_1, (String.IsNullOrEmpty(BillingAddress.Address_2) ? "" : BillingAddress.Address_2));
     cat.city        = BillingAddress.City;
     cat.state       = BillingAddress.State;
     cat.zip         = BillingAddress.Zip;
     cat.country     = BillingAddress.Country;
     cat.phoneNumber = BillingAddress.HomePhone;
     cat.faxNumber   = BillingAddress.Fax;
     CustomerProfileWS.CreateCustomerShippingAddressResponseType response = SoapAPIUtilities.Service.CreateCustomerShippingAddress(SoapAPIUtilities.MerchantAuthentication, profile_id, cat);
     if (response.resultCode == Vauction.CustomerProfileWS.MessageTypeEnum.Error)
     {
         SetLastError(response.messages);
     }
     return(response.customerAddressId);
 }