Provides a simple API to access payment gateways and process payments as a module hook.

Completed payments are stored in the database.

Two gateways are currently supported: PayPal and Moneybookers.

Payment forms can be created easily, for example:

<?php
function example_paypal_form($form_state, $product_id) {
 
$vars = array(
   
'module' => 'example',
   
'type' => 'example type',
   
'custom' => $product_id,
   
'item_name' => 'Example payment',
   
'no_shipping' => TRUE,
   
'no_note' => TRUE,
   
'return' => url('', array('absolute' => TRUE)),
   
'amount' => 100,
  );
 
$form = simple_payments_paypal_payment_form($vars);
 
$form['button'] = array(
   
'#type' => 'button',
   
'#value' => t('Pay with PayPal'),
  );
  return
$form;
}
$output = drupal_get_form('example_paypal_form', $product_id);
?>

Completed payments can be processed with hook_simple_payment_process($payment) .

The API is documented in more detail in the source code in Doxygen format.

A couple of PayPal payment verification functions were derived from Simple Paypal framework.

If you need something more elaborate (like a cart!), use Commerce.

Project Information

Downloads