IPN Help

polarweb

Jeremiah
Well, I deleted a thread cause I thought of something as I was posting that I tried, but it didnt work and I am back to square one with a new post.

Anyhow, the IPN example script is working after payment, everything looks good there. I am trying to modify this for what I had before on Fabrik 2.

I am trying to collect the user's email address provided on the form instead of using the payer_email that comes with the paypal ipn. Here is the script I was using for Fabrik 2, I tried the same thing for my new IPN script and for whatever reason its not working:
PHP:
$custom = JRequest::getVar('custom');
list($formid, $rowid, $ipn_value) = explode(":", $custom);
$listModel =& JModel::getInstance('Table', 'FabrikModel');        
$listModel->loadFromFormId($formid);
$data = $listModel->getRow($rowid, false, true);
PHP:
$payer_email = $data->eals_fabrik_ariana___email_address;
Any thoughts or ideas?
 
As a complete guess.... ;D


Code:
$listModel = JModel::getInstance('List', 'FabrikFEModel');


I can't diagnose the rest though but this may get you further. Post back and let us know.
 
Updated..

I updated it, with what you recommended. It didn't work and I was able to dig up the error log. Here is the result..

PHP:
PHP Fatal error:  Call to a member function getCfg() on a non-object in /home/epicorgo/public_html/plugins/fabrik_form/paypal/scripts/ariana_ipn.php on line 18

Here's line 18??
PHP:
$MailFrom = $mainframe->getCfg('mailfrom');

Makes no sense why this is wrong, unless...we need to expand on $mainframe...something like...just guessing here...

PHP:
$mainframe = JFactory::getApplication();

I am really new at PHP, so I could be totally off..not sure how to apply this JFactory::getApplication tho..
 
I fixed it..

I am getting better at this PHP thing..here's what I did to fix the errors:

I changed this:
PHP:
global $mainframe;
$MailFrom = $mainframe->getCfg('mailfrom');
$FromName = $mainframe->getCfg('fromname');
$SiteName = $mainframe->getCfg('sitename');
To:
PHP:
$app = JFactory::getApplication();
$MailFrom = $app->getCfg('mailfrom');
$FromName = $app->getCfg('fromname');
$SiteName = $app->getCfg('sitename');
Apparently they say: NOTE: The use of the global variable $mainframe has been deprecated as of 1.5 and has been removed in 1.6.

http://docs.joomla.org/Application_(CMS)

As I love Fabrik, I went ahead and made a fix to the IPN Example Script. Uploaded as text.. ;)
 

Attachments

  • paypal_ipn_example.txt
    4.9 KB · Views: 221
The thing that makes no sense here, is why the global variable was working on the example script, but not on the one I added the email inquiry..
 
Better would probably be:

PHP:
$config = JFactory::getConfig();
$MailFrom = $config->getvalue('mailfrom');
$Fromname = $config->getValue('fromname', $Mailfrom);
$SiteName = $app->getCfg('sitename');

Try that, let me know if it works.

-- hugh
 
Not Able To Test It

I am unable to test that line of code now. I am having a seperate issue altogether now with Paypal Plugin.

Upon form submit, data goes into the database, and the email plugins are working.

Problem Is:

Form plugin paypal does not send user to Paypal for payment and a pop-up box appears. I am at wits end trying to figure out what I changed that caused all this to start occuring.

The only thing I am seeing in the error log at this point is this:

PHP:
PHP Fatal error:  Call to undefined method stdClass::getForm() in /home/epicorgo/public_html/components/com_fabrik/views/form/view.html.php on line 39

I even went back and tried using the original IPN example file, no file, no matter what, its doing this now..and I haven't modified anything else in terms of coding..
 

Attachments

  • screenshot.jpg
    screenshot.jpg
    24.8 KB · Views: 170
PHEW, Thank Goodness...:eek:

I found out the problem. It is originating from me using the Content Plug In. Somewhere, this is conflicting with the Paypal Plugin. Don't ask me how, I was able to get the form to redirect to paypal after changing my Joomla Menu Item back to Fabrik->Form, instead of Single Article with Content Plugin...

I like using this view, because the CSS is cleaner inside the article, as opposed to the Form INTRO description in Fabrik.

I am considering building new Fabrik Templates altogether, but for the moment, I don't have time..

I'll be right back to let you know if that snippet of code worked..
 
That line of code you recommended DOES NOT work for my IPN script.

However, this does, a slight variation to yours:

PHP:
$config = JFactory::getConfig();
$MailFrom = $config->getvalue('mailfrom');
$FromName = $config->getvalue('fromname');
$SiteName = $config->getvalue('sitename');
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top