I am trying to retrieve the masked credit card for the customer profile but can not seem to get the credit card number.
How do i get the cc from p2.paymentprofile.payment. (this is the problem credit card is not an option.
Thanks
PublicSharedFunction GetCustomerProfile(profile_id AsLong) As CustomerProfileWS.CustomerProfileMaskedType
Dim response_type As CustomerProfileWS.GetCustomerProfileResponseType = SoapAPIUtilities.Service.GetCustomerProfile(SoapAPIUtilities.MerchantAuthentication, profile_id)
Console.WriteLine(response_type.profile.customerProfileId)
ForEach p As CustomerProfileWS.CustomerPaymentProfileMaskedTypeIn response_type.profile.paymentProfiles
Console.WriteLine(p.customerPaymentProfileId)
Dim p2 As CustomerProfileWS.GetCustomerPaymentProfileResponseType = SoapAPIUtilities.Service.GetCustomerPaymentProfile(SoapAPIUtilities.MerchantAuthentication, profile_id, p.customerPaymentProfileId)
Next
Return response_type.profile
EndFunction
04-11-2013 12:31 PM
p2.paymentprofile.payment is an object, you need to cast it to the correct type CreditCardMaskedType
04-11-2013 12:45 PM - edited 04-11-2013 12:45 PM
Thank you for the help, this is what I used for anyone interested.
PublicSharedFunction GetCustomerProfile(profile_id AsLong) As CustomerProfileWS.CustomerProfileMaskedType
Dim response_type As CustomerProfileWS.GetCustomerProfileResponseType = SoapAPIUtilities.Service.GetCustomerProfile(SoapAPIUtilities.MerchantAuthentication, profile_id)
Console.WriteLine(response_type.profile.customerProfileId)
ForEach p As CustomerProfileWS.CustomerPaymentProfileMaskedTypeIn response_type.profile.paymentProfiles
Console.WriteLine(p.customerPaymentProfileId)
Console.WriteLine(DirectCast(p.payment.Item, CreditCardMaskedType).cardNumber)
Console.WriteLine(DirectCast(p.payment.Item, CreditCardMaskedType).cardType)
Console.WriteLine(DirectCast(p.payment.Item, CreditCardMaskedType).expirationDate)
Next
Return response_type.profile
EndFunction
04-11-2013 01:47 PM