Page 1 of 1

Using PHP to integrate Internet Secure's Payment Processing

Posted: Tue Apr 21, 2009 3:37 pm
by thespikeyone
Hi all,

I was wondering if any of you have used Internet Secure's Merchant Direct payment processing system? I am putting together a bid for a company that would like to integrate it into their website. All of the examples on Internet Secure's website use ASP, but I don't see why I couldn't use PHP. If I post XML to their script, it shouldn't make a difference whether PHP or ASP POSTed the variable, correct?

If any of you have used this system before, I would appreciate any input on what goes into it.

Thanks!

Re: Using PHP to integrate Internet Secure's Payment Processing

Posted: Sun Apr 26, 2009 7:59 am
by kimberly
Greetings,

Did you ever get any replies to your question?
I am trying to muddle my way through something similar.
I am trying to help someone with their website to integrate with a 3rd party secure payment system, using XML.
I am new to PHP and I am struggling... :banghead:

I'd like to hear if you were successful, and how...
thanks.

Re: Using PHP to integrate Internet Secure's Payment Processing

Posted: Mon Apr 27, 2009 12:00 pm
by thespikeyone
Hi Kimberly,

I did not receive a reply to my question, but I didn't win the bid for the project so I didn't look into the issue any further. The team at Internet Secure sent me an example of how I could implement their services. I have attached it to this reply. I hope it helps you.

Re: Using PHP to integrate Internet Secure's Payment Processing

Posted: Mon Apr 27, 2009 12:29 pm
by kimberly
Thank you very much for the attachment!
I also hope it helps!
8O

Re: Using PHP to integrate Internet Secure's Payment Process

Posted: Tue Sep 03, 2013 11:01 am
by fulltiltphil
here is a working example of php cURL for the payment Gateway InternetSecure Merchant Direct.

Code: Select all

<?php

// The XML Request
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><TranxRequest>
<xxxTransType>00</xxxTransType>
<GatewayID>90001</GatewayID>
<xxxName>Test Testing</xxxName>
<xxxEmail>tester@internetsecure.com</xxxEmail>
<xxxAddress>7221 Chatman Rd</xxxAddress>
<xxxCity>Knoxville</xxxCity>
<xxxState>TN</xxxState>
<xxxCountry>US</xxxCountry>
<xxxZipCode>37920</xxxZipCode>
<Products>211.00::1::CCD001::Credit Card Deposit Test::</Products>
<xxxCard_Number>4124939999999990</xxxCard_Number>
<xxxCCMonth>12</xxxCCMonth>
<xxxCCYear>2023</xxxCCYear>
<CVV2>354</CVV2>
<CVV2Indicator>1</CVV2Indicator></TranxRequest>";

// ************* Test Card Numbers *************
//	MasterCard  5136490000000009
//	Visa 4124939999999990
// **************************************************

//	$url = "https://secure.internetsecure.com/process.cgi"; // production post URL
	$url = "https://test.internetsecure.com/process.cgi"; // sandbox post URL

// PostData XML Transaction URL Encoded
 $postData = "xxxRequestMode=X&xxxRequestData=".urlencode($xml);

// Get the curl session object
$session = curl_init();

$header[] = "Content-Length: ".strlen($postData);
$header[] = "Content-Type: application/x-www-form-urlencoded";

// Set the POST options.
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($session,CURLOPT_URL,$url);
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $postData);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_HTTPHEADER, $header);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

// POST the XML then close the session
$response = curl_exec($session);
curl_close($session);

      echo "<pre><em><strong>Transaction Request XML:</strong></em><br \>"; 
      echo str_replace('>','>',str_replace('<','<',str_replace('><',">\n<",$xml))).'</pre><br \>';
      echo "<pre><em><strong>Transaction Request URL encoded:</strong></em><br \>";
      echo str_replace('>','>',str_replace('<','<',str_replace('><',">\n<",$postData))).'</pre><br \>';

      echo "<pre><em><strong>Transaction Response:</strong></em><br \>";
      echo str_replace('>','>',str_replace('<','<',str_replace('><',">\n<",$response))).'</pre><br \>';
?>

Re: Using PHP to integrate Internet Secure's Payment Process

Posted: Tue Sep 03, 2013 11:07 am
by fulltiltphil
The example I posted is using the sandbox environment make sure to use your own Gateway ID and if your using a production Gateway ID change the Post URL. Test Card numbers only work in the Sandbox environment unless you pass the {TEST} flag at the end of the Products String.