- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are converting from the soap endpoints to using the API and I'm having issues with the call to getHostedProfilePageRequest(). We are trying to set some settings and they are being rejected with the following two messages:
- "Setting Name '10' is invalid for this method."
- "Setting Name '11' is invalid for this method."
From what I can from the documentation, these settings are definitely valid for the method. Here is my code:
Dim settings() As AuthorizeNet.Api.Contracts.V1.settingType = New AuthorizeNet.Api.Contracts.V1.settingType(1) {} settings(0) = New AuthorizeNet.Api.Contracts.V1.settingType() settings(0).settingName = settingNameEnum.hostedProfilePageBorderVisible settings(0).settingValue = False settings(1) = New AuthorizeNet.Api.Contracts.V1.settingType() settings(1).settingName = settingNameEnum.hostedProfileIFrameCommunicatorUrl settings(1).settingValue = communicatorURL Dim request As New AuthorizeNet.Api.Contracts.V1.getHostedProfilePageRequest() request.customerProfileId = authorizeProfileID request.hostedProfileSettings = settings Dim controller As New getHostedProfilePageController(request) controller.Execute() Dim response As AuthorizeNet.Api.Contracts.V1.getHostedProfilePageResponse = controller.GetApiResponse()
The response contains the two messages. The "communicatorURL" starts with "https://..."
Why is it not accepting these settings for the getHostedProfilePageRequest method??
Solved! Go to Solution.
โ01-03-2019 02:35 PM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I figured it out. I needed to .ToString the settingNameEnum's as it was assigning the numeric value to the setting.Name which needed to be the string. Here is the working code:
Dim settings() As AuthorizeNet.Api.Contracts.V1.settingType = New AuthorizeNet.Api.Contracts.V1.settingType(1) {} settings(0) = New AuthorizeNet.Api.Contracts.V1.settingType() settings(0).settingName = settingNameEnum.hostedProfilePageBorderVisible.ToString() settings(0).settingValue = "false" settings(1) = New AuthorizeNet.Api.Contracts.V1.settingType() settings(1).settingName = settingNameEnum.hostedProfileIFrameCommunicatorUrl.ToString() settings(1).settingValue = communicatorURL Dim request As New AuthorizeNet.Api.Contracts.V1.getHostedProfilePageRequest() request.customerProfileId = authorizeProfileID request.hostedProfileSettings = settings Dim controller As New getHostedProfilePageController(request) controller.Execute() Dim response As AuthorizeNet.Api.Contracts.V1.getHostedProfilePageResponse = controller.GetApiResponse()
โ01-03-2019 02:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I figured it out. I needed to .ToString the settingNameEnum's as it was assigning the numeric value to the setting.Name which needed to be the string. Here is the working code:
Dim settings() As AuthorizeNet.Api.Contracts.V1.settingType = New AuthorizeNet.Api.Contracts.V1.settingType(1) {} settings(0) = New AuthorizeNet.Api.Contracts.V1.settingType() settings(0).settingName = settingNameEnum.hostedProfilePageBorderVisible.ToString() settings(0).settingValue = "false" settings(1) = New AuthorizeNet.Api.Contracts.V1.settingType() settings(1).settingName = settingNameEnum.hostedProfileIFrameCommunicatorUrl.ToString() settings(1).settingValue = communicatorURL Dim request As New AuthorizeNet.Api.Contracts.V1.getHostedProfilePageRequest() request.customerProfileId = authorizeProfileID request.hostedProfileSettings = settings Dim controller As New getHostedProfilePageController(request) controller.Execute() Dim response As AuthorizeNet.Api.Contracts.V1.getHostedProfilePageResponse = controller.GetApiResponse()
โ01-03-2019 02:41 PM

