


In my site's custom module (I'm running Drupal 7 - code might need minor adaptations for 6.x), I added two simple hooks, shown below with comments to help define what's going on: PayPal has relatively robust documentation of it's Website Payments Standard API, and all we need to do is send an HTTP/HTTPS request to PayPal with certain parameters, defining to whom the payment should be sent, what the payment amount is, and some other options (including values sent in via our Webform). So when the paypal screen opens up the amount would already be displayed. hook_webform_submission_insert() is the perfect time to hook into Webform's process and send a user to PayPal, along with that user's data. It would be very helpful (and increase the functionality) if this module could pass an 'Amount' field in the webform through to Paypal. So when paypal-pro set-up in CiviCRM, webform civicrm takes business parameter.
#Drupal webform paypal pro#
To handle this way the parameter business should be the merchant email address, no the paypal pro username. Webform CiviCRM handling express checkout as Paypal-Standard IPN method.

However, after reading Additional processing in Drupal's Webform 3 module (from Drupal Coder), I found that Webform 3 has a hook that runs just after webform has saved a form's data to the database, but before the webform returns the user to a predefined redirected page. The Webform CiviCRM module is not handling express checkout as CiviCRM core handling. With older versions of PayPal, one could add some PHP code into a webform on the site to do this, but it was (a) hackish, and (b) a much less maintainable and secure way of accomplishing the goal I was trying to achieve. For quite some time, I've wanted to integrate a particular webform with PayPal, since many nonprofits I help use that payment service.
