Location: PHPKode > scripts > PayPal NVP Transactions > ChiperSoft-PayPal-NVP-Transactions-1c8d4b3/example.php

include 'classes/PayPalNVP.php';
include 'classes/PayPalCodes.php';
include 'classes/PayPal_DoDirectPayment.php';

$pp = new PayPal_DoDirectPayment(); //sandbox mode, no credentials supplied.
$pp->Amount 		= 56; //can be integer, float or string. Gets passed through number_format before being send to paypal
$pp->CardType 		= 'Visa'; //currently supports visa, mastercard, amex and discover.  See PayPalCodes::CardTypeCheck()
$pp->CardNumber 	= '4012888888881881'; //paypal visa test code
$pp->CardExpiration = '2018-11';
$pp->CardCVV2 		= '555';
$pp->FirstName 		= 'Jarvis';
$pp->LastName 		= 'Badgley';
$pp->Address 		= '12345 Example St';
$pp->City 			= 'San Diego';
$pp->State 			= 'CA'; //must be two character state code.  See PayPalCodes::$states
$pp->Zip 			= '92128';

echo $pp->send();


Return current item: PayPal NVP Transactions