<?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(); print_r($pp->Response);