<?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>thread Re: &amp;quot;Forbidden&amp;quot; and &amp;quot;Unexpected token R in JSON&amp;quot; errors. in Archived Discussions (Read Only)</title>
    <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/20989#M95041</link>
    <description>&lt;P&gt;&lt;a href="https://community.squareup.com/t5/user/viewprofilepage/user-id/32633"&gt;@Hampstead﻿&lt;/a&gt;&amp;nbsp;- After reporting your issue to our API Team, they've been unsuccessful&amp;nbsp;at replicating what you've described.&amp;nbsp;Would you mind sharing what&amp;nbsp;browser you're using, as well as&amp;nbsp;a code sample of how you're&amp;nbsp;implementing the Payment Form?&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2016 18:24:58 GMT</pubDate>
    <dc:creator>Sean</dc:creator>
    <dc:date>2016-10-13T18:24:58Z</dc:date>
    <item>
      <title>"Forbidden" and "Unexpected token R in JSON" errors.</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/20893#M95040</link>
      <description>&lt;P&gt;Dear Sir/Madam,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In sandbox mode, the payments worked always Ok. However, yesterday, even though nothing changed in my code, I started receiving the errors:&lt;BR /&gt;- "POST &lt;A href="https://connect.squareup.com/v2/card-nonce" target="_blank"&gt;https://connect.squareup.com/v2/card-nonce&lt;/A&gt; 403 (Forbidden)"&lt;BR /&gt;- "Uncaught SyntaxError: Unexpected token R in JSON at position"&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Here is more detailed error message as displayed in Chrome Developement Tools:&lt;BR /&gt;--------------------------------------&lt;BR /&gt;iframe?type=cardNumber:29 POST &lt;A href="https://connect.squareup.com/v2/card-nonce" target="_blank"&gt;https://connect.squareup.com/v2/card-nonce&lt;/A&gt; 403 (Forbidden)i.post @ iframe?type=cardNumber:29r.requestNonce @ iframe?type=cardNumber:28r.requestCardNonceIfValidForm @ iframe?type=cardNumber:28r @ iframe?type=cardNumber:28e @ iframe?type=cardNumber:28s @ iframe?type=cardNumber:28&lt;BR /&gt;iframe?type=cardNumber:29 Uncaught SyntaxError: Unexpected token R in JSON at position 0s.onreadystatechange @ iframe?type=cardNumber:29&lt;BR /&gt;-------------------------------------&lt;/P&gt;
&lt;P&gt;Please Help! &lt;BR /&gt;&lt;BR /&gt;Thank You!&lt;/P&gt;
&lt;P&gt;Nikolay&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 17:50:35 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/20893#M95040</guid>
      <dc:creator>Hampstead</dc:creator>
      <dc:date>2016-10-12T17:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: "Forbidden" and "Unexpected token R in JSON" errors.</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/20989#M95041</link>
      <description>&lt;P&gt;&lt;a href="https://community.squareup.com/t5/user/viewprofilepage/user-id/32633"&gt;@Hampstead﻿&lt;/a&gt;&amp;nbsp;- After reporting your issue to our API Team, they've been unsuccessful&amp;nbsp;at replicating what you've described.&amp;nbsp;Would you mind sharing what&amp;nbsp;browser you're using, as well as&amp;nbsp;a code sample of how you're&amp;nbsp;implementing the Payment Form?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 18:24:58 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/20989#M95041</guid>
      <dc:creator>Sean</dc:creator>
      <dc:date>2016-10-13T18:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: "Forbidden" and "Unexpected token R in JSON" errors.</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/21013#M95042</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;BR /&gt;&lt;BR /&gt;Browser is Chrome &lt;SPAN&gt;53.0.2785.143 m (64-bit) for Windows&lt;/SPAN&gt;. The code worked before. Nothing has changed afterwards. The only thing that I can think of is that I am using self-signed certificate on the website the form is submiited from.&lt;BR /&gt;&lt;BR /&gt;Here is the code:&lt;BR /&gt;-------------------------- In &amp;lt;head&amp;gt; ---------------------&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="line-content"&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;link &lt;SPAN class="html-attribute-name"&gt;href&lt;/SPAN&gt;="&lt;A class="html-attribute-value html-resource-link" href="https://hampstead/stylesheets/credit_card.css" target="_blank"&gt;/stylesheets/credit_card.css&lt;/A&gt;" &lt;SPAN class="html-attribute-name"&gt;rel&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;stylesheet&lt;/SPAN&gt;" &lt;SPAN class="html-attribute-name"&gt;type&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;text/css&lt;/SPAN&gt;" /&amp;gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="line-number"&gt;&amp;nbsp;&lt;SPAN class="html-tag"&gt;&amp;lt;script &lt;SPAN class="html-attribute-name"&gt;src&lt;/SPAN&gt;="&lt;A class="html-attribute-value html-resource-link" href="https://hampstead/scripts/lobibox.js" target="_blank"&gt;/scripts/lobibox.js&lt;/A&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD class="line-content"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="line-number"&gt;&amp;nbsp;&lt;SPAN class="html-tag"&gt;&amp;lt;script &lt;SPAN class="html-attribute-name"&gt;type&lt;/SPAN&gt;="&lt;SPAN class="html-attribute-value"&gt;text/javascript&lt;/SPAN&gt;" &lt;SPAN class="html-attribute-name"&gt;src&lt;/SPAN&gt;="&lt;A class="html-attribute-value html-resource-link" href="https://js.squareup.com/v2/paymentform" target="_blank"&gt;https://js.squareup.com/v2/paymentform&lt;/A&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="html-tag"&gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD class="line-content"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="line-number"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD class="line-content"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="line-number"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;-------------------------- In &amp;lt;body&amp;gt; ---------------------&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 19:29:06 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/21013#M95042</guid>
      <dc:creator>Hampstead</dc:creator>
      <dc:date>2016-10-13T19:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: "Forbidden" and "Unexpected token R in JSON" errors.</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/21015#M95043</link>
      <description>&lt;P&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;BR /&gt; &lt;BR /&gt; var bbr_mls_cc_err_number = "Please enter valid credit card number.";&lt;BR /&gt; var bbr_mls_cc_err_exp = "Please enter valid credit card expiration date.";&lt;BR /&gt; var bbr_mls_cc_err_cvc = "Please enter valid card verification code.";&lt;BR /&gt; var bbr_mls_cc_err_postal_code = "Please enter valid postal code.";&lt;BR /&gt; &amp;lt;/script&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;script type="text/javascript"&amp;gt;&lt;BR /&gt; &lt;BR /&gt; var sqTranslations = {&lt;BR /&gt; "Credit card number is not valid" : bbr_mls_cc_err_number,&lt;BR /&gt; "CVV is not valid": bbr_mls_cc_err_cvc,&lt;BR /&gt; "Expiration date is not valid" : bbr_mls_cc_err_exp,&lt;BR /&gt; "Postal code is not valid" : bbr_mls_cc_err_postal_code&lt;BR /&gt; }&lt;BR /&gt; var sqPaymentForm = new SqPaymentForm({&lt;BR /&gt; // Replace this value with your application's ID (available from the merchant dashboard).&lt;BR /&gt; // If you're just testing things out, replace this with your _Sandbox_ application ID,&lt;BR /&gt; // which is also available there.&lt;BR /&gt; applicationId: 'sandbox-sq0idp-LM7Elz6g-4BoZS64z3ae4Q',&lt;BR /&gt; inputClass: 'sq-input',&lt;BR /&gt; cardNumber: {&lt;BR /&gt; elementId: 'sq-card-number',&lt;BR /&gt; placeholder: "0000 0000 0000 0000"&lt;BR /&gt; },&lt;BR /&gt; cvv: {&lt;BR /&gt; elementId: 'sq-cvv',&lt;BR /&gt; placeholder: 'CVC'&lt;BR /&gt; },&lt;BR /&gt; expirationDate: {&lt;BR /&gt; elementId: 'sq-expiration-date',&lt;BR /&gt; placeholder: 'MM / YY'&lt;BR /&gt; },&lt;BR /&gt; postalCode: {&lt;BR /&gt; elementId: 'sq-postal-code',&lt;BR /&gt; placeholder: 'Postal Code'&lt;BR /&gt; },&lt;BR /&gt; inputStyles: [&lt;BR /&gt; // Because this object provides no value for mediaMaxWidth or mediaMinWidth,&lt;BR /&gt; // these styles apply for screens of all sizes, unless overridden by another&lt;BR /&gt; // input style below.&lt;BR /&gt; {&lt;BR /&gt; fontSize: '14px',&lt;BR /&gt; padding: '3px'&lt;BR /&gt; },&lt;BR /&gt; // These styles are applied to inputs ONLY when the screen width is 400px&lt;BR /&gt; // or smaller. Note that because it doesn't specify a value for padding,&lt;BR /&gt; // the padding value in the previous object is preserved.&lt;BR /&gt; {&lt;BR /&gt; mediaMaxWidth: '400px',&lt;BR /&gt; fontSize: '18px',&lt;BR /&gt; }&lt;BR /&gt; ],&lt;BR /&gt; callbacks: {&lt;BR /&gt; cardNonceResponseReceived: function(errors, nonce, cardData) {&lt;BR /&gt; if (errors) {&lt;BR /&gt; $("#loading-div-background").hide();&lt;BR /&gt; // var errorDiv = document.getElementById('errors');&lt;BR /&gt; // errorDiv.innerHTML = "";&lt;BR /&gt; var msg = '', sep = '';&lt;BR /&gt; errors.forEach(function(error) {&lt;BR /&gt; if (sqTranslations.hasOwnProperty(error.message)){&lt;BR /&gt; error.message = sqTranslations[error.message];&lt;BR /&gt; }&lt;BR /&gt; msg += sep + error.message;&lt;BR /&gt; sep = "&amp;lt;br&amp;gt;\n";&lt;BR /&gt; });&lt;BR /&gt; Lobibox.alert('error', {&lt;BR /&gt; "msg": msg&lt;BR /&gt; });&lt;BR /&gt; } else {&lt;BR /&gt; // This alert is for debugging purposes only.&lt;BR /&gt; // alert('Nonce received! ' + nonce + ' ' + JSON.stringify(cardData));&lt;BR /&gt; // Assign the value of the nonce to a hidden form element&lt;BR /&gt; var nonceField = document.getElementById('card-nonce');&lt;BR /&gt; nonceField.value = nonce;&lt;BR /&gt; // Submit the form&lt;BR /&gt; // document.getElementById('form').submit();&lt;BR /&gt; $('#btn_submit_form').trigger('click');&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; },&lt;BR /&gt; unsupportedBrowserDetected: function() {&lt;BR /&gt; // Alert the buyer that their browser is not supported&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; function submitButtonClick(event) {&lt;BR /&gt; $("#loading-div-background").show();&lt;BR /&gt; event.preventDefault();&lt;BR /&gt; sqPaymentForm.requestCardNonce();&lt;BR /&gt; }&lt;BR /&gt; &amp;lt;/script&amp;gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 19:33:23 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/21015#M95043</guid>
      <dc:creator>Hampstead</dc:creator>
      <dc:date>2016-10-13T19:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: "Forbidden" and "Unexpected token R in JSON" errors.</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/21016#M95044</link>
      <description>&lt;P&gt;&amp;lt;style type="text/css"&amp;gt;&lt;BR /&gt; .sq-input {&lt;BR /&gt; border: 1px solid #CCCCCC;&lt;BR /&gt; margin-bottom: 10px;&lt;BR /&gt; padding: 1px;&lt;BR /&gt; }&lt;BR /&gt; .sq-input--focus {&lt;BR /&gt; outline-width: 5px;&lt;BR /&gt; outline-color: #70ACE9;&lt;BR /&gt; outline-offset: -1px;&lt;BR /&gt; outline-style: auto;&lt;BR /&gt; }&lt;BR /&gt; .sq-input--error {&lt;BR /&gt; outline-width: 5px;&lt;BR /&gt; outline-color: #FF1010;&lt;BR /&gt; outline-offset: 0px;&lt;BR /&gt; outline-style: auto;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; &amp;lt;/style&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;div class="checkout"&amp;gt;&lt;BR /&gt; &amp;lt;div class="checkout-header"&amp;gt;&lt;BR /&gt; &amp;lt;h1 class="checkout-title"&amp;gt;&lt;BR /&gt; Pay by Credit Card: $&amp;lt;div class="order_total"&amp;gt;0.0&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;!-- &amp;lt;span class="checkout-price"&amp;gt;$&amp;lt;div class="order_total"&amp;gt;0.0&amp;lt;/div&amp;gt;&amp;lt;/span&amp;gt; --&amp;gt;&lt;BR /&gt; &amp;lt;/h1&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;div class="checkout-label checkout-card"&amp;gt;Card Number:&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="checkout-label checkout-exp"&amp;gt;Exp:&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="checkout-input checkout-card" id="sq-card-number"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="checkout-input checkout-exp" id="sq-expiration-date"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;!--&lt;BR /&gt; &amp;lt;input type="text" class="checkout-input checkout-name" placeholder="Your name" autofocus&amp;gt;&lt;BR /&gt; &amp;lt;input type="text" class="checkout-input checkout-exp" placeholder="MM"&amp;gt;&lt;BR /&gt; &amp;lt;input type="text" class="checkout-input checkout-exp" placeholder="YY"&amp;gt;&lt;BR /&gt; --&amp;gt;&lt;BR /&gt; &amp;lt;!-- &amp;lt;input type="text" class="checkout-input checkout-card" placeholder="4111 1111 1111 1111"&amp;gt; --&amp;gt;&lt;BR /&gt; &amp;lt;div class="checkout-label checkout-postal"&amp;gt;Postal Code:&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="checkout-label checkout-cvc"&amp;gt;CVC:&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="checkout-input checkout-postal" id="sq-postal-code"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div class="checkout-input checkout-cvc" id="sq-cvv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;!-- &amp;lt;input type="text" class="checkout-input checkout-cvc" placeholder="CVC"&amp;gt; --&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;p&amp;gt;&lt;BR /&gt; &amp;lt;br&amp;gt;&lt;BR /&gt; &amp;lt;input type="hidden" id="card-nonce" name="squareNonce"&amp;gt;&lt;BR /&gt; &lt;BR /&gt; &amp;lt;button type="button" class="btn ehampstead_input_submit checkout-btn" id="card-nonce-submit" onclick="submitButtonClick(event)"&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;Pay&amp;lt;span class="span_form_submit"&amp;gt;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;!-- &amp;lt;input type="submit" value="Purchase" class="checkout-btn"&amp;gt; --&amp;gt;&lt;BR /&gt; &amp;lt;/p&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt;--------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Your feedback will be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 19:34:05 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/21016#M95044</guid>
      <dc:creator>Hampstead</dc:creator>
      <dc:date>2016-10-13T19:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: "Forbidden" and "Unexpected token R in JSON" errors.</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/21032#M95045</link>
      <description>&lt;P&gt;&lt;a href="https://community.squareup.com/t5/user/viewprofilepage/user-id/32633"&gt;@Hampstead﻿&lt;/a&gt; - Our engineers&amp;nbsp;recreated your&amp;nbsp;website using your&amp;nbsp;code and were able to successfully hit the `&lt;A href="https://connect.squareup.com/v2/card-nonce" target="_blank"&gt;https://connect.squareup.com/v2/card-nonce&lt;/A&gt;` endpoint. In summary, there&amp;nbsp;doesn't appear to be anything wrong with the code you&amp;nbsp;submitted, and everything on our side is working as expected. They recommended that you look for potential&amp;nbsp;issues in your server code or server configuration.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 20:44:55 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/quot-Forbidden-quot-and-quot-Unexpected-token-R-in-JSON-quot/m-p/21032#M95045</guid>
      <dc:creator>Sean</dc:creator>
      <dc:date>2016-10-13T20:44:55Z</dc:date>
    </item>
  </channel>
</rss>

