Hello.
I'm trying to get a credit card processing script to work. It's with the payQuake or Merchant Partners system.
It's suposed to process the credit card transaction without ever having to leave my web site (if I point the form to the quicksale.php script - like it's done below).
What its doing is it will run for a few minutes then output "No Response" (the first part of the if clause below).
Merchant Partners or payQuake's technical support is not too good. It appears that they assume that everyone already knows how to integrate their software.
Does anybody see what I'm doing wrong?
// This is the form where the user inputs their information.
<form method="post" action="https://www.mydomain.com/quicksale.php">
<input type="hidden" name="action" value="ns_quicksale_cc">
<input type="hidden" name="acctid" value="TEST0">
<!-- commented out
<input type="hidden" name="usepost" value="1">
<input type="hidden" name="Accepturl" value="http://thebank.com/cgi-bin/test.cgi">
<input type="hidden" name="Accepturl" value="http://thebank.com/cgi-bin/showresult.cgi">
<input type="hidden" name="Declineurl" value="http://thebank.com/cgi-bin/showresult.cgi">
-->
<input type="hidden" name="Accepturl" value="http://www.mydomain.com/secure/AcceptURL.php">
<input type="hidden" name="Declineurl" value="http://www.mydomain.com/secure/DeclineURL.php">
<input type="hidden" name="emailfrom" value="test@mydomain.com">
<input type="hidden" name="emailsubject" value="Transaction Receipt">
<input type="hidden" name="emailtext" value="Thank you for your order!">
<input type="text" name="amount" value="1.00" size="6" maxlength="6">
<input type="text" name="ccname" value="Cocomo Joe">
<input type="text" name="ccnum" value="5454545454545454">
<select name="expmon" size="1">
<option value="12">12</option>
...
<select name="expyear" size="1">
<option value="2005">2005</option>
...
</form>
//Here's the quicksale.php script that I'm using:
// (this script is provided by payQuake)
$url = 'https://thebank.com/cgi-bin/trans.cgi';
$params = "action=ns_quicksale_cc" . "&" .
"acctid=TEST0" . "&" .
"amount=1.00" . "&" .
"ccname=Tony Test" . "&" .
"ccnum=5454545454545454" . "&" .
"expmon=09" . "&" .
"expyear=2008";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$params);
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=curl_exec ($ch);
curl_close ($ch);
if ($result == "") {
echo("No Response.\n"); // It outputs this every time.
exit;
} else {
$pieces = explode("\r\n", $result);
echo $pieces[0];
echo $pieces[1];
exit;
}
I've tried setting CURLOPT_POST to 0 and commenting out the usepost and
it won't work.
I've tried having CURLOPT_POST set to 1 (like above) and un-commenting
usepost and it won't work.
What the script above does is echo "No Response." every time.
Thanks.