<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Invalid or Missing Token in cybersource APIs</title>
    <link>https://community.developer.cybersource.com/t5/cybersource-APIs/Invalid-or-Missing-Token/m-p/93456#M3478</link>
    <description>&lt;UL&gt;&lt;LI&gt;Generate the hostedPaymentPage token on the server (not placeholder)&lt;/LI&gt;&lt;LI&gt;Inject that actual token into the hidden field before the form loads&lt;/LI&gt;&lt;LI&gt;Ensure you're using correct API login and key in the request&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Fri, 08 Aug 2025 14:44:12 GMT</pubDate>
    <dc:creator>malikjoius</dc:creator>
    <dc:date>2025-08-08T14:44:12Z</dc:date>
    <item>
      <title>Invalid or Missing Token</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/Invalid-or-Missing-Token/m-p/93415#M3451</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having an issue with the "getHostedPaymentPageRequest" api call where I always receive either error code E00001 "An error occured duing processing. Please try again", "Missing or invalid token", or a 550() error. My implementation is using pick basic as the backend. Here is the relevant code:&lt;/P&gt;&lt;P&gt;json = '{'&lt;BR /&gt;json := '"getHostedPaymentPageRequest":{'&lt;BR /&gt;json := '"merchantAuthentication":{"name":"':api.loginid:'","transactionKey":"':transactionKey:'"},'&lt;BR /&gt;json := '"transactionRequest":{"transactionType":"authCaptureTransaction","amount":"20.00","profile":{"customerProfileId":"':customerProfileId:'"},"customer":{"email":"eibachonline@gmail.com"}},'&lt;BR /&gt;json := '"hostedPaymentSettings":{"setting":['&lt;/P&gt;&lt;P&gt;json := '{"settingName":"hostedPaymentReturnOptions","settingValue":"{\\\"showReceipt\\\": true, \\\"url\\\": \\\"&lt;A href="https://mysite.com/receipt\" target="_blank"&gt;https://mysite.com/receipt\&lt;/A&gt;\\", \\\"urlText\\\": \\\"Continue\\\", \\\"cancelUrl\\\": \\\"&lt;A href="https://mysite.com/cancel\" target="_blank"&gt;https://mysite.com/cancel\&lt;/A&gt;\\", \\\"cancelUrlText\\\": \\\"Cancel\\\"}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentButtonOptions","settingValue":"{\\\"text\\\": \\\"Pay\\\"}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentStyleOptions","settingValue":"{\\\"bgColor\\\": \\\"blue\\\"}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentPaymentOptions","settingValue":"{\\\"cardCodeRequired\\\": false, \\\"showCreditCard\\\": true, \\\"showBankAccount\\\": true}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentSecurityOptions","settingValue":"{\\\"captcha\\\": false}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentShippingAddressOptions","settingValue":"{\\\"show\\\": false, \\\"required\\\": false}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentBillingAddressOptions","settingValue":"{\\\"show\\\": true, \\\"required\\\": false}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentCustomerOptions","settingValue":"{\\\"showEmail\\\": false, \\\"requiredEmail\\\": false, \\\"addPaymentProfile\\\": true}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentOrderOptions","settingValue":"{\\\"show\\\": true, \\\"merchantName\\\": \\\"G and S Questions Inc.\\\"}"},'&lt;BR /&gt;json := '{"settingName":"hostedPaymentIFrameCommunicatorUrl","settingValue":"{\\\"url\\\": \\\"&lt;A href="https://mysite.com/iFrameCommunicator.html\" target="_blank"&gt;https://mysite.com/iFrameCommunicator.html\&lt;/A&gt;\\"}"}'&lt;/P&gt;&lt;P&gt;json := ']}}}'&lt;/P&gt;&lt;P&gt;Sending this json via:&lt;/P&gt;&lt;P&gt;cmd = '!curl -s -X POST &lt;A href="https://apitest.authorize.net/xml/v1/request.api" target="_blank"&gt;https://apitest.authorize.net/xml/v1/request.api&lt;/A&gt; '&lt;BR /&gt;cmd := '-H "Content-Type: application/json" '&lt;BR /&gt;cmd := '-H "Accept: application/json" '&lt;BR /&gt;cmd := "-d '" : json : "'"&lt;/P&gt;&lt;P&gt;Here is the html:&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;HostedPayment Test Page&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;script src="&lt;A href="https://code.jquery.com/jquery-3.6.0.min.js" target="_blank"&gt;https://code.jquery.com/jquery-3.6.0.min.js&lt;/A&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;script src="/mfgdev/js/hostedPayment.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&amp;lt;body&amp;gt;&lt;BR /&gt;&amp;lt;div&amp;gt;&lt;BR /&gt;Open Authorize.net in an iframe to complete transaction&lt;BR /&gt;&amp;lt;button id="btnOpenAuthorizeNetIFrame"&amp;gt;Show Payment Form&amp;lt;/button&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div id="iframe_holder" class="center-block" style="width:90%;max-width: 1000px;"&amp;gt;&lt;BR /&gt;&amp;lt;iframe&lt;BR /&gt;id="add_payment"&lt;BR /&gt;name="add_payment"&lt;BR /&gt;width="100%"&lt;BR /&gt;height="600"&lt;BR /&gt;style="border:1px solid black;"&amp;gt;&lt;BR /&gt;&amp;lt;/iframe&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;form&lt;BR /&gt;id="send_token"&lt;BR /&gt;action="&lt;A href="https://test.authorize.net/payment/payment" target="_blank"&gt;https://test.authorize.net/payment/payment&lt;/A&gt;"&lt;BR /&gt;method="POST"&lt;BR /&gt;target="add_payment"&amp;gt;&lt;BR /&gt;&amp;lt;input type="hidden" name="token" value='##TOKEN##' /&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;BR /&gt;&amp;lt;/body&amp;gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;&lt;P&gt;Here is the Javascript&amp;amp;colon;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$(function () {&lt;BR /&gt;$("#btnOpenAuthorizeNetIFrame").click(function () {&lt;BR /&gt;$("#add_payment").show();&lt;BR /&gt;const token = $("#send_token input[name=token]").val();&lt;BR /&gt;console.log("Here is the token that should be sent", token);&lt;BR /&gt;if (!token || token.includes("##TOKEN##")) {&lt;BR /&gt;console.log("Token expected to be null at this point:", token);&lt;BR /&gt;}&lt;BR /&gt;console.log("submitting now");&lt;BR /&gt;$("#send_token").attr({&lt;BR /&gt;"action": "&lt;A href="https://test.authorize.net/customer/hostedProfile" target="_blank"&gt;https://test.authorize.net/customer/hostedProfile&lt;/A&gt;",&lt;BR /&gt;"target": "add_payment"&lt;BR /&gt;}).submit();&lt;BR /&gt;$(window).scrollTop($('#add_payment').offset().top - 50);&lt;BR /&gt;});&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;if (!window.AuthorizeNetIFrame) window.AuthorizeNetIFrame = {};&lt;BR /&gt;AuthorizeNetIFrame.onReceiveCommunication = function (querystr) {&lt;BR /&gt;var params = parseQueryString(querystr);&lt;BR /&gt;switch (params["action"]) {&lt;BR /&gt;case "successfulSave":&lt;BR /&gt;break;&lt;BR /&gt;case "cancel":&lt;BR /&gt;break;&lt;BR /&gt;case "resizeWindow":&lt;BR /&gt;var w = parseInt(params["width"]);&lt;BR /&gt;var h = parseInt(params["height"]);&lt;BR /&gt;var ifrm = document.getElementById("add_payment");&lt;BR /&gt;ifrm.style.width = w.toString() + "px";&lt;BR /&gt;ifrm.style.height = h.toString() + "px";&lt;BR /&gt;break;&lt;BR /&gt;case "transactResponse":&lt;BR /&gt;var ifrm = document.getElementById("add_payment");&lt;BR /&gt;ifrm.style.display = 'none';&lt;BR /&gt;}&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;function parseQueryString(str) {&lt;BR /&gt;var vars = [];&lt;BR /&gt;var arr = str.split('&amp;amp;');&lt;BR /&gt;var pair;&lt;BR /&gt;for (var i = 0; i &amp;lt; arr.length; i++) {&lt;BR /&gt;pair = arr[i].split('=');&lt;BR /&gt;vars.push(pair[0]);&lt;BR /&gt;vars[pair[0]] = unescape(pair[1]);&lt;BR /&gt;}&lt;BR /&gt;return vars;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Any help would be much appreciated. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2025 18:54:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/Invalid-or-Missing-Token/m-p/93415#M3451</guid>
      <dc:creator>TylerKurth</dc:creator>
      <dc:date>2025-08-04T18:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid or Missing Token</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/Invalid-or-Missing-Token/m-p/93416#M3452</link>
      <description>&lt;P&gt;Update: I am receiving a token, so I know that the javascript is injecting correctly.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Aug 2025 19:19:06 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/Invalid-or-Missing-Token/m-p/93416#M3452</guid>
      <dc:creator>TylerKurth</dc:creator>
      <dc:date>2025-08-04T19:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid or Missing Token</title>
      <link>https://community.developer.cybersource.com/t5/cybersource-APIs/Invalid-or-Missing-Token/m-p/93456#M3478</link>
      <description>&lt;UL&gt;&lt;LI&gt;Generate the hostedPaymentPage token on the server (not placeholder)&lt;/LI&gt;&lt;LI&gt;Inject that actual token into the hidden field before the form loads&lt;/LI&gt;&lt;LI&gt;Ensure you're using correct API login and key in the request&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 08 Aug 2025 14:44:12 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/cybersource-APIs/Invalid-or-Missing-Token/m-p/93456#M3478</guid>
      <dc:creator>malikjoius</dc:creator>
      <dc:date>2025-08-08T14:44:12Z</dc:date>
    </item>
  </channel>
</rss>

