Location: PHPKode > scripts > PayPal Buy Now and IPN Classes > Example_Non_Encrypted_Button.phps
<?php
/*

	Non-Encrypted Buy Now Button Example
	(not recommended)

*/

// include class and init object
require 'paypal/Paypal.php';
$p = new Paypal;

// the paypal or paypal sandbox url
$p->paypal_url = 'https://www.paypal.com/cgi-bin/webscr';

// the timeout in seconds before the button form is submitted to paypal
// this needs the included addevent javascript function
// 0 = no delay
// false = disable auto submission
$p->timeout = false;

// the button label
// false to disable button (if you want to rely only on the javascript auto-submission) not recommended
$p->button = 'Buy Now';

// use encryption (strongly recommended!)
$p->encrypt = false;


// the actual button parameters
// https://www.paypal.com/IntegrationCenter/ic_std-variable-reference.html
$p->add_field('charset','utf-8');
$p->add_field('currency_code','USD');
$p->add_field('business', 'hide@address.com');
$p->add_field('return', 'http://example.com/thanks');
$p->add_field('cancel_return', 'http://example.com/cancel');
$p->add_field('notify_url', 'http://example.com/ipn.php');
$p->add_field('item_name', 'PHP Class Example');
$p->add_field('item_number', '1337');
$p->add_field('amount', '1000');


// output the button
echo $p->get_button();

?>
Return current item: PayPal Buy Now and IPN Classes