Contribution Forms
Creating Contribution Forms using FormBuilder¶
New functionality
Creating Contribution Forms using FormBuilder is a new alternative to Contribution Pages. You can help contribute to development by raising issues or new feature requests on the CiviCRM Issue Tracker.
This section describes using FormBuilder to create forms which can be used to make Contributions to your organisation.
FormBuilder allows creating a simple donation form, or complex checkout experiences with including Donations, Paid Memberships and/or Event Registrations.
Getting Started¶
-
FormBuilder Contributions is available in CiviCRM 6.14. You must upgrade to at least this version to get started.
-
You will need to install a Payment Processor extension that supports FormBuilder Contributions. At time of writing, the main integrations with support are Paypal Complete Payments or Stripe though more should be in the coming months. See Available Checkout Options below for details.
-
You will need to configure a Payment Processor connection for your chosen Payment Processor. The steps may vary for different processors - you may have to log in to a connection page or copy an API key from your account with the Payment Processor.
-
To edit forms through the UI, you will need to enable the FormBuilder extension if you haven't already.
-
You will need to enable FormBuilder Contributions functionality for your site by going to Administer > CiviContribute > CiviContribute Component Settings.
-
It will help if you have some familiarity with using FormBuilder, particularly if you wish to make a complex form with multiple entities (e.g. Memberships or Event Registrations).
Starter donation page¶
When you have enabled FormBuilder Contributions, a simple donation form should be available on your site at https://my.example.site/civicrm/donate.
By default this will use the Pay Later Checkout Option. You will probably want to either: 1) set it to use your preferred Checkout Option (e.g. Stripe Embedded Checkout); or 2) add Checkout Option as a field on the form, so users can pick which option they want to use
You can add any other fields you need to the Individual entity, or other fields on the Contribution such as Contribution Source. You can also rearrange the inputs and/or add Rich Content elements to prettify your form.
You should now be ready to test using the form.
Using Test Mode¶
To use Test Mode for Contributions created through the form, add the special parameter testMode=1 to the form URL - for example https://my.example.site/civicrm/donate?testMode=1.
This will use the Test connection configured for your selected Checkout Option / Payment Processor.
Making a Recurring Contribution¶
To allow users to set up a Recurring Contribution, you can use the Recur Period field on the Contribution entity. You can either set a fixed value on the left hand side, or add as a field input to allow users to pick an option.
Adding a thank you page / message¶
You can configure a thank you page / message using the Confirmation Type setting on the Form Settings tab.
You can either show a confirmation message or redirect to another URL for a thank you page. You can include tokens from the form submission to personalise these messages / redirect url - for example a message like Thank you {Individual1.0.first_name}! or a URL like https://my.example.site/thank-you?contribution_id={Contribution1.0.id}.
Minimum requirements for a new form¶
The minimum requirements for taking payments through a form are as follows:
- A Contribution entity is included on the form
- The Contribution includes the Checkout Option field - either with a fixed value on the left hand side, or as a user input on the right hand side
- The Contribution includes the Checkout Details field - this should always be included as a user input on the right hand side
Allowed Actionsfor the Contribution should be set to eitherCreateto create a new Contribution, orUpdateif you wish to make payments for a previously created contribution, but not both.- Ensure at least one Price Field is included, either as a fixed value on the left hand side, or a form input on the right hand side. The Price Field could be on the Contribution, or a linked Membership or Participant entity. The starter form uses the simplest Contribution Amount field.
When creating new forms, it may help to start by cloning the civicrm/donate form, which should have all
of the minimal requirements set for you already.
Available Checkout Options¶
| Option | Extension | Flow type | Status | Notes |
|---|---|---|---|---|
| Stripe Embedded Checkout | Stripe | Clientside JS post-submit | Working | Requires version 6.16+ |
| Stripe Hosted Checkout | Stripe | Whole page redirect post-submit | Working | Requires version 6.16+ |
| Paypal Complete Payments | Paypal | Clientside JS pre-submit | Working | New extension |
| Authnet AcceptJS | Authnet | Clientside JS pre-submit | Working in sandbox | https://lab.civicrm.org/extensions/authnet/-/merge_requests/45 |
| Authnet Credit Card | Authnet | Serverside | Working in sandbox | Renders form fields from Quickform metadata https://lab.civicrm.org/extensions/authnet/-/merge_requests/45 |