Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7868163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:54:48+00:00 2026-06-03T00:54:48+00:00

OK, I have this php file for my HSBC bank processing using the API,

  • 0

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:

<?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 = "<?xml version='1.0' encoding='UTF-8'?>
<EngineDocList>
<DocVersion>1.0</DocVersion>
<EngineDoc>
    <ContentType>OrderFormDoc</ContentType>
    <User>
        <Name>xxx</Name>
        <Password>xxx</Password>
        <ClientId>xxx</ClientId>        
    </User>
    <Instructions>
        <Pipeline>PaymentNoFraud</Pipeline>
    </Instructions>
    <OrderFormDoc>
        <Mode>P</Mode>
        <Comments/>
        <Consumer>
            <Email/>
            <PaymentMech>
                <CreditCard>
                    <Number>".$cardNumber."</Number>
                    <Expires DataType='ExpirationDate' Locale='840'>".$cardExp."</Expires>
                    <Cvv2Val>".$cvdValue."</Cvv2Val>
                    <Cvv2Indicator>".$cvdIndicator."</Cvv2Indicator>
                    <IssueNum>".$issueNumber."</IssueNum>
                </CreditCard>
            </PaymentMech>
        </Consumer>
        <Transaction>
            <Type>Auth</Type>
            <CurrentTotals>
                <Totals>
                    <Total DataType='Money' Currency='826'>".$amount."</Total>
                </Totals>
            </CurrentTotals>
        </Transaction>
    </OrderFormDoc>
</EngineDoc>
    </EngineDocList>";
?>
<?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 => $a) {
      $result_tmp.="[".$d."]".$a;
      if($d=="tag" && $a=="TransactionStatus"){
          $findthis = true;
      }
      if($d=="value" && $findthis){
          $tResult = $a;
          $findthis = false;
      }

      if($d=="tag" && $a=="Text"){
          $findthis2 = true;
      }
      if($d=="value" && $findthis2){
          $tResult2 = $a;
          $findthis2 = false;
      }

}  
$result_tmp.= "}"; 
$k++; 

} 


echo $tResult2.$tResult;

?>

Here is an example of one of the sites not working gs.net
The output is:
payment processing… The HTTP method received is not valid. Only POST is accepted.

Whereas when I upload this exact same file to some of my other web hosts such as:
HGL working example
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.

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.

Any ideas please?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:54:49+00:00Added an answer on June 3, 2026 at 12:54 am

    This seems to have been caused by a PHP upgrade applied to the server and it was driving me crazy.

    The solution is to set the following SSL options when specifying the CURL connection.

    curl_setopt($ch, CURLOPT_SSLVERSION, 3);
    curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'RC4-MD5');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ajax.php file in my Wordpress themes folder, and this was working
So I have this PHP website that I am working on that using templates.
I have this PHP include file that has all the variables I'll be using.
I have a php file that i include in other php files. This php
I have this code which will include template.php file from inside each of these
So, i have this form in a php file and i want it to
I have the following code: if (include_once(dirname(__FILE__).'/file.php') || include_once(dirname(__FILE__).'/local/file.php') ) { This causes an
I'm new to web development.I have a php file such as addcourse.php.In this file
I have a php file that looks like this: <?php include(config.php); // put the
I have a php file which has a require_once Statement (?) this file is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.