cancel
Showing results for 
Search instead for 
Did you mean: 

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.

 

 

   

 

jamesboss17
Member
1 ACCEPTED SOLUTION

Accepted Solutions

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

2 REPLIES 2

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."
}
]
}
}

eisemann970
Contributor

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.