paypal

paypal_url = ‘https://www.sandbox.paypal.com/cgi-bin/webscr’;
//$p->paypal_url = ‘https://www.paypal.com/cgi-bin/webscr’;

$this_script = ‘http://’.$_SERVER[‘HTTP_HOST’].$_SERVER[‘PHP_SELF’];

if (empty($_GET[‘action’]))
$_GET[‘action’] = ‘process’;

switch ($_GET[‘action’])
{
case ‘process’:
$p->add_field(‘business’, ‘foto.paypal@delphinus.com.mx’);
$p->add_field(‘return’,’http://www.revistagenteqroo.com/gracias’);
$p->add_field(‘cancel_return’, ‘http://www.revistagenteqroo.com/anunciate-con-nosotros/’);
$p->add_field(‘notify_url’,’http://www.revistagenteqroo.com/paypal’);
$p->add_field(‘item_name’, $Concepto);
$p->add_field(‘item_number’, $NoPedido);
$p->add_field(‘amount’, $Precio);
$p->add_field(‘custom’, $ClienteNuevo);
$p->submit_paypal_post();
break;
case ‘success’:
echo «Success

Thank you for your order.

«;
foreach ($_POST as $key => $value) { echo «$key: $value
«; }
echo ««;
break;
case ‘cancel’:
echo «Canceled

The order was canceled.

«;
echo ««;
break;
case ‘ipn’:
if ($p->validate_ipn())
{
$subject = ‘Notificación de pago Instantaneo – Pago recibido’;
$to = ‘contacto@accesocancun.com’;
$body = «An instant payment notification was successfully recieved\n»;
$body .= «from «.$p->ipn_data[‘payer_email’].» on «.date(‘m/d/Y’);
$body .= » at «.date(‘g:i A’).»\n\nDetails:\n»;
foreach ($p->ipn_data as $key => $value)
{
$body .= «\n$key: $value»;
}
mail($to, $subject, $body);
}
break;
}
?>

Deja una respuesta