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!
Solved! Go to Solution.
01-22-2020 01:10 PM
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.
01-24-2020 04:13 PM - edited 01-24-2020 04:16 PM
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.
01-24-2020 04:13 PM - edited 01-24-2020 04:16 PM
@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.
02-16-2020 11:05 AM
I was looking for solution for almost 2 weeks now. This solution worked for me. Thank you so much for sharing this.
08-17-2020 07:16 PM