Location: PHPKode > scripts > Payflow Pro Frontend > payflow-pro-frontend/example.php
<?php

require("pfpro.class.inc");

$p = new PFPro("/home/phenaproxima/payflow/bin", "phena", "pRoXiMa", "verisign", "phena");

//Collect customer info
$addr = $_POST['address'];
$zip = $_POST['zipcode'];
$p->setCustomerInfo($addr, $zip);

$cc = $_POST['creditcard'];
$exp = $_POST['month'] . $_POST['year'];
$cvv = $_POST['cvv2'];
$price = $_POST['price'];
$p->setPaymentInfo($cc, $exp, $cvv, $price);

if($p->process() == false)
	die("<b>Error:</b>" . $p->geLastMessage());
else
{
	if(isInternational())
		$p->setSecurity("none", "none");
	else
		$p->setSecurity("medium", "medium");

	if($p->fraudCheck() == false)
	{
		//AVS and/or CVV checks failed
		if($p->void() == false)
			die("<b>Error voiding transaction</b>: " . $p->getLastMessage());
		else
			die("<b>Declined:</b> AVS or CVV check failed");
	}
	else
	{
		echo "<b>Transaction Approved, now refunding you because we sell useless junk</b><br />";
		if($p->credit() == false)
			die("<b>refund failed<b>: " . $p->getLastMessage());
		else
			die("Refunded. Spend your money elsewhere...");
	}
}

?>
Return current item: Payflow Pro Frontend