Reply
Member
Posts: 5
Registered: ‎05-16-2019
Accepted Solution

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?


Accepted Solutions
Solution
Accepted by topic author JokersWild
‎05-24-2019 09:22 PM
Contributor
Posts: 13
Registered: ‎06-26-2012

Re: C# get customer payment profile

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


All Replies
Solution
Accepted by topic author JokersWild
‎05-24-2019 09:22 PM
Contributor
Posts: 13
Registered: ‎06-26-2012

Re: C# get customer payment profile

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

 

getCustomerProfileResponse response = controller.GetApiResponse()

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

Member
Posts: 5
Registered: ‎05-16-2019

Re: C# get customer payment profile

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