<?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 Error handling in Archived Discussions (Read Only)</title>
    <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Error-handling/m-p/350323#M96694</link>
    <description>&lt;P&gt;In PHP; I'm using this line to charge customer:&lt;BR /&gt;$api_response = $client-&amp;gt;getPaymentsApi()-&amp;gt;createPayment($body);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the error message (in proper format so I can save it) I use:&lt;/P&gt;&lt;P&gt;$errors = print_r($api_response-&amp;gt;getErrors(), true);&lt;BR /&gt;$errors = preg_replace('/[^a-z]/i','',$errors);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As results, in one case I received this error message:&lt;/P&gt;&lt;P&gt;ArraySquareModelsErrorObjectcategorySquareModelsErrorprivatePAYMENTMETHODERRORcodeSquareModelsErrorprivateTRANSACTIONLIMITdetailSquareModelsErrorprivateAuthorizationerrorTRANSACTIONLIMITfieldSquareModelsErrorprivate&lt;BR /&gt;&lt;BR /&gt;My first question is, what does this error message mean?&lt;BR /&gt;&lt;BR /&gt;My second question is, I need to get one no special character error message so I can display this to customer. How do I get this in PHP?&lt;BR /&gt;Instead of me having to troubleshoot each time I just want to be able to display directly to customer what the error is but worried the message might have a quote or double quote and mess something up &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;I don't want an array result, just one sentence.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help? &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Sat, 19 Mar 2022 03:41:34 GMT</pubDate>
    <dc:creator>Andrea83</dc:creator>
    <dc:date>2022-03-19T03:41:34Z</dc:date>
    <item>
      <title>Error handling</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Error-handling/m-p/350323#M96694</link>
      <description>&lt;P&gt;In PHP; I'm using this line to charge customer:&lt;BR /&gt;$api_response = $client-&amp;gt;getPaymentsApi()-&amp;gt;createPayment($body);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the error message (in proper format so I can save it) I use:&lt;/P&gt;&lt;P&gt;$errors = print_r($api_response-&amp;gt;getErrors(), true);&lt;BR /&gt;$errors = preg_replace('/[^a-z]/i','',$errors);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As results, in one case I received this error message:&lt;/P&gt;&lt;P&gt;ArraySquareModelsErrorObjectcategorySquareModelsErrorprivatePAYMENTMETHODERRORcodeSquareModelsErrorprivateTRANSACTIONLIMITdetailSquareModelsErrorprivateAuthorizationerrorTRANSACTIONLIMITfieldSquareModelsErrorprivate&lt;BR /&gt;&lt;BR /&gt;My first question is, what does this error message mean?&lt;BR /&gt;&lt;BR /&gt;My second question is, I need to get one no special character error message so I can display this to customer. How do I get this in PHP?&lt;BR /&gt;Instead of me having to troubleshoot each time I just want to be able to display directly to customer what the error is but worried the message might have a quote or double quote and mess something up &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;I don't want an array result, just one sentence.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help? &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Mar 2022 03:41:34 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Error-handling/m-p/350323#M96694</guid>
      <dc:creator>Andrea83</dc:creator>
      <dc:date>2022-03-19T03:41:34Z</dc:date>
    </item>
  </channel>
</rss>

