Forums

Combine the Redirect plugin w/ Paypal & Joomla Registration

designer84 30 Sep, 2011
Hi,

I've looked all over the forums and if I've missed how to do this, I apologize.

This is for v.1.3 (not v4).

I've taken a look here (http://www.chronoengine.com/tutorials/chronoforms-plugins/437-paid-registration-using-paypal-plugin.html) at this tutorial and although the outcome is exactly what I desire, the process is lacking for our situation. Instead of having a form to fill out payment info, we'd like to follow this path....

1. Direct our members to fill out the registration form info (I assume the Joomla Registration addon here)
2. Then direct to Paypal with payment either from a selection of "buy now" buttons or a dropdown menu (preferably the buttons - I assume the Redirect plugin here)
3. When the member returns to our site, maybe somehow integrate this code from the tutorial to check whether to see if all went well (specifically the Paypal check and delete customer)...

<?php
$MyPlugins =& CFPlugins::getInstance($MyForm->formrow->id);
if(!$MyPlugins->cf_joomla_registration['errors']){
  $MyPlugins->runPlugin('after_email', array('ONSUBMIT', 'ONLOADONSUBMIT'), 'cf_paypal_api');
  if($MyPlugins->cf_paypal_api['payment_status'] == 'SUCCESS'){
    echo  "Thank you for registering at Mysite.com. You will be recieving a confirmation email shortly";
    $MyFormEmails =& CFEMails::getInstance($MyForm->formrow->id);
    $MyFormEmails->setEmailData(1, 'enabled', '1');
    $MyFormEmails->sendEmails($MyForm, $MyFormEmails->emails);
  }else{
    $regUser = new JUser($MyPlugins->cf_joomla_registration['user']->id);
    $regUser->delete();
    $MyForm->addErrorMsg( 'An error occured : '.$MyPlugins->cf_paypal_api['error_message'] );
    $MyForm->haltFunction["autogenerated_after_email"] = true;
  }
}else{
  $MyForm->addErrorMsg($MyPlugins->cf_joomla_registration['errors']);
  $MyForm->haltFunction["autogenerated_after_email"] = true;
}
?>
 


Can someone please help me put this together and/or point me to a link that has this laid out already? Thank you!
GreyHead 01 Oct, 2011
Hi designer84 ,

To use the PayPal API you need to have a Paypal WebPayments Pro API enabled account! This will not work with a standard PayPal account.

If you have a standard PayPal account and want information back from PayPal then you can enable PayPal IPN. It's a bit fiddly to integrate in ChronoForms but is certainly possible.

Bob
This topic is locked and no more replies can be posted.