PaymentSphere Documentation links and PHP integration code sample While we pride ourselves on open archetecture and ease of integration, you may want to consider a turn-key solution using GhostCart - our pre-integrated e-commerce platform when planning your development strategy. Otherwise, here are some usefull integration resources for software and web application developers: Doccumentation PaymentSphere Developers Manual . - Full API documentation in .pdf format Code Sample To follow is an example for using ProcessCreditCard with PHP ProcessCreditCard is the most commonly used webservice which is found on page 34 of the developers manual. <? //The following requests are for raw, non-validated form data. Obviously, these requests should all be cleaned and validated prior to use in a live application. This is only a demonstration $date_time =date("YmdHis"); $username = $_REQUEST['username']; $inv_number = "INV_".$date_time; $zip = $_REQUEST['zip']; //Call the PaymentSphere gateway________________________________________ //Note https://secure.payment-engine.com/SmartPayments/transact.asmx/ in $url refers to the paymentsphere gateway server that is being called. As there are several, you will want to confirm with your account rep that you are calling the right server for integration $url = file_get_contents("https://secure.paymentsphere.com/ //Parse out XML tags from gateway response for demonstration purposes $string1 = str_replace('<?xml version="1.0" encoding="utf-8" ?>','',$url); $result = $string10; echo "<br />$result<br />"; // Parse response to see if card is approved preg_match ("/Approved/", $result, $result_matched);
|
||||