Reply
Highlighted
Member
Posts: 1
Registered: ‎12-13-2016
Accepted Solution

Missing or Invalid Token while passing request to the new Accept Hosted

Hi,

 

A very strange thing is happening.

I am using examples from : 

 http://developer.authorize.net/api/reference/features/accept_hosted.html

Now, I am successfully getting a token in my c#.net page by passing json as mentioned in the above url page.

 

Then I pass that generated token into an asp page having 

    <form method="post" action="https://test.authorize.net/payment/payment">

<input type="hidden" name="token" value="<%=t%>" />
<INPUT TYPE=SUBMIT VALUE="Click here for the secure payment form" />
</form>

 

The variable 't' has received the token via Request.QueryString

 

Now issue is, when I write value="<%=t%>", the response I get is that of "Missing or invalid token"

 

But when I pass the actual token value in the value="..", I get the correct payment form.

 

I tried response writing <%=t%> and it HAS the token value.

Then why I am not getting the proper response when I try passing the value through variable?

 

Please do help

 

Regards,

Khush.

 

 

   

 


Accepted Solutions
Solution
Accepted by Aaron (All Star)
‎09-08-2017 12:28 PM
Member
Posts: 1
Registered: ‎09-08-2017

Re: Missing or Invalid Token while passing request to the new Accept Hosted

Please see all variable sent while getting token . I was having same issue and notice sending one htmlentity in description . Fixing that worked for me.

View solution in original post


All Replies
Contributor
Posts: 14
Registered: ‎11-30-2016

Re: Missing or Invalid Token while passing request to the new Accept Hosted

[ Edited ]

Hey Khush

 

Can you post your request to and response from getHostedProfilePageRequest (http://developer.authorize.net/api/reference/index.html#customer-profiles-get-accept-customer-profil...)?

 

From that page, the same request is:

 

{
"getHostedProfilePageRequest": {
"merchantAuthentication": {
"name": "5KP3u95bQpv",
"transactionKey": "**"
},
"customerProfileId": "YourProfileID",
"hostedProfileSettings": {
"setting": [
{
"settingName": "hostedProfileReturnUrl",
"settingValue": "https://returnurl.com/return/"
},
{
"settingName": "hostedProfileReturnUrlText",
"settingValue": "Continue to confirmation page."
},
{
"settingName": "hostedProfilePageBorderVisible",
"settingValue": "true"
}
]
}
}
}

 

And the sample response:

 

{
"token": "e3X1JmlCM01EV4HVLqJhdbfStNUmKMkeQ/bm+jBGrFwpeLnaX3E6wmquJZtLXEyMHlcjhNPx471VoGzyrYF1/VIDKk/qcDKT9BShN64Noft0toiYq07nn1CD+w4AzK2kwpSJkjS3I92h9YompnDXSkPKJWopwUesi6n/trJ96CP/m4rf4Xv6vVQqS0DEu+e+foNGkobJwjop2qHPYOp6e+oNGNIYcGYc06VkwE3kQ+ZbBpBhlkKRYdjJdBYRwdSRtcE7YPia2ENTFGNuMYZvFv7rBaoBftWMvapK7Leb1QcE1uQ+t/9X0wlamazbJmubdiE4Gg5GSiFFeVMcMEhUGJyloDCkTzY/Yv1tg0kAK7GfLXLcD+1pwu+YAR4MasCwnFMduwOc3sFOEWmhnU/cvQ==",
"messages": {
"resultCode": "Ok",
"message": [
{
"code": "I00001",
"text": "Successful."
}
]
}
}

Solution
Accepted by Aaron (All Star)
‎09-08-2017 12:28 PM
Member
Posts: 1
Registered: ‎09-08-2017

Re: Missing or Invalid Token while passing request to the new Accept Hosted

Please see all variable sent while getting token . I was having same issue and notice sending one htmlentity in description . Fixing that worked for me.