cancel
Showing results for 
Search instead for 
Did you mean: 

C# get customer payment profile

I am trying to retrieve the Customer Payment Profile, using the GetCustomerProfile api, but I need to get it as a string.  But all I am getting is "AuthorizeNet.Api.Contracts.V1.customerPaymentProfileMaskedType[]".  Is there anyway to get the payment profile ID number in a string?

JokersWild
Member
1 ACCEPTED SOLUTION

Accepted Solutions

It is already in the string, you can use this.

 

getCustomerProfileResponse response = controller.GetApiResponse()

paymentProfileId = response.profile.paymentProfiles.FirstOrDefault().customerPaymentProfileId;

View solution in original post

jermteam
Contributor
2 REPLIES 2

It is already in the string, you can use this.

 

getCustomerProfileResponse response = controller.GetApiResponse()

paymentProfileId = response.profile.paymentProfiles.FirstOrDefault().customerPaymentProfileId;

jermteam
Contributor

That was it, thank you.  I have never used the "FirstOrDefault()" before.