H friends i need your help again
I have shooing site where user can pay through credit card . There are a general form where user submit primary data then he redirect to payment getaway provider page to give his credit card info please check the demo url
http://hostingcare.co.in/payment/testpage1.php
now i want to create a custom form where user will put all the data together and background program will remotely post data to payment getaway. if payment done or failed user will get responce within my site . user need not to go payment getaway page.
I have write this CURL Post but it is not fulfill my need. Please suggest what to do
//create array of data to be posted
$post_data['Name'] = 'xxx';
$post_data['ContactNo'] = 'xxx';
$post_data['MobileNo'] = 'xxx';
$post_data['Email'] = 'xxx@gmail.com';
$post_data['PaymentMode'] = 'Credit Card';
$post_data['CardProvider'] = 'VISA';
$post_data['CardNumber'] = '4335900000120054';
$post_data['CardExpiryMonth'] = '12';
$post_data['CardExpiryYear'] = '2019';
$post_data['SecurityCode'] = '675';
$post_data['CardHolderName'] = 'xxx';
$post_data['CurrencyCodecon'] = 'INR';
$post_data['MerchantId'] = 'nias';
$post_data['Amount'] = '100';
$post_data['INRAmount'] = '100';
$post_data['ReferenceNo'] = '11820269961381618768';
$post_data['CheckSum'] = '62a09afb36327a4a4f64efb8cc51b89ef4f1efd59f17c05996a0c3592d958ff6';
$post_data['Password'] = 'nias';
$post_data['CurrencyCode'] = '356';
$post_data['RemoteIP'] = '10.10.10.50';
//traverse array and prepare data for posting (key1=value1)
foreach ( $post_data as $key => $value) {
$post_items[] = $key . '=' . $value;
}
//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);
//create cURL connection
$curl_connection =
curl_init('https://cellpay.essecom.com/PaymentGateway/Payment.jsp');
//set options
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
//perform our request
$result = curl_exec($curl_connection);
//show information regarding the request
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' .
curl_error($curl_connection);
$result = curl_exec($ch);
curl_close($ch);
//echo $result;
$contents = curl_exec ($curl_connection);
echo "<br>".$contents;
//close the connection
curl_close($curl_connection);