Reply
Highlighted
Member
Posts: 2
Registered: ‎04-02-2015
Accepted Solution

Accept Hosted Form: How Can I Get Payment Profiles with getHostedPaymentPageRequest Call (C#)?

Hi,

 

In the Accept Hosted documentation, there is a note below the Presenting Payment Options header in the following section:

 

https://developer.authorize.net/api/reference/features/accept_hosted.html#Requesting_the_Form_Token

 

The note reads:

 

NOTE: If you use the Customer Profiles feature to store customer payment information, you can send a customer profile ID in the customerProfileId element of the getHostedPaymentPageRequest call. When the browser displays the form, the four most recent payment profiles for that customer profile are displayed as shown in the image below. The customer can choose among these payment methods or enter new payment information, and save the new payment information in a payment profile that can be used in later transactions.

 

Is this true? If so, can you please provide an example of how to send the customer profile ID in the getHostedPaymentPageRequest call? I cannot access the customerProfileId member: getHostedPaymentPageRequest().profile.customerProfileId. I keep getting a null reference error because profile is null, even if I try to assign a customer profile ID directly in the request.  

 

Thanks!


Accepted Solutions
Highlighted
Solution
Accepted by topic author ALPS
‎01-24-2020 04:14 PM
Member
Posts: 2
Registered: ‎04-02-2015

Re: Accept Hosted Form: How Can I Get Payment Profiles with getHostedPaymentPageRequest Call (C#)?

[ Edited ]

Hi,

 

I solved this issue on my own. Yes, the note is true, but it's more complex than it indicates and should be made more clear and specific, because customer profile access is an important feature.

 

The getHostedPaymentPageRequest().profile member is a field of the transactionRequestType and the customerProfilePaymentType. In order to reach the profile field customerProfilePaymentType must be instantiated so customerProfileId can be accessed, like this:

 

var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
amount = request.Amount,
profile = new customerProfilePaymentType { customerProfileId = "XXXXXXXXXX" }
};

 

Thanks.

View solution in original post


All Replies
Highlighted
Solution
Accepted by topic author ALPS
‎01-24-2020 04:14 PM
Member
Posts: 2
Registered: ‎04-02-2015

Re: Accept Hosted Form: How Can I Get Payment Profiles with getHostedPaymentPageRequest Call (C#)?

[ Edited ]

Hi,

 

I solved this issue on my own. Yes, the note is true, but it's more complex than it indicates and should be made more clear and specific, because customer profile access is an important feature.

 

The getHostedPaymentPageRequest().profile member is a field of the transactionRequestType and the customerProfilePaymentType. In order to reach the profile field customerProfilePaymentType must be instantiated so customerProfileId can be accessed, like this:

 

var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
amount = request.Amount,
profile = new customerProfilePaymentType { customerProfileId = "XXXXXXXXXX" }
};

 

Thanks.

Highlighted
Member
Posts: 4
Registered: ‎09-16-2019

Re: Accept Hosted Form: How Can I Get Payment Profiles with getHostedPaymentPageRequest Call (C#)?


@ALPS wrote:

Hi,

 

I solved this issue on my own. Yes, the note is true, but it's more complex than it indicates and should be made more clear and specific, because customer profile access is an important feature.

 

The getHostedPaymentPageRequest().profile member is a field of the transactionRequestType and the customerProfilePaymentType. In order to reach the profile field customerProfilePaymentType must be instantiated so customerProfileId can be accessed, like this: pakistan rentacar

 

var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),
amount = request.Amount,
profile = new customerProfilePaymentType { customerProfileId = "XXXXXXXXXX" }
};

 

Thanks.

 

Thank you for posting your solution so that others can also get benefit from it.


 

Highlighted
Contributor
Posts: 11
Registered: ‎07-02-2020

Re: Accept Hosted Form: How Can I Get Payment Profiles with getHostedPaymentPageRequest Call (C#)?

I was looking for solution for almost 2 weeks now. This solution worked for me. Thank you so much for sharing this.