# RedHen CRM Donation

## About RedHen Donation

RedHen Donation allows for a RedHen Donation field to be attached to an entity, which attach a form to that entity for processing donations.
It integrates with Drupal Commerce to handle order processing and payment handling.
It relies on Commerce Card on File and Commere Recurring to process recurring donations.

## Notes

* Donation products should have an amount of 0.
* Recurring donations requires the patches found at:
  * Commerce Recurring
    * https://drupal.org/node/2273443
    * https://drupal.org/node/2263371
  * Commerce Card on File
    * https://drupal.org/node/2275263

## Required Modules
* redhen_contact
* commerce_checkout
* commerce_product
* commerce_recurring
* commerce_cardonfile
* select_or_other

## Configuration
The following are prerequisites to setting up RedHen Donation:
* Drupal Commerce installed and functioning.
* At least one Payment Processor configured in Drupal Commerce.
* At least one RedHen Contact Type setup.

1. Create a Donation Type
* Go to Structure -> RedHen CRM -> Donation Types.
* Click “Add a Donation Type”.
* Complete the settings:
  * Label - Identifier for this Donation Type.
  * Contact Type - the type of RedHen Contact to create when processing a
    donation, if no matching Contact is found based on the provided email
    address.
  * Update Contact Fields - If a matching Contact is found, should the
    Donation Form contact field values (Address, etc) be used to update the
    Contact. (If checked, this can overwrite the existing values in your RedHen
    CRM for this Contact.)
  * One Time Product Type - The Commerce Product Type for non-recurring
    Donations generated by this Donation Type.
  * Order Type - The Commerce Order type to create when processing a Donation.
    (Only appears if multiple options exist.)
  * Line Item Type - The type of Line Item to create for the Donation.
    (Only appears if multiple options exist.)
* Save your new Donation Type.
* Click the “Manage Fields” link next to your new Donation Type to add fields to
  your Donation form. For example, you might want to provide an “In Honor of”
  field for certain Donation Types. You can add any type of Drupal Field here.

2. Create a Donation-enabled Entity
* Either create a new Content Type, or edit an existing one.
* Add a field to your Content Type of type “Donation”.

3. Create a Donation Page
* Either create a new Entity of the type from step 2, or edit an existing one.
* Select a valid Donation Type for your Donation Field on your Entity.
* Save your Entity
* View your Entity
* Next to the Entity’s “Edit” tab, click the “Manage Donations” tab.
* Click the “Settings” sub-tab and configure the Donation Page settings:
  * Enable - Check to enable the Donation.
  * Scheduling - Configure dates to automatically enable/disable Donations
  * Confirmation Page - Enter a page to direct users to after they complete
    their donations.
  * Donation Entry - Select the form element for entering a donation amount.
  * Minimum Donation & Maximum Donation - Restrict the donation amounts.
  * RedHen Field Selector - This will list all the non-address fields on your
    RedHen Contact Type. Check the boxes to add those fields to your Donation
    form in the Contact area, allowing you to gather additional data for the
    creation & updating of RedHen Contacts. (Note that if a Contact of a
    different type than the default for this donation is updated this way, these
    fields may not exist on that Contact type and won’t be updated. Overlapping
    fields WILL be updated.)
  * One Time Product” & “Recurring Product - Select the Product Type to create
    when processing donations.
  * Billing Profile Syncing Field - The  address field on the RedHen Contact to
    sync with the Billing Address data provided for the Donation.
  * Payment Methods - Select your Commerce Payment Method, and the appropriate
    currency for that payment method. If you want to provide multiple-currency
    ready Donation Forms, you can add multiple Payment Methods to this field,
    and the users will be allowed to select which payment method to use while
    making donations.
* Save your settings
