Return to Snippet

Revision: 33075
at October 5, 2010 23:12 by mikael12


Initial Code
define('PAYPAL_BUSINESS', '[email protected]');
define('PAYPAL_URL', 'https://www.paypal.com/cgi-bin/webscr');
define('PAYPAL_RETURN_URL', 'http://www.domain.com/process-paypal-response.php');

$amount = explode('.', number_format($post_price, 2));
$paypal_data = array(
		'cmd' => '_xclick',
		'business' => PAYPAL_BUSINESS,
		'item_name' => 'Order '.$order_id,
		'item_number' => $order_id,
		'amount' => $amount[0].'.'.$amount[1],
		'currency_code' => 'EUR',
		'button_subtype' => 'services',
		'no_shipping' => 1,
		'custom' => 'buy_now',
		'return' => PAYPAL_RETURN_URL
	);

header('Location: '.PAYPAL_URL.'?'.http_build_query($paypal_data));

Initial URL


Initial Description
PayPal test account can be created at https://developer.paypal.com/
HTML Variables for Website Payments Standard at https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables

Initial Title
PayPal xclick payment

Initial Tags


Initial Language
PHP