Exemple #1
0
 //UpdateCustomerPaymentProfile
 public static bool UpdateCustomerPaymentProfile(long profile_id, long payment_profile_id, CreditCardInfo info, string FirstName, string LastName)
 {
     LastError = String.Empty;
     CustomerProfileWS.CustomerPaymentProfileExType new_payment_profile = new CustomerProfileWS.CustomerPaymentProfileExType();
     new_payment_profile.customerPaymentProfileId = payment_profile_id;
     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.billTo           = new CustomerProfileWS.CustomerAddressType();
     new_payment_profile.billTo.firstName = FirstName;
     new_payment_profile.billTo.lastName  = LastName;
     new_payment_profile.billTo.address   = String.Format("{0} {1}", info.Address1, (String.IsNullOrEmpty(info.Address2) ? "" : info.Address2));
     new_payment_profile.billTo.city      = info.City;
     new_payment_profile.billTo.state     = info.State;
     new_payment_profile.billTo.zip       = info.Zip;
     new_payment_profile.billTo.country   = info.CountryTitle;
     new_payment_profile.payment          = new_payment;
     CustomerProfileWS.UpdateCustomerPaymentProfileResponseType response = SoapAPIUtilities.Service.UpdateCustomerPaymentProfile(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.resultCode == CustomerProfileWS.MessageTypeEnum.Ok);;
 }
Exemple #2
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);
 }
Exemple #3
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);
 }