You are here

README.txt in Creditfield Form Element 8

Introduction
===============

Creditfield is a small proof of concept module that provides 3 form elements to be used in the Drupal FormAPI for custom forms:

- Credit Card Number
- Credit Card Expiration Date
- Credit Card Code

These fields provide basic validation and form errors on their own (including Luhn check against card number). 
You could easily add more within your own form validation callbacks as well.

Why would I use this module?
============================

If you're a developer who implements custom payment forms such as a billpay or invoice payment, you may find this useful. With the predefined credit card form 
field types, all the basic validation is written, plus a expiration date field, so you don't have to duplicate code in multiple payment forms.

If you're not a developer or looking for a more robust solution, you may want to investigate Pay (http://drupal.org/project/pay).

How to Use
===============

Within your custom form code, you can call the form field types like so:

$form['credit_card_number'] = array(
  '#type' => 'creditfield_cardnumber',
  '#title' => 'Credit Card Number',
  '#maxlength' => 16,
);
    
$form['expiration_date'] = array(
  '#type' => 'creditfield_expiration',
  '#title' => 'Expiration Date',
);

$form['credit_card_cvv'] = array(
  '#type' => 'creditfield_cardcode',
  '#title' => 'CVV Code',
  '#maxlength' => 4,
  '#description' => 'Your 3 or 4 digit security code on the back of your card.',
);

This will display simple form fields that contain validation code checks for payment information.

Currently, the following validation is performed:

- Valid card number (using Luhn algorithm to check card length)
- Valid Expiration Date

What this module doesn't do
===========================

This module does -not- handle submitting payment data to payment processors. It also does not validate against specific card types (Visa, MC, etc). That 
part is entirely up to you.

Warnings
===============

You should never ever store credit card data in a database, cache or watchdog. This will invalidate any PCI compliance you might have.

If you feel like you need the ability to store data, you may want to look into something such as Authorize.net CIM integration, which will store it on
the payment gateway side, instead of Drupal.

File

README.txt
View source
  1. Introduction
  2. ===============
  3. Creditfield is a small proof of concept module that provides 3 form elements to be used in the Drupal FormAPI for custom forms:
  4. - Credit Card Number
  5. - Credit Card Expiration Date
  6. - Credit Card Code
  7. These fields provide basic validation and form errors on their own (including Luhn check against card number).
  8. You could easily add more within your own form validation callbacks as well.
  9. Why would I use this module?
  10. ============================
  11. If you're a developer who implements custom payment forms such as a billpay or invoice payment, you may find this useful. With the predefined credit card form
  12. field types, all the basic validation is written, plus a expiration date field, so you don't have to duplicate code in multiple payment forms.
  13. If you're not a developer or looking for a more robust solution, you may want to investigate Pay (http://drupal.org/project/pay).
  14. How to Use
  15. ===============
  16. Within your custom form code, you can call the form field types like so:
  17. $form['credit_card_number'] = array(
  18. '#type' => 'creditfield_cardnumber',
  19. '#title' => 'Credit Card Number',
  20. '#maxlength' => 16,
  21. );
  22. $form['expiration_date'] = array(
  23. '#type' => 'creditfield_expiration',
  24. '#title' => 'Expiration Date',
  25. );
  26. $form['credit_card_cvv'] = array(
  27. '#type' => 'creditfield_cardcode',
  28. '#title' => 'CVV Code',
  29. '#maxlength' => 4,
  30. '#description' => 'Your 3 or 4 digit security code on the back of your card.',
  31. );
  32. This will display simple form fields that contain validation code checks for payment information.
  33. Currently, the following validation is performed:
  34. - Valid card number (using Luhn algorithm to check card length)
  35. - Valid Expiration Date
  36. What this module doesn't do
  37. ===========================
  38. This module does -not- handle submitting payment data to payment processors. It also does not validate against specific card types (Visa, MC, etc). That
  39. part is entirely up to you.
  40. Warnings
  41. ===============
  42. You should never ever store credit card data in a database, cache or watchdog. This will invalidate any PCI compliance you might have.
  43. If you feel like you need the ability to store data, you may want to look into something such as Authorize.net CIM integration, which will store it on
  44. the payment gateway side, instead of Drupal.