Welcome, Guest
  • Page:
  • 1
  • 2

TOPIC: How to Use PayPal with Classic Forms

Re:How to Use PayPal with Classic Forms 5 years 9 months ago #8574

  • iamwaggle
  • iamwaggle's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 2
  • Karma: 0
Hey! I figured it out myself! I hope this helps someone! ~Justin

Put Ken's code above in the "After Submit" area instead of the "Before Submit" area in the "Edit Form" section under the "Submit Pieces" tab. Set your return URL to something like this:
http://YOURSITEHERE.com/index.php?option=com_facileforms&ff_name=arcRNEW12&ff_page=1&Itemid=$this->record_id.
If you want a thank you page, add a page to the form and change the $ff_page here to 2.

Put the following code in the "Before Form" area under the "Form Pieces" tab.
if(!$_REQUEST['tx'] == ''){

if ($_REQUEST['test'] == 1){
$test = 1;
}else{
$test = 0;
}

$time_offset ="0"; // Change this to compensate for timezone differences (-3 = -3 hours)
$time_a = ($time_offset * 60 * 60);
$datetime = date("Y-m-d H:i:s",time() + $time_a);


$this->execPieceByName('ff_InitLib');

    ff_query(
        "update `#__facileforms_records` ". 
        "SET " . 
        "`paypal_tx_id` = 'PayPal: " . $_REQUEST['tx'] . "', ".
        "`paypal_payment_date` = '" .  $datetime . "', ".
        "`paypal_testaccount` = '" . $test . "' " . 
        "WHERE `id`=" . $_REQUEST['Itemid'] . " AND `paypal_tx_id`='' " .
        "LIMIT 1" 
    );
}
Last Edit: 5 years 9 months ago by iamwaggle.
The administrator has disabled public write access.
The following user(s) said Thank You: wartime

Re:How to Use PayPal with Classic Forms 5 years 9 months ago #8583

  • arc_admin
  • arc_admin's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 23
  • Thank you received: 4
  • Karma: 0
Hi rewing,

Apologies, but my test site is cluttered enough without installing 'guest packages'.

If you describe the problem in detail perhaps I can help, or maybe someone else will have an idea. Or, I'll be happy to have a look on your own site if you give me credentials to look (I'm not a mad hacker, don't worry).

Cheers,
Ken
The administrator has disabled public write access.
The following user(s) said Thank You: wartime

Re: How to Use PayPal with Classic Forms 3 years 6 months ago #65105

  • pattford
  • pattford's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 1
  • Karma: 0
I'm using these scripts successfully with a Classic form -- minor modifications added. However, I would like to restrict Admin Email function to ONLY send notification if the payment is successful (as seen in the Quickmode examples). If the payment is not successful (e.g., the user canceled out in Paypal before completing the payment) no form data should be emailed to the Admin.

My form uses scripts found in this forum topic "How to use Paypal with Classic form", including the added script to record the successful Paypal validation in the form record. This last script is in the "Before Form" piece.

To send the Admin an email with the form data ONLY WHEN payment is successful, how do I get the form data for building the email, and where do I place the code to send the email? For example, if I add the SendMail to the "Before Form" piece as part of the successful payment routine, how do I retrieve the form data to build the email? I'm assuming that because this piece is "Before Form", the data is no longer accessible via $this->maildata and _FF_DATA_VALUE ...... is that correct?
The administrator has disabled public write access.
The following user(s) said Thank You: wartime

Re: How to Use PayPal with Classic Forms 2 years 5 months ago #86236

  • stuartjbarr
  • stuartjbarr's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 2
  • Karma: 0
I've followed the above instructions, and added the code to the Begin Submit piece as described at the start of this thread. I do have Paypal integration basically working, such that I can submit a payment.

However, on successful payment, I would like to submit the values, and have the emails sent, as is done in QuickMode using the Paypal integration, which is where this thread seems to have ended 1 year ago.

Does anybody know how to do this?

Thanks,
Stuart
The administrator has disabled public write access.
The following user(s) said Thank You: wartime
  • Page:
  • 1
  • 2
Time to create page: 0.213 seconds

Lifetime Subscription

Get lifetime access to all of our current and future products and 2 years of professional support -- for just $119 USD.

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, WordPress® plugins, Joomla!® templates   this means, by purchasing a Lifetime Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our 1-Year or Lifetime Subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Supporting the Joomla! Community

Offical Joomla! User Groups and organizers of Joomla! Days, registered at Joomla.org, are supported by Crosstec, worldwide!

If you are running a JUG or organize a Joomla! Day and you need any of our products, just write an email to info@crosstec.org and you'll get a Lifetime Membership for free!

Live Chat Software