Simple PHP web app to demo processing transactions with Mercury's web services platform.
3 step process to integrate to Mercury Web Services.
Got questions? Connect with our experts on Vantiv ONE.
Create request arrray and add all the Key/Value pairs.
$requestData = array
(
"MerchantID" => $_REQUEST["MerchantID"],
"LaneID" => $_REQUEST["02"],
"TranType" => $_REQUEST["TranType"],
"TranCode" => $_REQUEST["TranCode"],
"InvoiceNo" => $_REQUEST["InvoiceNo"],
"RefNo" => $_REQUEST["RefNo"],
"AcctNo" => $_REQUEST["AcctNo"],
"ExpDate" => $_REQUEST["ExpDate"],
"Memo" => $_REQUEST["Memo"],
"Purchase" => $_REQUEST["Purchase"]
);
Store the response array for further processing.
include_once("Mercury_Web_Services_SOAP_Helper.php");
$soapHelper = new Mercury_Web_Services_SOAP_Helper();
$responseData = $soapHelper->credit_transaction($requestData, $_REQUEST["Password"]);
Approved transactions will have a CmdStatus equal to "Approved".
if ($responseData["CmdStatus"] <> ""
&& $responseData["CmdStatus"] == "Approved")
{
echo "<font color=\"green\">";
echo "<h2>Approved Response Data</h2>";
print_r($responseData);
echo "</font>";
}
else
{
echo "<font color=\"red\">";
echo "<h2>Declined/Error Response Data</h2>";
print_r($responseData);
echo "</font>";
}