I'm trying to retrieve payment information using GetCustomerPaymentProfile using the Authorize.Net CIM API. Particularly, I need the masked credit card number and credit card type OR masked checking account number. I've read the API documentation and followed it but there is no intellisense so my project won't compile.
var data = Service.GetCustomerPaymentProfile(MerchantAuthentication, profileId, customerPaymentProfileId);
var creditCard = data.creditCard... (nothing here)
Using C#, how would I do this?
EDIT: Looks like the payment object is a dynamic. Here's the code I ended up using. Thanks for the help!
if (data.paymentProfile.payment.Item.GetType() == typeof(CreditCardMaskedType))
{
var obj = (CreditCardMaskedType) data.paymentProfile.payment.Item;
retval.CreditCardNumber = obj.cardNumber;
retval.CreditCardType = obj.cardType;
}
if (data.paymentProfile.payment.Item.GetType() == typeof(BankAccountMaskedType))
{
var obj = (BankAccountMaskedType)data.paymentProfile.payment.Item;
retval.BankAccountNumber = obj.accountNumber;
retval.BankRoutingNumber = obj.routingNumber;
}