Reply
Member
csaylor927
Posts: 4
Registered: ‎12-15-2010

C# CIM GetCustomerPaymentProfile Assistance

Hello,

 

I'm super confused as to how to retrieve the customers credit card number value from Authorize.Net.

I've got the following code:

 

public static CustomerProfileWS.CustomerPaymentProfileMaskedType GetCustomerPaymentProfile(long profile_id, long payment_profile_id){

          CustomerProfileWS.GetCustomerPaymentProfileResponseType response_type = SoapAPIUtilities.Service.GetCustomerPaymentProfile(SoapAPIUtilities.MerchantAuthentication, profile_id, payment_profile_id);

 


}

 

How from this point do I go about return the credit card number value?

Thanks for any assistance!
CBS

Expert
RaynorC1emen7
Posts: 3,090
Registered: ‎03-08-2010

Re: C# CIM GetCustomerPaymentProfile Assistance

in you method

return ((CustomerProfileWS.CustomerPaymentProfileMaskedType)response_type.paymentProfile);

 

Get cc# from the response_type, also the cardcode and cardtype

string cardNumber = ((CustomerProfileWS.CreditCardMaskedType)response_type.paymentProfile.payment.Item).cardNumber;

FYI, it return the masked cc# e.g. XXXX1234.

Member
csaylor927
Posts: 4
Registered: ‎12-15-2010

Re: C# CIM GetCustomerPaymentProfile Assistance

Thanks for the quick reply!

 

To clarify, should the cardnumber be added to the method as well? If so, how do I call the method and get the cardNumber value?

 

Sorry... all new to me!

 

Thanks for any assistance.

Member
csaylor927
Posts: 4
Registered: ‎12-15-2010

Re: C# CIM GetCustomerPaymentProfile Assistance

Basically I want the ccNumber as the return value. Does that make any sense?

Expert
RaynorC1emen7
Posts: 3,090
Registered: ‎03-08-2010

Re: C# CIM GetCustomerPaymentProfile Assistance

The first code block is for if your method return CustomerProfileWS.CustomerPaymentProfileMaskedType

If you just need the ccNumber

just return the value cardNumber from second code block "string cardNumber = ..."

public static string GetCustomerPaymentProfileCCNumber(long profile_id, long payment_profile_id){

          CustomerProfileWS.GetCustomerPaymentProfileResponseType response_type = SoapAPIUtilities.Service.GetCustomerPaymentProfile(SoapAPIUtilities.MerchantAuthentication, profile_id, payment_profile_id);

return ((CustomerProfileWS.CreditCardMaskedType)response_type.paymentProfile.payment.Item).cardNumber;
}

 

 

as

 

Member
csaylor927
Posts: 4
Registered: ‎12-15-2010

Re: C# CIM GetCustomerPaymentProfile Assistance

Yeah, that did it. Really appreciate your assistance!