Hi I tried the notify_url but it didnt work can you see if I am doing any error.
or do i need to change any any setting in paypal site to activate notify_url
Here is my html code for the form
=============== =============== =============== ===
[code=html]<input type="Hidden" name="cmd" value="_xclick" >
<input type="Hidden" name="business" value="username @hotmail.com">
<!-- Allow customer to enter desired quantity -->
<input type="Hidden" name="undefined _quantity" value="1">
<input type="Hidden" name="item_name " value="Registra ion">
<input type="Hidden" name="item_numb er" value="">
<!-- No currency_code variable has been specified, so monetary amount is assumed to be USD -->
<input type="Hidden" name="amount" value="10">
<! Passthrough variables for order tracking or other purpose -->
<input type="Hidden" name="custom" value="">
<input type="Hidden" name="invoice" value="">
<input type="Hidden" name="charset" value="">
<input type="Hidden" name="no_shippi ng" value="1">
<input type="Hidden" name="return" value="">
<input type="Hidden" name="cancel_re turn" value="">
<!-- Do not prompt customer to include a note with the purchase -->
<input type="Hidden" name="no_note" value="1">
<input type="Hidden" name="rm" value="2">
<input type="Hidden" name="notify_ur l" value="">
<input id=UserName style="WIDTH: 165px" tabindex=1 maxlength=16 name="Name">
<input id=PasswordVeri fy style="WIDTH: 165px" tabindex=3 type=text maxlength=15 name="Phone">
<input id=EMail style="WIDTH: 165px" tabindex=4 name="Email">
<input type=submit value=Submit Now name=Authorize onClick="update valuesonsubmit( )">
<script language="JavaS cript" type="text/JavaScript">
function updatevaluesons ubmit()
notify_url = "http://mysite.com/Payment-Complete.php?";
notify_url = notify_url + "Name=" + frm.Name.value;
notify_url = notify_url + "&Phone=" + frm.Phone.value ;
notify_url = notify_url + "&Email=" + frm.Email.value ;
notify_url = notify_url + "&Country=" + frm.Country.val ue;
notify_url = notify_url + "&Product=" + frm.Registraion .value;
notify_url = notify_url + "&Amount=" + frm.amount.valu e;
frm.notify_url. value = notify_url;
</Script>[/code]
****
When user clicks on submit I am running updatevaluesons ubmit javascript to update notify_url field (I checked this and it works fine)
then it opens paypal site but when user makes payment it does not run Payment-Complete.php.
here is the code of Payment-Complete.php to send email. but it does not send email
=============== =============== =============== =========
Payment-Complete.php:
[code=php]<?php
// multiple recipients
$to = '__MUNGED__'; //
$companyname = 'My comany';
//Put name of cc. put " $cc = '' " if not required
$cc = '__MUNGED__';
//Put name of bcc. put " $bcc = '' " if not required
$bcc = '';
// subject
$subject = 'Payment Complete';
// message
$mailBody = '';
$mailBody = $mailBody . '
<table border="0" bordercolor="#0 00000" rowheight="30" width="400" cellspacing="1" celpadding="1">
<tr>
<td align="center" bgcolor="#CCCCC C" colspan="2" height="30"><b>
<font face="Arial" size="2">Person al Details</font></b></td></tr>';
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Name : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Name']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Email : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Email']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Phone : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Phone']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Produc t : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Product']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Amount : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Amount']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Countr y : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Country'].'</td></tr></table><BR><BR>' ;
$mailBody = $mailBody .'<font face="Arial" size="2">Thank you, <br><br>';
$mailBody = $mailBody .'from<b> ' . 'ABC.com' . '</b><br><br><br> </font>';
$headers = '';
// To send HTML mail, the Content-type header must be set
//$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: ' . $companyname . '<' . $to . '>' . "\r\n";
$headers .= 'From: '.$_REQUEST['Name'].' <'.$_REQUEST['Email'].'>' . "\r\n";
if ($cc!='')
{
$headers .= 'Cc:' . trim($cc) ."\r\n";
}
if ($bcc!='')
{
$headers .= 'Bcc: ' . trim($bcc) . "\r\n";
}
// Mail it
mail($to, $subject, $mailBody, $headers);
//Open thank you page
//include("thank-you.htm");
?>[/code]
=============== ====
Please help!!
Thanks,
Yogesh
or do i need to change any any setting in paypal site to activate notify_url
Here is my html code for the form
=============== =============== =============== ===
[code=html]<input type="Hidden" name="cmd" value="_xclick" >
<input type="Hidden" name="business" value="username @hotmail.com">
<!-- Allow customer to enter desired quantity -->
<input type="Hidden" name="undefined _quantity" value="1">
<input type="Hidden" name="item_name " value="Registra ion">
<input type="Hidden" name="item_numb er" value="">
<!-- No currency_code variable has been specified, so monetary amount is assumed to be USD -->
<input type="Hidden" name="amount" value="10">
<! Passthrough variables for order tracking or other purpose -->
<input type="Hidden" name="custom" value="">
<input type="Hidden" name="invoice" value="">
<input type="Hidden" name="charset" value="">
<input type="Hidden" name="no_shippi ng" value="1">
<input type="Hidden" name="return" value="">
<input type="Hidden" name="cancel_re turn" value="">
<!-- Do not prompt customer to include a note with the purchase -->
<input type="Hidden" name="no_note" value="1">
<input type="Hidden" name="rm" value="2">
<input type="Hidden" name="notify_ur l" value="">
<input id=UserName style="WIDTH: 165px" tabindex=1 maxlength=16 name="Name">
<input id=PasswordVeri fy style="WIDTH: 165px" tabindex=3 type=text maxlength=15 name="Phone">
<input id=EMail style="WIDTH: 165px" tabindex=4 name="Email">
<input type=submit value=Submit Now name=Authorize onClick="update valuesonsubmit( )">
<script language="JavaS cript" type="text/JavaScript">
function updatevaluesons ubmit()
notify_url = "http://mysite.com/Payment-Complete.php?";
notify_url = notify_url + "Name=" + frm.Name.value;
notify_url = notify_url + "&Phone=" + frm.Phone.value ;
notify_url = notify_url + "&Email=" + frm.Email.value ;
notify_url = notify_url + "&Country=" + frm.Country.val ue;
notify_url = notify_url + "&Product=" + frm.Registraion .value;
notify_url = notify_url + "&Amount=" + frm.amount.valu e;
frm.notify_url. value = notify_url;
</Script>[/code]
****
When user clicks on submit I am running updatevaluesons ubmit javascript to update notify_url field (I checked this and it works fine)
then it opens paypal site but when user makes payment it does not run Payment-Complete.php.
here is the code of Payment-Complete.php to send email. but it does not send email
=============== =============== =============== =========
Payment-Complete.php:
[code=php]<?php
// multiple recipients
$to = '__MUNGED__'; //
$companyname = 'My comany';
//Put name of cc. put " $cc = '' " if not required
$cc = '__MUNGED__';
//Put name of bcc. put " $bcc = '' " if not required
$bcc = '';
// subject
$subject = 'Payment Complete';
// message
$mailBody = '';
$mailBody = $mailBody . '
<table border="0" bordercolor="#0 00000" rowheight="30" width="400" cellspacing="1" celpadding="1">
<tr>
<td align="center" bgcolor="#CCCCC C" colspan="2" height="30"><b>
<font face="Arial" size="2">Person al Details</font></b></td></tr>';
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Name : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Name']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Email : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Email']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Phone : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Phone']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Produc t : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Product']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Amount : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Amount']."</td></tr>";
$mailBody = $mailBody . '<tr>
<td align="right" bgcolor="#CCCCC C" height="30"><fo nt face="Arial" size="2">Countr y : </td>
<td bgcolor="#EAEAE A"><font face="Arial" size="2">';
$mailBody = $mailBody . $_REQUEST['Country'].'</td></tr></table><BR><BR>' ;
$mailBody = $mailBody .'<font face="Arial" size="2">Thank you, <br><br>';
$mailBody = $mailBody .'from<b> ' . 'ABC.com' . '</b><br><br><br> </font>';
$headers = '';
// To send HTML mail, the Content-type header must be set
//$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: ' . $companyname . '<' . $to . '>' . "\r\n";
$headers .= 'From: '.$_REQUEST['Name'].' <'.$_REQUEST['Email'].'>' . "\r\n";
if ($cc!='')
{
$headers .= 'Cc:' . trim($cc) ."\r\n";
}
if ($bcc!='')
{
$headers .= 'Bcc: ' . trim($bcc) . "\r\n";
}
// Mail it
mail($to, $subject, $mailBody, $headers);
//Open thank you page
//include("thank-you.htm");
?>[/code]
=============== ====
Please help!!
Thanks,
Yogesh
Comment