| Drupal

drupal-paymentsHere at OSTraining we've given significant coverage to Drupal Commerce. You can watch a video class with nearly 30 lessons and download a book, "Building E-commerce Sites with Drupal Commerce".

However, Drupal Commerce is an enterprise-quality solution and a good number of OSTraining members have asked for simpler solutions.

For those members, we often recommend the Payment module, which makes it easy to add e-commerce fields to your content.

Payment supports about half-a-dozen gateways (PayPal, Stripe, iDEAL, Authorize.net, Ogone, Rabo OmniKassa).

In this tutorial, we'll show you how to use the Payment module, together with PayPal.

Installation and Configuration

media_1413322588233.png
  • Go to Configuration > Payment.
  • Click "Add payment method"
media_1413320043847.png
  • Choose "PayPal Payments Standard".
  • Enter a Title, such as "PayPal".
  • Enter your PayPal email into the "PayPal account email address" field.
media_1413320109680.png
  • By default, there are two default payment options, "Collect on delivery" and "No payment required". If you don't want users to be able to choose those options, you can go to Configuration > Payment > Payment methods and you can disable them.

Add a field to the content type

  • Go to Structure > Content types
  • Add a field using the "Payment form" type:
media_1413320405902.png
  • On the field settings, choose the currency you want to use:
media_1413320551410.png

Create a product

  • Click Add content and choose a content item you want to add a PayPal button to.
  • Under the Body, in the fields area, you'll be able to enter the product details:
media_1413320681244.png
  • Save the content.
  • This is how your content will appear on the site:
media_1413320750421.png
  • If people click the "Pay" button, they'll be redirected off your site and to Paypal.com:
media_1413320765846.png
  • Once the payment is finished, the user will be able see details of the payment:
media_1413320952014.png

Seeing the payments

After people have made purchases on your site, you'll be able to see and organize all the payments.

  • Go to Content > Find Content
  • Click the Payments tab in the top-right corner.
  • You'll now be able to see all the payments that have been made, including their status.
media_1413321227146.png

Payments does also integrate with Views (the image see above uses Views) so you can create your own layouts to see payments.

Summary

The Payment module is a basic, but effective alternative to Drupal Commerce.

Particularly if you don't want to require user registration or do significant configuration of your site, Payment is a good option for collecting money via your Drupal site.


About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.