Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
I copied and pasted the code for the paypal documentation into my site but I am unable to receive the email that confirms it. I have tried the debug on the paypal processer and it shows that Couch is receiving the IPN. I have posted some of my code below:

Code: Select all
<?php require_once( 'admin/cms.php' ); ?>
<cms:template title='Accounts' clonable='1' order='-1'>

<cms:editable name='pp_price' label='Price' desc='Amount in USD (correct upto 2 decimal points)'
  maxlength='10'
  search_type='decimal'
  validator='non_negative_decimal'
  type='text' />
  <cms:paypal_processor/>
</cms:template>


                  <cms:paypal_processor debug='1'>
                      <cms:if k_paypal_success>
                             <cms:send_mail from='accounts@buymcaccounts.com' to=pp_payer_email subject='Thank you for your purchase!' >
                                 Dear <cms:show pp_first_name /> <cms:show pp_last_name />,
                                
                                 Thank you for buying an account with the username: <b><cms:show pp_item_name /></b>.

                                 Here are the account login details:

                                 Email: <b>fffff</b>
                                 Password: <b>ffeeesss</b>

                                 Thank you,

                                 Buy MC Accounts
                                 <a href="http://buymcaccounts.com">buymcaccounts.com</a>
                            
                             </cms:send_mail>
                        
                      </cms:if>
                     
                      <cms:if k_paypal_error>
                          <cms:set msg="ERROR: <cms:show k_paypal_error/>" />
                          <cms:log msg />
                      </cms:if>
                  </cms:paypal_processor>


This is all posted at the very top of the file with a paypal button below. Does anyone have any ideas as to why the email isn't sending?
it shows that Couch is receiving the IPN.
Ok so that means that the transaction has been processed fine (I'll assume that it is also reporting success).

As to why the email is not being sent, perhaps your webhost has disallowed PHP mail() function (am seeing this reported quite frequently of late).

I replied to a similar problem just yesterday. Please take a look at it -
viewtopic.php?p=18113#p18113

Hope that helps.
KK,

Thanks for the reply. I don't think my host has disabled the mail() function because I host many sites with them and I use mail() all the time. I contacted them and they said they hadn't logged any outgoing emails. I then simplified the script to just display something on the screen after the payment was confirmed. That also doesn't work. I have posted that code below. Would you be willing to FTP into my site and take a quick look?

Code: Select all
<cms:paypal_processor debug='1'>
                      <cms:if k_paypal_success>
                         

                         HI

                         <cms:show pp_price/>
                      </cms:if>
                     
                      <cms:if k_paypal_error>
                          <cms:set msg="ERROR: <cms:show k_paypal_error/>" />
                          <cms:log msg />
                      </cms:if>
                  </cms:paypal_processor>
Not a problem. Please PM me the FTP + Couch super-admin creds.

I have a question for you, though.
You stated in the first post -
I have tried the debug on the paypal processer and it shows that Couch is receiving the IPN.
May I ask, what made you believe that the IPN was being received? Doesn't seem to be the case to me from the simplified code that you posted.

Can you let me know?
KK,

I have sent you a PM with the FTP and superadmin credentials.

I assumed that because the generated log file was returning my account name and email and such that Couch was receiving the IPN. That may be an incorrect assumption.

Thanks
Thanks.

I used the following code -
Code: Select all
<cms:paypal_processor debug='1'>
    <cms:if k_paypal_success>
       
        <cms:send_mail debug='1' from='accounts@xxx.com' to=pp_payer_email cc='accounts@xxx.com' subject='Thank you for your purchase!' >
             Dear <cms:show pp_first_name /> <cms:show pp_last_name />,
           
             Thank you for buying an account with the username: <b><cms:show pp_item_name /></b>.

             Here are the account login details:

             Email: <b>fffff</b>
             Password: <b>ffeeesss</b>

             Thank you,

             Buy MC Accounts
             <a href="http:/xxx.com">xxx.com</a>

         </cms:send_mail>

    </cms:if>
   
    <cms:if k_paypal_error>
        <cms:set msg="ERROR: <cms:show k_paypal_error/>" />
        <cms:log msg />
    </cms:if>
</cms:paypal_processor>

Then tried sending it IPN using PayPal's IPN simulator (https://developer.paypal.com/webapps/de ... _simulator).

The HTML generated by <cms:paypal_button /> shows the valid data to be used to test the IPN -
Used 'notify_url' as IPN handler and
'Web accept' as transaction type
Set 'business' as receiver_email
'pp_price' of item as mc_gross
item_name and item_number as the fields of the same name.

The simulator reported that the IPN was sent successfully.

The log.txt on server showed that the IPN was received successfully.
The cms:send_mail also reported mail being sent successfully.
I had placed myself in the 'cc' field and I received the mail successfully (have PMed you a screenshot).

So, as far as I could see, everything works as expected.
6 posts Page 1 of 1