Monday, 10 May 2010 13:03

How to connect RSForm Pro to PayPal using a custom amount field

Written by

I recently built a "Make a Payment" form for my clients using the RSForm Joomla extension and a little custom scripting.

I used the following fields:

  • Name
  • Email
  • Invoice number (This is not required)
  • Amount
  • Submit

Here is the script which is called on form process:

 


if (isset($_POST['form']['Amount']))
{
$business = This email address is being protected from spambots. You need JavaScript enabled to view it.';
$item_name = 'Payment on Invoice Number'.$_POST['form']['InvoiceNumber'];
$currency_code = 'USD';
$amount = $_POST['form']['Amount'];
header('Location: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business='.$business.'&item_name='.$item_name.'&currency_code='.$currency_code.'&amount='.$amount);
exit();
}


EDIT: I realized that the email notifications were not sending using this method.  If you also want the email notifications to go out, move this PHP code to the "call AFTER form process" box in RSForm.

BONUS READING: Connecting RSForm and Paypal using recurring payments

Last modified on Wednesday, 20 April 2022 18:36

Latest Comments

Got a similar email that seemed suspicious. Ignored it and they even followed up today.
My organization received one of these emails from "Linda," but uses https://www.bestprosintown.com/p...
Hi Nate, I got the same email template from the same email address today and found you through a ...
Just received one today (16 Aug 2022) from "Mailchimp". Thanks for sharing!
Thanks for posting this. I just got one today. I was 99% sure it was a scam, and your post confirmed...


Design & Development

Wordpress, Drupal, Joomla
New custom websites
Bespoke themes and extensions
Redesigns, upgrades, migrations

Web Design & Development


Optimization & SEO

Let us optimize and manage your overall online presence. We offer full service monthly SEO as well as one-time projects.  

Optimization Plans & Pricing


Maintenance, Patching

White glove monthly backups, security updates, maintenance and testing for your Wordpress, Drupal, or Joomla site.

Maintenance Plans & Pricing


Email Newsletter

Bring your web & marketing performance to the next level: monthly blog post roundup via email.  

Stay in Touch!