Sometimes you need a simple way to receive payments from your Drupal site without the complexity of a shopping cart. The Pay module provides the necessary mechanism for online payment handling in Drupal. Pay allows you to add a payment form to your site -- or to a specific piece of content on your site -- and enables a single-click payment transaction. No cart, no check-out necessary.
Shouldering the heavy-lifting of transactions, the Pay module:
- provides an online payment form with the necessary fields for payment transactions
- securely sends the information from the payment form to the merchant service
- returns and stores the non-secure payment data in Drupal to be used for tracking and integration with other data from the site
With Pay as a stand-alone transaction API, front-end modules can be built for specific uses like ticket sales or crowd-source funding, and hand the actual transactions on to Pay.
Payment Forms
A module using the Payment API can be very simple or very complex, implementing any number of business rules that result in a payment request. From there, Pay collects payment information and submits it through a configured payment backend. All payment activities, no matter what they're for, are stored in one place for tracking and reporting purposes.
The Donate module which ships with Pay is an example of how the Pay API can be extended to provide customizable payment forms for a site. Donation allows for the creation of any number of forms, each with it's own menu path, header or footer messages, payment options and confirmation message.
Embedded payment forms
A payment form can be stand-alone, as on a shopping cart checkout page or the donation forms provided by Donate. But more often than not, you want to include payment capabilities in other forms. This might include the user registration form on a pay-to-register site, a donation suggestion on a webform submission, or collecting money on a signup form.
The Node Payments module, included with Pay, demonstrates the use of this functionality by allowing you to attach or create payment forms on any node type. This is useful for pledge drives and other donation campaigns.
Payment backends
A payment form can support one or more payment methods, using the functionality of a payment method handler. Support for the following backends is included with Pay:
- Authorize.Net
- Payflow Pro
The Pay API can be easily extended for multiple backend payment service providers like Amazon, Google Checkout, Authorize.Net CIM, etc.
Benefits of using a Payment API
There are lots of reasons to ask for money online, but the basic mechanism for exchanging money remains the same. Meanwhile, there are dozens of payment gateway services each with its own complicated API, that must be supported in order to handle the uses of all the sites out there. A single, stable payment acceptance mechanism allows module maintainers to focus on the fun part of collecting money.
It's also useful to have a single place to report on all payment transactions, no matter where they're from. By using a central payment mechanism, you can report on all transactions at once, whether they're shopping cart purchases, event registrations, donations, or anything else.
The Pay Module in Action
The Cedar Cultural Center is a Twin Cites non-profit music club that uses the Pay Module to collect donations online. The process is simple, the Pay Donation module extends pay to provide a customizable donation form.

To complete the transaction, the user selects a donation level, and fills in their credit card information and personal demographic information. On submit, the payment is made via the payment processor. No need for carts and intermediate processing steps. No cart overhead, no abandoned transactions in some form state of the cart.
The results of the payment are reported back to the site, and recorded in the customer's profile history.
The Pay API can be extended by other modules besides Donate to collect and track payments. Through this process, any module can provide a payment form for collecting the payment specifics.
On the backend, the Pay API interacts with definable payment processor modules to handle the payment proces. The process is interchangeable and extendable.