PHP – PayPal PayFlow Link Payment Gateway

Payflow Link is a secure, reliable payment gateway and operated by PayPal. A payment gateway sends
billing information to banks to authorize, process, and manage payments that come from online,
mail, and telephone orders. Financial institutions require billing information for these orders
to be transmitted through a certified, secure connection such as the Payflow Link payment gateway
from PayPal. 

Code Example: Download Example
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PayPal PayFlow Link</title>
</head>

<body>
<form name="paypal_payflow_link" action="https://payflowlink.paypal.com" method="post">
  LOGIN:
  <input type="text" name="LOGIN" value="your login info">
  <br />
  PARTNER:
  <input type="text" name="PARTNER" value="your partner id">
  <br />
  AMOUNT:
  <input type="text" name="AMOUNT" value="25.55">
  <br />
  CUSTOMER ID:
  <input type="text" name="CUSTID" value="12345">
  <br />
  NAME:
  <input type="text" name="NAME" value='Bill M'>
  <br />
  NAME TO SHIP:
  <input type="text" name="NAMETOSHIP" value='Jamse M'>
  <br />
  ADDRESS:
  <input type="text" name="ADDRESS" value='12 St. John'>
  <br />
  ADDRESS TO SHIP:
  <input type="text" name="ADDRESSTOSHIP" value='11 Montogmery'>
  <br />
  CITY:
  <input type="text" name="CITY" value='Escodia'>
  <br />
  CITY TO SHIP:
  <input type="text" name="CITYTOSHIP" value='Escodia'>
  <br />
  STATE:
  <input type="text" name="STATE" value='CA'>
  <br />
  STATE TO SHIP:
  <input type="text" name="STATETOSHIP" value='CA'>
  <br />
  COUNTRY:
  <input type="text" name="COUNTRY" value='US'>
  <br />
  COUNTRY TO SHIP:
  <input type="text" name="COUNTRYTOSHIP" value='US'>
  <br />
  ZIP:
  <input type="text" name="ZIP" value='92030'>
  <br />
  ZIP TO SHIP:
  <input type="text" name="ZIPTOSHIP" value='92030'>
  <br />
  PHONE:
  <input type="text" name="PHONE" value='111-111-111'>
  <br />
  FAX:
  <input type="text" name="FAX" value='111-444-5555'>
  <br />
  SHIP AMOUNT:
  <input type="text" name="SHIPAMOUNT" value='2.50'><br />
  COMMENT:
  <input type="text" name="COMMENT1"value='Bill M Order'>
  <br />
  CUSTOM FIELD:
  <input type="text" name='USER1' value='custom field 1'>
  <br />
  CUSTOM FIELD:
  <input type="text" name='USER2' value='custom field 2'>
  <br />
  <input type="hidden" name="ORDERFORM" value='True'>
  <input type="hidden" name="SHOWCONFIRM" value='True'>
  <input type="hidden" name="TYPE" value='S'>
  <input type="hidden" name="METHOD" value="CC">
  <input type="hidden" name="POSTURL" value="www.yoursite.com/finished.php">
  <input type="hidden" name="RETURNURL" value="www.yoursite.com">
  <input type="submit" value="Submit Data" />
</form>
</body>
</html>
finished.php
<?php
if (($RESULT == 0) && ($RESPMSG == "Approved")) {
	// do what you want.
}
else{
	echo "<font size=4>There was a problem with your credit card details.</font><br>\n",
		 "The credit check system returned...<br>\n",
		 "<hr>", $RESPMSG, "<br>\n";
}
?>

Post to Twitter Post to Digg Post to Facebook Post to Google Buzz Send Gmail

Leave a Comment

Your email address will not be published. Required fields are marked *