<?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 Response from request has syntax error using API in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Response-from-request-has-syntax-error-using-API/m-p/62360#M36698</link>
    <description>&lt;P&gt;I'm converting the response to obj arr by json_decode but the error says it has syntax which I did not manipulate the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function sc_test_authenticate( $api_endpoint, $login, $tran_key ) {&lt;BR /&gt;&lt;BR /&gt;$params = array(&lt;BR /&gt;'authenticateTestRequest' =&amp;gt; array(&lt;BR /&gt;'merchantAuthentication' =&amp;gt; array(&lt;BR /&gt;'name' =&amp;gt; $login,&lt;BR /&gt;'transactionKey' =&amp;gt; $tran_key&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;$curl = curl_init();&lt;BR /&gt;&lt;BR /&gt;curl_setopt($curl, CURLOPT_URL, $api_endpoint);&lt;BR /&gt;curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));&lt;BR /&gt;curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params));&lt;BR /&gt;curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);&lt;BR /&gt;curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 300);&lt;BR /&gt;curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);&lt;BR /&gt;curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);&lt;BR /&gt;&lt;BR /&gt;$response = curl_exec($curl);&lt;BR /&gt;curl_close($curl);&lt;BR /&gt;return json_decode($response);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this returns NULL and if I remove the json_decode this is the returned value&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;string(86) "{"messages":{"resultCode":"Ok","message":[{"code":"I00001","text":"Successful."}]}}"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Mar 2018 09:30:08 GMT</pubDate>
    <dc:creator>Sigfred15</dc:creator>
    <dc:date>2018-03-28T09:30:08Z</dc:date>
    <item>
      <title>Response from request has syntax error using API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Response-from-request-has-syntax-error-using-API/m-p/62360#M36698</link>
      <description>&lt;P&gt;I'm converting the response to obj arr by json_decode but the error says it has syntax which I did not manipulate the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function sc_test_authenticate( $api_endpoint, $login, $tran_key ) {&lt;BR /&gt;&lt;BR /&gt;$params = array(&lt;BR /&gt;'authenticateTestRequest' =&amp;gt; array(&lt;BR /&gt;'merchantAuthentication' =&amp;gt; array(&lt;BR /&gt;'name' =&amp;gt; $login,&lt;BR /&gt;'transactionKey' =&amp;gt; $tran_key&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;);&lt;BR /&gt;&lt;BR /&gt;$curl = curl_init();&lt;BR /&gt;&lt;BR /&gt;curl_setopt($curl, CURLOPT_URL, $api_endpoint);&lt;BR /&gt;curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));&lt;BR /&gt;curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($params));&lt;BR /&gt;curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);&lt;BR /&gt;curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 300);&lt;BR /&gt;curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);&lt;BR /&gt;curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);&lt;BR /&gt;&lt;BR /&gt;$response = curl_exec($curl);&lt;BR /&gt;curl_close($curl);&lt;BR /&gt;return json_decode($response);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this returns NULL and if I remove the json_decode this is the returned value&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;string(86) "{"messages":{"resultCode":"Ok","message":[{"code":"I00001","text":"Successful."}]}}"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 09:30:08 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Response-from-request-has-syntax-error-using-API/m-p/62360#M36698</guid>
      <dc:creator>Sigfred15</dc:creator>
      <dc:date>2018-03-28T09:30:08Z</dc:date>
    </item>
  </channel>
</rss>

