Home / Integrations / WordPress / Gravity Forms

Gravity Forms


API Information

References:

Support:  
3rd Party Integrations are supported through the forum only.  Please post all your questions to: http://forums.clickandpledge.com/forumdisplay.php?f=78

Requirements: 
  • Gravity Forms requires a minimum of WordPress version 3.7+
  • MySQL 5
  • PHP 5 
Download:
Here is the link to download Gravity Forms Click & Pledge plug-in: https://wordpress.org/plugins/gravity-forms-click-pledge/

NOTE: Default_Socket_Timeout should be more than 60 seconds.

Setup:
  • Go to ‘plugins->Installed Plugins’ enable the ‘Gravity Forms Click & Pledge’

 2018-04-09-19-23-08
Assigning From to process through Click & Pledge:
  • Click on ‘Forms->Click & Pledge’ to display all available forms
  • Select the ‘Gravity Form’ to process then click on ‘Save’ button

General Settings

The settings which are made in this section will affect to the total gravity forms. To change the settings, follow the below steps:

  1.   Login to Gravity Forms and click ‘Forms’.
  2.   Click ‘Settings’.
  3.   Select ‘Click & Pledge’.

NOTE: Detailed information is given under every field to follow.

We can login to new user directly with Connect platform through OAuth Connection. To do so, simply login with the desired Connect User Name.

2

Enter the Connect User Name associated with your Click & Pledge account and click on Get the Code. Please check your email inbox for the email. Copy the Code.

3

Paste the copied code and click Login

4

The Connect Payment settings will be replicated here. Only Custom Payment can be edited here. Please login to Portal and go to Account Info > Accepted Cards to enable the payment type settings. Enable/Disable Send Receipt to Patron to send/stop the default receipt to the patron. To send the custom receipt to the patron, add the Connect Campaign URL Alias to the form. To change the account, click on Change Account.

Adding C&P Order Mode to the Form

From version 3.700.000, C&P Order Mode is removed from the general settings. So, in order to test the form, drag and drop the ‘C&P Order Mode’ button from ‘Pricing Fields’ sections. Enter the field label, description and select the mode before updating the form.

Mode may be set either to Test or Production. Test mode is used to test the transactions. No amount will be deducted from the payment. Production mode is nothing but live payment form wherein the given amount will be deducted from the selected payment type.

NOTE: If C&P Order Mode is not selected, by default the mode is set to Production.

Order Mode

Setting SKU for a Product

SKU's are added for each item and option as a hidden field.  The following example shows how to add SKU to a single item as well as one with options.

Example 1:  T-Shirt with SKU=abc-123

Item definition:

7

NOTE:  In the above example the Field id for the item is shown as:  Field ID 2.

Add a hidden field:

GravityForms Hidden Fields

Set up the hidden field referencing the Field ID as in the Product setting:

Properties field label:  {SKU}{FIELDID=2} - Please note that all fields are case sensitive - SKU & FIELDID should be in all caps.

8

The Advanced tab is the value of the SKU.

9

Example 2:
For products with options such as those listed in a pull down menu or a radio button, each option needs to be set up with an SKU.  SKU's may be the same or different.

Hidden field format:  {SKU}{FIELDID=fid}{OPTION=value}
  • fid = Field ID of the product as listed in the Product listing
  • value = Option's value- each option of a product has to be set up with a unique value and that value needs to be listed to identify the SKU's reference.
Gravity Form- Product Radio Button

Each "Choice" requires a separate hidden field.  

Option: Small

The field label:  Reference the Field ID of the item as shown in the item's blue label area.

10

& the SKU value as set in the Advanced tab.  SKU = Small

11

Option: Medium

12

& the SKU value as set in the Advanced tab.  SKU = Medium

13

Option: Large

14

& the SKU value as set in the Advanced tab.  SKU = Large

15

Adding Connect Campaign URL Alias to the Form for sending the receipt

Transactions will post to this selected Campaign. The receipt which is assigned to this campaign will be sent to the recipient. The donated amount will be added to this campaign. For additional information on Receipts, click this link 

To add the Connect Campaign URL Alias to the form, we have two methods:

Method 1: Adding Hidden Field to the Form Editor

NOTE: This method is going to be deprecated in the next couple of releases.

Step 1: From ‘Standard Fields’ section, Drag and drop the ‘Hidden’ field into the Form Editor.

Step 2: Enter “{CONNECT_CAMPAIGN_URL_ALIAS}” in the ‘Field Label’.

1-1

Step 3: Enter the Connect Campaign URL Alias as the Default Value.

2-3

Click ‘Update Form’ to save the changes.

Method 2: Adding ConnectCampaign to the Form Editor

NOTE: Available from Click & Pledge Version 3.700.000 ONLY.

Step 1: From ‘Pricing Fields’ section, Drag and drop the ‘ConnectCampaign’ field into the Form Editor.

Step 2: Select Connect Campaign from the drop-down menu and click Update

4-1

NOTE: If there are two or more Connect Campaign URL Alias in the form, then the field which is selected from Pricing Fields (Method 2) will be considered. 

Custom Questions

The following fields are posted as custom questions:

  • Single Line Text
  • Drop Down
  • Number
  • Radio Buttons
  • Paragraph Text
  • Multi Select
  • Checkboxes
  • Hidden

Gravity Form Custom Questions

The fields may be placed on the page and configured without any special considerations.  The application will consider all the listed fields as custom questions by default.

Handling Donations when the option “Other” is selected

Other Donation Amount

In the Donation page, If you are going to select the option “Other”, then please make sure to change these settings in the “Form Editor” page.

Form Edit

Step 1: Click on “Forms”.

Step 2: Select the Form name and click on “Edit”. It will redirect to the below screen. 

SKIPIF0

For the Label “Other”, change the Value to “{SKIPIF0}” so that it won’t post duplicate items to Salesforce Opportunity Object. 

Label for Payment method when Payment methods are set to Conditional Logic

If there are multiple options for payment methods, please follow the below procedure to know how to set the conditional logic.

  1. From ‘Standard Fields’ section, Drag and drop the ‘Radio Button’ field into the Form Editor.
  2. Enter the Field Label as Payment Method. Make sure that label name will be any one of these: Payment Method / Select Payment Type / Select Payment Method
  3. Enter the Choices of the payment methods. Enable the radio button of the desired payment method so that it will be the default payment method in the payment page. 
2-1


To set the Conditional logic for the payment methods, follow the below steps:

Credit Card:

  1. From ‘Pricing Fields’ section, Drag and drop the ‘Credit Card’ field into the Form Editor.
  2. Go to Advanced tab, Enable the checkbox for the field ‘Enable Conditional Logic’.
  3. Select Payment Method from the dropdown menu followed by IS condition and select Payment method as Credit Card
3-1

eCheck:

  1. From ‘Pricing Fields’ section, Drag and drop the ‘eCheck’ field into the Form Editor.
  2. Go to Advanced tab, Enable the checkbox for the field ‘Enable Conditional Logic’.
  3. Select Payment Method from the dropdown menu followed by IS condition and select Payment method as eCheck
4

Custom Payment:

  1. From ‘Pricing Fields’ section, Drag and drop the ‘Custom Payment’ field into the Form Editor.
  2. Go to Advanced tab, Enable the checkbox for the field ‘Enable Conditional Logic’.
  3. Select Payment Method from the drop-down menu followed by IS condition and select Payment method as Custom Payment
5

After updating the form, the payment page looks like the below screenshot. Select the desired payment method and process the donation.

6

How to Build a Gravity Form with Recurring & One-Time Options

Adding Recurring Button

Single/Double click on Recurring button (Pricing Fields > Recurring), so that it will appear in the form editor.

Recurring Fields

1. Field Label: Enter the Label of the form field. This is the field title the user will see when filling out the form.

2. Description: Enter the description for the form field. This will be displayed for the user and provide some direction on how the field should be filled out or selected.

3. The name mentioned here for the payment methods will be displayed in the external page.

4. By enabling the checkbox for “One time only”, the user can select either “One time only” or “Recurring” from the external page. If not selected, the user can perform only recurring transaction. SKU Suffixes allow you to create additional parameters to increase the flexibility of information included in a SKU. This is particularly helpful with Salesforce mapping. 

5. Default Payment Options: The option which is selected here will be displayed as a default option in the external page.

6. The name mentioned here for the recurring types will be displayed in the external page.

7. Select either installment or subscription or both. The selected options will be displayed in the external page.

8. Default Recurring Type: The selected option will be displayed as the default recurring type in the external page.

NOTE: If both the options are selected in the step: 7, then only “Default Recurring Type” will appear.

9. The name mentioned here for the periodicity will be displayed in the external page.

10. The checkboxes which are selected will be displayed in the external page. SKU Suffixes allow you to create additional parameters to increase the flexibility of information included in a SKU. This is particularly helpful with Salesforce mapping. 

11. The name mentioned here for the number of payments will be displayed in the external page.

12. Indefinite Only: If this option is selected then 998 times for installments and 999 times for subscription, the recurring option will be continued.

Open Field Only: If this option is selected, “Default number of payments” and “Maximum number of installments” can be given. The entries given here can be changed in the external page.

Open Field Only

Indefinite + Open Field Only: If this option is selected, the default value will be 999 which can be changed accordingly in the external page.

NOTE: Make sure the range for installment is 2 to 998 and 2 to 999 for a subscription.

Fixed Number: If this option is selected, the number entered in this field remains constant.

13. Rules: Select the option to make the form field required. A required field will prevent the form from being submitted if it is not filled out or selected.

A recurring transaction can be done through Credit Card and eCheck. Here are the steps to add Credit Card and eCheck into the form editor.

Credit Card and eCheck can be added from Pricing Fields. Single/Double click on the button so that they will be added to the form editor.

Payment Types

After adding all the required fields to the form editor, click on Update Form. The external page for above fields will look like this:

External Page

NOTE 1: If the plug-in is updated then the already existing forms will also be updated without any change in the settings which are already set for the form.

NOTE 2: If the settings want to be changed for Recurring process then delete the field and click on “Update form” button. Then select the recurring field from Pricing Fields tab.

Setting Campaign for a Product

NOTE: These steps are applicable only from Version 3.x and above.

Campaign feature provides a flexible method for tracking donations across different channels.  The following steps clearly explain how to add a campaign to the product.

Step 1: Add the product to the form editor.

Product Field

1. After login to the Gravity Forms, click on Form.

2. Select New Form and provide the forum name and description.

3. Click on Pricing Fields, so that the options will appear.

4. Click or drag the Product button so that it will appear in the form editor.

Step 2: Add the Campaign to the form editor.

Hidden Field

1. Click on Standard Fields, so that the options will appear.

2. Single/Double click on Hidden button so that it will appear in the form editor. Click on Hidden Field so that the Field Label column will be visible.

Field Label

3. Replace the Field Label with {CAMPAIGNNAME}{FIELDID=} or {CAMPAIGNNAME}{FIELDID=1}.

Campaigns are of two types. They are Transaction Campaign and Item Campaign.

Transaction Campaign:

Transaction Campaign will have Empty Field id.

Eg: - {CAMPAIGNNAME}{FIELDID=}

Transaction Campaign

Item Campaign:

Item campaign has the Product Field Id number instead of null.

Item Campaign

Campaign Name:

Campaign Name

1. Click on Advanced button.

2. Default Value: If you would like to pre-populate the value of a field, enter it here.

3. Check this option to enable data to be passed to the form and pre-populate this field dynamically. Data can be passed via Query Strings, Shortcode and/or Hooks.

Example: 1

For products with options such as those listed in a pull-down menu or a radio button, each option needs to be set up with a Campaign.  Campaigns may be the same or different.

Hidden field format:  {CAMPAIGNNAME}{FIELDID=FID}{OPTION=VALUE}

 

  • fid = Field ID of the product as listed in the Product listing
  • value = Option's value- each option of a product has to be set up with a unique value and that value needs to be listed to identify the Campaign's reference.
Product Field

Option: SMALL

The field label:  Reference the Field ID of the item as shown in the item's blue label area.

Small

& the Campaign value as set in the Advanced tab.  Campaign = WHO-Cancer-Small

Small1


Option: Medium

Medium

& the Campaign value as set in the Advanced tab.  Campaign = WHO-Cancer-Medium

Medium1


Option: Large

Large

& the Campaign value as set in the Advanced tab.  Campaign = WHO-Cancer-Large

Large1

Addition of various parameters in the Thank You page

To add various parameters like order number, transaction Id, Auth Code, Payment Amount and Payment status in Gravity Forms Thank you Page, please follow the below steps:

Go to Gravity Form > Forms

Form 

After selecting Confirmation, click on Edit.

Form Edit

You may edit the confirmation page and customize the page as needed. The following parameters are present by default:

Transaction details:

Order Number: {order_number}

Transaction Id / VaultGUID: {transaction_id}

Authorization Code: {authcode}

Payment Amount: ${payment_amount}

Payment Status: {payment_status}

Confirmation

After successful transaction, Thank you page will appear like below:

Thank you Page




 RSS of this page