Beispiel #1
0
$pending_reason = $_POST['pending_reason'];
$payment_type = $_POST['payment_type'];
$custom_key = $_POST['custom'];
if (strcmp($response, "VERIFIED") == 0) {
    // Verifico el estado de la orden
    if ($payment_status != "Completed") {
        TransLog("El pago no fue aceptado por paypal - Estado del Pago: {$payment_status}");
        StopProcess();
    }
    //todo bien hasta ahora, la transacción ha sido confirmada por lo tanto puedo realizar mis tareas,
    //actualizar DB, stock, acreditar cómputos, activar cuentas etc etc
    TransLog("Pago Correcto - {$fullipn}");
    //notifico al webmaster
} else {
    //la transacción es invalida NO se puedo cobrarle al cliente.
    TransLog("Pago Inválido - {$fullipn}");
}
//función básica para las notificaciones
function notify_webmaster($message)
{
    $subject = "Nuevo Pago";
    $remite = "tu-email";
    $remitente = "Tu remitente";
    $header .= "MIME-Version: 1.0\n";
    $header .= "Content-type: text/html; charset=iso-8859-1\n";
    $header .= "From: " . $remitente . "<" . $remite . ">\n";
    $header .= "Return-path: " . $remite . "\n";
    $header .= "X-Mailer: PHP/" . phpversion() . "\n";
    mail("email-aqui-de-quiren-recibe", $subject, $message, $header);
}
//esta funcion puede utilizarse como almacenar en una variable global todas las acciones del script, de esta manera podremos rastrear errors facilmente.
    <tr>
        <td style="font-size: 26px; "><h2 style="width:85%; font-weight:normal; background: #ffffff; padding: 5%; margin:auto;">Welcome to Brandz<br/><br/></h2>
	<span style="font-size:16px;">Hello  ' . $emailid . ',<br/> Your Payment processing successfull.
        </td>
    </tr>
    <tr>
        <td style="height: 50px;"></td>
    </tr>
    
  </table>
    
</body>
</html>';
    //mail($to,$subject,$message,$header);
} else {
    TransLog("Invalid Transaction - {$ret}");
}
//}
function sentmail($mailid, $msg, $sub)
{
    //mail('*****@*****.**', 'sendtestipn', 'sendtestipn');
    $html = true;
    $mail = new eMail("clubpedia@localhost", "*****@*****.**");
    $mail->subject($sub);
    $mail->to($mailid);
    // CC-Entf\E4nger angeben
    $mail->cc("*****@*****.**");
    // BCC-Entf\E4nger angeben
    $mail->bcc("*****@*****.**");
    $mail->html($msg);
    $mail->send();