- Impact
- 12
Hello,
I made a curl which send some data to a url and the result of script should be displayed.
the script looks like this
It's showing the output as blank , See : http://ashutosh4u.100webspace.net/Hubcaps_canada/curl_api.php
Can some one help, need help urgently
I made a curl which send some data to a url and the result of script should be displayed.
the script looks like this
Code:
<?php
// Initialize curl
$ch = curl_init();
// Get curl to POST
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// Instruct curl to suppress the output from Online Mart, and to directly
// return the transfer instead. (Output will be stored in $txResult.)
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
// This is the location of the Online Mart payment gateway
//https://www.beanstream.com/scripts/process_transaction.asp
curl_setopt( $ch, CURLOPT_URL, "https://www.beanstream.com/scripts/process_transaction.asp" );
// These are the transaction parameters that we will POST
$merchant_id=117489490;
$trnCardOwner="Ashutosh";
$trnCardNumber=4030070010001234;
$trnExpMonth=09;
$trnExpYear=20;
$trnCardCVD=567;
$trnOrderNumber=2234;
$trnAmount=30.00;
$ordEmailAddress="[email protected]";
$ordName="Ashutosh";
$ordPhoneNumber=9988736655;
$ordAddress1="1045 Main street";
$ordCity="Vancouver";
$ordProvince="BC";
$ordPostalCode="V8R1J6";
$ordCountry="CA";
$ash="requestType%3dT%26merchant_id%3d%22.%24merchant_id.%22%26trnCardOwner%3d%22.%24trnCardOwner.%22%26trnCardNumber%3d%22.%24trnCardNumber.%22%26trnExpMonth%3d%22.%24trnExpMonth.%22%26trnExpYear%3d%22.%24trnExpYear.%22%26trnOrderNumber%3d%22.%24trnOrderNumber.%22%26trnAmount%3d%22.%24trnAmount.%22%26ordEmailAddress%3d%22.%24ordEmailAddress.%22%26ordName%3d%22.%24ordName.%22%26ordPhoneNumber%3d%22.%24ordPhoneNumber.%22%26ordAddress1%3d%22.%24ordAddress1.%22%26ordAddress2%3d%22.%24ordAddress2.%22%26ordCity%3d%22.%24ordCity.%22%26ordProvince%3d%22.%24ordProvince.%22%26ordPostalCode%3d%22.%24ordPostalCode.%22%26ordCountry%3d%22.%24ordCountry.%22";
/*echo curl_setopt( $ch, CURLOPT_POSTFIELDS,"requestType=BACKEND&merchant_id=117489490&trnCardOwner=Paul+Randal&trnCardNumber=4030000010001234&trnExpMonth=01&trnExpYear=05&trnOrderNumber=2232&trnAmount=10.00&[email protected]&ordName=Paul+Randal&ordPhoneNumber=9999999&ordAddress1=1045+Main+Street&ordAddress2=&ordCity=Vancouver&ordProvince=BC&ordPostalCode=V8R+1J6&ordCountry=CA&approvedPage=payment_success.php?msg=success&declinedPage=payment_success.php?msg=declined" );*/
curl_setopt( $ch, CURLOPT_POSTFIELDS,$ash);
// Now POST the transaction. $txResult will contain Online Mart's response
$txResult = curl_exec($ch);
echo "Result:<BR>";
echo $txResult;
curl_close( $ch );
?>
Can some one help, need help urgently
Last edited: