Esempio n. 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);;
 }
Esempio n. 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);
 }