Note that there are some explanatory texts on larger screens.

plurals
  1. POThe HTTP method received is not valid. Only POST is accepted
    primarykey
    data
    text
    <p>OK, I have this php file for my HSBC bank processing using the API, I have this working fine on 2 of my other websites, however the SAME file is failing on the other two sites, I have no idea why. My web developer is stumped and decided to create a test file, Here is the code from the test file:</p> <pre><code>&lt;?php echo "payment processing..."; $amount = 100;// round($_POST["realamount"], 2) * 100; $fullName = "test";//$_POST['name']; $Address1 = "test";//$_POST['address1']; $Address2 = "test";//$_POST['address2']; $city ="test";// $_POST['city']; $county = $city; $postcode = "test";//$_POST['zipcode']; $country = "GRB";//$_POST['country']; $phone = "test";//$_POST['telephone']; $email = "a@a.com";//$_POST['emailaddress']; $cardNumber = "337877666233434";//$_POST['cardNumber']; $cardExp = "03/2011";//$_POST['ccmonth'] . "/" . substr($_POST["ccyear"],2,2); $cvdIndicator = "111";//$_POST['cvdIndicator']; $cvdValue = "111";//$_POST['cvdValue']; $issueNumber = "111";//$_POST['issueNumber']; $cardType = "VI";//$_POST['cardType']; $testRead = "&lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;EngineDocList&gt; &lt;DocVersion&gt;1.0&lt;/DocVersion&gt; &lt;EngineDoc&gt; &lt;ContentType&gt;OrderFormDoc&lt;/ContentType&gt; &lt;User&gt; &lt;Name&gt;xxx&lt;/Name&gt; &lt;Password&gt;xxx&lt;/Password&gt; &lt;ClientId&gt;xxx&lt;/ClientId&gt; &lt;/User&gt; &lt;Instructions&gt; &lt;Pipeline&gt;PaymentNoFraud&lt;/Pipeline&gt; &lt;/Instructions&gt; &lt;OrderFormDoc&gt; &lt;Mode&gt;P&lt;/Mode&gt; &lt;Comments/&gt; &lt;Consumer&gt; &lt;Email/&gt; &lt;PaymentMech&gt; &lt;CreditCard&gt; &lt;Number&gt;".$cardNumber."&lt;/Number&gt; &lt;Expires DataType='ExpirationDate' Locale='840'&gt;".$cardExp."&lt;/Expires&gt; &lt;Cvv2Val&gt;".$cvdValue."&lt;/Cvv2Val&gt; &lt;Cvv2Indicator&gt;".$cvdIndicator."&lt;/Cvv2Indicator&gt; &lt;IssueNum&gt;".$issueNumber."&lt;/IssueNum&gt; &lt;/CreditCard&gt; &lt;/PaymentMech&gt; &lt;/Consumer&gt; &lt;Transaction&gt; &lt;Type&gt;Auth&lt;/Type&gt; &lt;CurrentTotals&gt; &lt;Totals&gt; &lt;Total DataType='Money' Currency='826'&gt;".$amount."&lt;/Total&gt; &lt;/Totals&gt; &lt;/CurrentTotals&gt; &lt;/Transaction&gt; &lt;/OrderFormDoc&gt; &lt;/EngineDoc&gt; &lt;/EngineDocList&gt;"; ?&gt; &lt;?php //$url = "https://www.uat.apixml.netq.hsbc.com"; $url = "https://www.secure-epayments.apixml.hsbc.com/"; $ch = curl_init(); curl_setopt($ch, CURLOPT_POST,1); curl_setopt($ch, CURLOPT_POSTFIELDS,$testRead); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $result_tmp = curl_exec ($ch); curl_close ($ch); /////////////////////////////////////// // use XML Parser result $xml_parser = xml_parser_create(); xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0); xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE,1); xml_parse_into_struct($xml_parser, $result_tmp, $vals, $index); xml_parser_free($xml_parser); //print_r($vals); // print all the arrays. //print_r($vals[29]); // print only the selected array. $val1 = $vals[21]; // ProcReturnMsg $paymentResult = $val1[value]; $result_tmp = ""; $k=0; $findthis = false; $findthis2 = false; foreach ($vals as $val) { $result_tmp.= $k."{"; foreach($val as $d =&gt; $a) { $result_tmp.="[".$d."]".$a; if($d=="tag" &amp;&amp; $a=="TransactionStatus"){ $findthis = true; } if($d=="value" &amp;&amp; $findthis){ $tResult = $a; $findthis = false; } if($d=="tag" &amp;&amp; $a=="Text"){ $findthis2 = true; } if($d=="value" &amp;&amp; $findthis2){ $tResult2 = $a; $findthis2 = false; } } $result_tmp.= "}"; $k++; } echo $tResult2.$tResult; ?&gt; </code></pre> <p>Here is an example of one of the sites not working <a href="https://www.glowsticks.net/hsbc_payment_way_test.php" rel="nofollow">gs.net</a> The output is: payment processing... The HTTP method received is not valid. Only POST is accepted.</p> <p>Whereas when I upload this exact same file to some of my other web hosts such as: <a href="https://www.happyglowlucky.co.uk/hsbc_payment_way_test.php" rel="nofollow">HGL working example</a> The output here is payment processing... Unable to determine card type. ('length' is '15')E This sounds like an error message, but basically that error is not important, so the latter is what we are trying to achieve in the first link.</p> <p>I have even uploaded this file to some really basic hosting accounts of mine, sometimes it will work sometimes it won't, so I'm guessing it's something to do with what the hosting company are allowing or have switched On/Off.</p> <p>Any ideas please?</p> <p>Thank you</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload