Overview

Classes

  • GF_Personal_Data
  • GFAddOn
  • GFAddOnFeedsTable
  • GFAPI
  • GFFeedAddOn
  • GFPaymentAddOn
  • GFPaymentStatsTable
  • Overview
  • Class

Class GFPaymentAddOn

Class GFPaymentAddOn

Used to extend Gravity Forms. Specifically, payment add-ons.

GFAddOn
Extended by GFFeedAddOn
Extended by GFPaymentAddOn
Abstract
Package: GFPaymentAddOn
Since: Unknown
Uses: GFFeedAddOn
Located at addon/class-gf-payment-addon.php
Methods summary
public
# pre_init( )

Runs before the payment add-on is initialized.

Runs before the payment add-on is initialized.

Since

Unknown

Uses

GFAddOn::pre_init()
GFPaymentAddOn::payment_method_is_overridden()
GFPaymentAddOn::setup_cron()
GFPaymentAddOn::maybe_process_callback()

Used-by

GFAddOn::__construct()

Overrides

GFAddOn::pre_init()
public
# init( )

Runs when the payment add-on is initialized.

Runs when the payment add-on is initialized.

Since

Unknown

Uses

GFFeedAddOn::init()
GFPaymentAddOn::confirmation()
GFPaymentAddOn::maybe_validate()
GFPaymentAddOn::entry_post_save()

Overrides

GFFeedAddOn::init()
public
# init_admin( )

Runs only when the payment add-on is initialized in the admin.

Runs only when the payment add-on is initialized in the admin.

Since

Unknown

Uses

GFFeedAddOn::init_admin()
GFPaymentAddOn::$_requires_credit_card
GFPaymentAddOn::supported_currencies()
GFPaymentAddOn::entry_deleted()
GFPaymentAddOn::entry_info()

Overrides

GFFeedAddOn::init_admin()
public
# init_ajax( )

Runs only when AJAX actions are being performed.

Runs only when AJAX actions are being performed.

Since

Unknown

Uses

GFFeedAddOn::init_ajax()
GFPaymentAddOn::ajax_cancel_subscription()
GFPaymentAddOn::before_delete_field()

Overrides

GFFeedAddOn::init_ajax()
public
# setup( )

Runs the setup of the payment add-on.

Runs the setup of the payment add-on.

Since

Unknown

Uses

GFFeedAddOn::setup()
GFPaymentAddOn::upgrade_payment()
GFAddOn::$_slug
GFPaymentAddOn::$_payment_version

Overrides

GFFeedAddOn::setup()
public
# post_gravityforms_upgrade( mixed $db_version, mixed $previous_db_version, mixed $force_upgrade )

Gets called when Gravity Forms upgrade process is completed. This function is intended to be used internally, override the upgrade() function to execute database update scripts.

Gets called when Gravity Forms upgrade process is completed. This function is intended to be used internally, override the upgrade() function to execute database update scripts.

Parameters

$db_version
Current Gravity Forms database version
$previous_db_version
Previous Gravity Forms database version
$force_upgrade
True if this is a request to force an upgrade. False if this is a standard upgrade (due to version change)

Overrides

GFFeedAddOn::post_gravityforms_upgrade()
public array
# confirmation( array $confirmation, array $form, array $entry, boolean $ajax )

Handles post-submission confirmations.

Handles post-submission confirmations.

Parameters

$confirmation
The confirmation details.
$form
The Form Object that the confirmation is being run for.
$entry
The Entry Object associated with the submission.
$ajax
If the submission was done using AJAX.

Returns

array
The confirmation details.

Since

Unknown

Uses

GFPaymentAddOn::$redirect_url

Used by

GFPaymentAddOn::init()
public |string
# redirect_url( array $feed, array $submission_data, array $form, array $entry )

Override this function to specify a URL to the third party payment processor.

Override this function to specify a URL to the third party payment processor.

Useful when developing a payment gateway that processes the payment outside of the website (i.e. PayPal Standard).

Parameters

$feed
Active payment feed containing all the configuration data.
$submission_data
Contains form field data submitted by the user as well as payment information (i.e. payment amount, setup fee, line items, etc...).
$form
Current form array containing all form settings.
$entry
Current entry array containing entry information (i.e data submitted by users).

Returns

|string
Return a full URL (including http:// or https://) to the payment processor.

Since

Unknown

Used by

GFPaymentAddOn::entry_post_save()

Used-by

GFPaymentAddOn::entry_post_save()
public array
# maybe_validate( array $validation_result )

Check if the rest of the form has passed validation, is the last page, and that the honeypot field has not been completed.

Check if the rest of the form has passed validation, is the last page, and that the honeypot field has not been completed.

Parameters

$validation_result
Contains the validation result, the Form Object, and the failed validation page number.

Returns

array
$validation_result

Since

Unknown

Uses

GFFormDisplay::is_last_page()
GFFormDisplay::get_max_field_id()
GFPaymentAddOn::validation()

Used by

GFPaymentAddOn::init()

Used-by

GFPaymentAddOn::init()
public array
# validation( array $validation_result )

Handles the validation and processing of payments.

Handles the validation and processing of payments.

Parameters

$validation_result
The validation details to use.

Returns

array
The validation details after completion.

Since

Unknown

Uses

GFPaymentAddOn::get_payment_feed()
GFPaymentAddOn::get_submission_data()
GFPaymentAddOn::$is_payment_gateway
GFPaymentAddOn::$current_feed
GFPaymentAddOn::$current_submission_data
GFPaymentAddOn::payment_method_is_overridden
GFPaymentAddOn::authorize()
GFPaymentAddOn::subscribe()
GFPaymentAddOn::get_validation_result()
GFPaymentAddOn::$authorization
GFFeedAddOn::$_single_submission_feed
GFFormsModel::create_lead
GFAddOn::log_debug
GFFormDisplay::set_current_page

Used by

GFPaymentAddOn::maybe_validate()
public array
# authorize( array $feed, array $submission_data, array $form, array $entry )

Override this method to add integration code to the payment processor in order to authorize a credit card with or without capturing payment.

Override this method to add integration code to the payment processor in order to authorize a credit card with or without capturing payment.

This method is executed during the form validation process and allows the form submission process to fail with a validation error if there is anything wrong with the payment/authorization. This method is only supported by single payments. For subscriptions or recurring payments, use the GFPaymentAddOn::subscribe() method.

Parameters

$feed
Current configured payment feed.
$submission_data
Contains form field data submitted by the user as well as payment information (i.e. payment amount, setup fee, line items, etc...).
$form
The Form Object.
$entry
The Entry Object. NOTE: the entry hasn't been saved to the database at this point, so this $entry object does not have the 'ID' property and is only a memory representation of the entry.

Returns

array
{ Return an $authorization array.

Since

Unknown

Used by

GFPaymentAddOn::validation()

Type

bool $is_authorized True if the payment is authorized. Otherwise, false.
string $error_message The error message, if present.
string $transaction_id The transaction ID.
array $captured_payment { If payment is captured, an additional array is created.
bool $is_success If the payment capture is successful.
string $error_message The error message, if any.
string $transaction_id The transaction ID of the captured payment.
int $amount The amount of the captured payment, if successful. } }

Used-by

GFPaymentAddOn::validation()
public array
# capture( array $authorization, array $feed, array $submission_data, array $form, array $entry )

Override this method to capture a single payment that has been authorized via the authorize() method.

Override this method to capture a single payment that has been authorized via the authorize() method.

Use only with single payments. For subscriptions, use subscribe() instead.

Parameters

$authorization
Contains the result of the authorize() function.
$feed
Current configured payment feed.
$submission_data
Contains form field data submitted by the user as well as payment information. (i.e. payment amount, setup fee, line items, etc...).
$form
Current form array containing all form settings.
$entry
Current entry array containing entry information (i.e data submitted by users).

Returns

array
{ Return an array with the information about the captured payment in the following format:

Since

Unknown

Type

bool $is_success If the payment capture is successful.
string $error_message The error message, if any.
string $transaction_id The transaction ID of the captured payment.
int $amount The amount of the captured payment, if successful.
string $payment_method The card issuer. }

Used-by

GFPaymentAddOn::entry_post_save()
public array
# subscribe( array $feed, array $submission_data, array $form, array $entry )

Override this method to add integration code to the payment processor in order to create a subscription.

Override this method to add integration code to the payment processor in order to create a subscription.

This method is executed during the form validation process and allows the form submission process to fail with a validation error if there is anything wrong when creating the subscription.

Parameters

$feed
Current configured payment feed.
$submission_data
Contains form field data submitted by the user as well as payment information (i.e. payment amount, setup fee, line items, etc...).
$form
Current form array containing all form settings.
$entry
Current entry array containing entry information (i.e data submitted by users). NOTE: the entry hasn't been saved to the database at this point, so this $entry object does not have the 'ID' property and is only a memory representation of the entry.

Returns

array
{ Return an $subscription array in the following format:

Since

Unknown

Used by

GFPaymentAddOn::validation()

Type

bool $is_success If the subscription is successful.
string $error_message The error message, if applicable.
string $subscription_id The subscription ID.
int $amount The subscription amount.
array $captured_payment { If payment is captured, an additional array is created.
bool $is_success If the payment capture is successful.
string $error_message The error message, if any.
string $transaction_id The transaction ID of the captured payment.
int $amount The amount of the captured payment, if successful. } To implement an initial/setup fee for gateways that don't support setup fees as part of subscriptions, manually capture the funds for the setup fee as a separate transaction and send that payment information in the following 'captured_payment' array: 'captured_payment' => [ 'name' => 'Setup Fee', 'is_success' => true|false, 'error_message' => 'error message', 'transaction_id' => 'xxx', 'amount' => 20 ]

Used-by

GFPaymentAddOn::validation()
public boolean
# cancel( array $entry, array $feed )

Override this method to add integration code to the payment processor in order to cancel a subscription.

Override this method to add integration code to the payment processor in order to cancel a subscription.

This method is executed when a subscription is canceled from the Payment Gateway (i.e. Stripe or PayPal).

Parameters

$entry
Current entry array containing entry information (i.e data submitted by users).
$feed
Current configured payment feed.

Returns

boolean
Returns true if the subscription was cancelled successfully and false otherwise.

Since

Unknown

Used-by

GFPaymentAddOn::ajax_cancel_subscription()
public array
# get_validation_result( array $validation_result, array $authorization_result )

Gets the payment validation result.

Gets the payment validation result.

Parameters

$validation_result
Contains the form validation results.
$authorization_result
Contains the form authorization results.

Returns

array
The validation result for the credit card field.

Since

Unknown

Used by

GFPaymentAddOn::validation()

Used-by

GFPaymentAddOn::validation()
public array
# entry_post_save( array $entry, array $form )

Handles additional processing after an entry is saved.

Handles additional processing after an entry is saved.

Parameters

$entry
The Entry Object.
$form
The Form Object.

Returns

array
The Entry Object.

Since

Unknown

Uses

GFPaymentAddOn::$is_payment_gateway
GFPaymentAddOn::$current_feed
GFPaymentAddOn::$authorization
GFPaymentAddOn::process_subscription()
GFPaymentAddOn::payment_method_is_overridden()
GFPaymentAddOn::process_capture()
GFPaymentAddOn::redirect_url()

Used by

GFPaymentAddOn::init()

Used-by

GFPaymentAddOn::init()
public array
# process_capture( array $authorization, array $feed, array $submission_data, array $form, array $entry )

Processed the capturing of payments.

Processed the capturing of payments.

Parameters

$authorization
The payment authorization details.
$feed
The Feed Object.
$submission_data
The form submission data.
$form
The Form Object.
$entry
The Entry Object.

Returns

array
The Entry Object.

Since

Unknown

Uses

GFPaymentAddOn::complete_authorization()
GFPaymentAddOn::complete_payment()
GFPaymentAddOn::fail_payment()

Used by

GFPaymentAddOn::entry_post_save()

Used-by

GFPaymentAddOn::entry_post_save()
public array
# process_subscription( array $authorization, array $feed, array $submission_data, array $form, array $entry )

Processes payment subscriptions.

Processes payment subscriptions.

Parameters

$authorization
The payment authorization details.
$feed
The Feed Object.
$submission_data
The form submission data.
$form
The Form Object.
$entry
The Entry Object.

Returns

array
The Entry Object.

Since

Unknown

Uses

GFPaymentAddOn::insert_transaction()
GFCommon::to_money()
GFAddOn::add_note()
GFPaymentAddOn::start_subscription()
GFAPI::update_entry()
GFPaymentAddOn::post_payment_action()

Used by

GFPaymentAddOn::entry_post_save()

Used-by

GFPaymentAddOn::entry_post_save()
public integer|WP_Error
# insert_transaction( integer $entry_id, string $transaction_type, string $transaction_id, float $amount, integer|null $is_recurring = null, string|null $subscription_id = null )

Inserts a new transaction item.

Inserts a new transaction item.

Parameters

$entry_id
The entry ID that contains the transaction.
$transaction_type
The transaction type.
$transaction_id
The ID of the transaction to be inserted.
$amount
The transaction amount.
$is_recurring
If the transaction is recurring. Defaults to null.
$subscription_id
The subscription ID tied to the transaction, if related to a subscription. Defaults to null.

Returns

integer|WP_Error
The row ID from the database entry. WP_Error if error.

Since

Unknown

Uses

wpdb::get_var()
wpdb::prepare()
wpdb::query()
wpdb::$insert_id

Used by

GFPaymentAddOn::process_subscription()

Used-by

GFPaymentAddOn::add_subscription_payment()
GFPaymentAddOn::complete_authorization()
GFPaymentAddOn::process_subscription()
GFPaymentAddOn::refund_payment()
public array
# get_payment_feed( array $entry, boolean|array $form = false )

Gets the payment submission feed.

Gets the payment submission feed.

Parameters

$entry
The Entry Object.
$form
The Form Object. Defaults to false.

Returns

array
The submission feed.

Since

Unknown

Uses

GFFeedAddOn::get_feeds_by_entry()
GFFeedAddOn::get_feed()
GFFeedAddOn::get_feeds()
GFFeedAddOn::pre_process_feeds()
GFFeedAddOn::is_feed_condition_met()

Used by

GFPaymentAddOn::validation()

Used-by

GFPaymentAddOn::ajax_cancel_subscription()
GFPaymentAddOn::process_callback_action()
GFPaymentAddOn::validation()
public boolean
# is_payment_gateway( integer $entry_id )

Determines if this is a payment gateway add-on.

Determines if this is a payment gateway add-on.

Parameters

$entry_id
The entry ID.

Returns

boolean
True if it is a payment gateway. False otherwise.

Since

Unknown

Uses

GFPaymentAddOn::$is_payment_gateway()
GFAddOn::$_slug

Used-by

GFPaymentAddOn::entry_info()
public array
# get_submission_data( array $feed, array $form, array $entry )

Gets the payment submission data.

Gets the payment submission data.

Parameters

$feed
The Feed Object.
$form
The Form Object.
$entry
The Entry Object.

Returns

array
The payment submission data.

Since

Unknown

Uses

GFPaymentAddOn::billing_info_fields()
GFPaymentAddOn::get_credit_card_field()
GFAddOn::get_field_value()
GFPaymentAddOn::remove_spaces_from_card_number()
GFPaymentAddOn::get_order_data()

Used by

GFPaymentAddOn::validation()

Used-by

GFPaymentAddOn::validation()
public boolean|GF_Field_CreditCard
# get_credit_card_field( array $form )

Gets the credit card field object.

Gets the credit card field object.

Parameters

$form
The Form Object.

Returns

boolean|GF_Field_CreditCard
The credit card field object, if found. Otherwise, false.

Since

Unknown

Uses

GFAPI::get_fields_by_type()

Used by

GFPaymentAddOn::get_submission_data()
GFPaymentAddOn::has_credit_card_field()

Used-by

GFPaymentAddOn::before_delete_field()
GFPaymentAddOn::get_submission_data()
GFPaymentAddOn::has_credit_card_field()
public boolean
# has_credit_card_field( array $form )

Checks if a form has a credit card field.

Checks if a form has a credit card field.

Parameters

$form
The Form Object.

Returns

boolean
True if the form has a credit card field. False otherwise.

Since

Unknown

Uses

GFPaymentAddOn::get_credit_card_field()

Used-by

GFPaymentAddOn::feed_list_message()
public array
# get_order_data( array $feed, array $form, array $entry )

Gets payment order data.

Gets payment order data.

Parameters

$feed
The Feed Object.
$form
The Form Object.
$entry
The Entry Object.

Returns

array
{ The order data.

Since

Unknown

Uses

GFCommon::get_product_fields()
GFCommon::to_number()

Used by

GFPaymentAddOn::get_submission_data()

Type

float $payment_amount The payment amount of the order.
float $setup_fee The setup fee, if any.
float $trial The trial fee, if any.
float $discounts Discounts applied, if any. }

Used-by

GFPaymentAddOn::get_submission_data()
public boolean
# is_callback_valid( )

Checks if the callback should be processed by this payment add-on.

Checks if the callback should be processed by this payment add-on.

Returns

boolean
True if valid. False otherwise.

Since

Unknown

Uses

GFAddOn::$_slug

Used by

GFPaymentAddOn::maybe_process_callback()

Used-by

GFPaymentAddOn::maybe_process_callback()
public
# maybe_process_callback( )

Conditionally initiates processing of the callback.

Conditionally initiates processing of the callback.

Checks to see if the callback is valid, processes callback actions, then returns the appropriate response.

Since

Unknown

Uses

GFPaymentAddOn::is_callback_valid()
GFAddOn::$_slug
GFPaymentAddOn::callback()
GFPaymentAddOn::display_callback_error()
GFPaymentAddOn::process_callback_action()
GFPaymentAddOn::post_callback()

Used by

GFPaymentAddOn::pre_init()

Used-by

GFPaymentAddOn::pre_init()
public
# register_callback( string $callback_id, integer $entry_id )

Registers a callback action.

Registers a callback action.

Parameters

$callback_id
The callback ID for the action.
$entry_id
The entry ID associated with the callback.

Since

Unknown

Uses

wpdb::insert()
GFAddOn::$_slug
public boolean
# is_duplicate_callback( string $callback_id )

Checks if a callback is duplicate.

Checks if a callback is duplicate.

Parameters

$callback_id
The callback ID to chack.

Returns

boolean
If the callback is a duplicate, true. Otherwise, false.

Since

Unknown

Uses

wpdb::$prefix
wpdb::prepare()
wpdb::get_var()
public
# callback( )

Used by

GFPaymentAddOn::maybe_process_callback()
public
# post_callback( mixed $callback_action, mixed $result )

Used by

GFPaymentAddOn::maybe_process_callback()
public
# add_pending_payment( mixed $entry, mixed $action )
public
# complete_authorization( mixed & $entry, mixed $action )

Used by

GFPaymentAddOn::process_capture()
public
# complete_payment( mixed & $entry, mixed $action )

Used by

GFPaymentAddOn::process_capture()
public
# refund_payment( mixed $entry, mixed $action )
public
# fail_payment( mixed $entry, mixed $action )

Used by

GFPaymentAddOn::process_capture()
public
# void_authorization( mixed $entry, mixed $action )
public [array]
# start_subscription( [array] $entry, [string] $subscription )

Used to start a new subscription. Updates the associcated entry with the payment and transaction details and adds an entry note.

Used to start a new subscription. Updates the associcated entry with the payment and transaction details and adds an entry note.

Parameters

$entry
Entry object
$subscription
$subscription_id ID of the subscription

Returns

[array]
$entry Entry Object

Used by

GFPaymentAddOn::process_subscription()
public true
# add_subscription_payment( [array] $entry, [array] $action )

A payment on an existing subscription.

A payment on an existing subscription.

Parameters

$entry
$data Transaction data including 'amount' and 'subscriber_id'
$action
$entry Entry object

Returns

true
true
public
# fail_subscription_payment( mixed $entry, mixed $action )
public
# cancel_subscription( mixed $entry, mixed $feed, mixed $note = null )
public
# expire_subscription( mixed $entry, mixed $action )
public
# has_subscription( mixed $entry )
public boolean|string
# get_entry_by_transaction_id( string $transaction_id )

Retrieves the ID of the entry associated with the supplied subscription or transaction ID.

Retrieves the ID of the entry associated with the supplied subscription or transaction ID.

Parameters

$transaction_id
The subscription or transaction ID.

Returns

boolean|string
bool|string

Since

2.3.3.9 Updated to search the _gf_addon_payment_transaction table if the ID was not found in the entry table.
unknown
public
# post_payment_action( array $entry, array $action )

Helper for making the gform_post_payment_action hook available to the various payment interaction methods. Also handles sending notifications for payment events.

Helper for making the gform_post_payment_action hook available to the various payment interaction methods. Also handles sending notifications for payment events.

Parameters

$entry
$action

Since

2.3.6.6 Added the $action to the GFAPI::send_notifications() $data param.
unknown

Used by

GFPaymentAddOn::process_subscription()
public
# setup_cron( )

Used by

GFPaymentAddOn::pre_init()
public
# check_status( )
public
# feed_list_columns( )

Overrides

GFFeedAddOn::feed_list_columns()
public
# get_column_value_transactionType( mixed $feed )
public
# get_column_value_amount( mixed $feed )
public string
# feed_list_title( )

Remove the add new button from the title if the form requires a credit card field.

Remove the add new button from the title if the form requires a credit card field.

Returns

string
string

Overrides

GFFeedAddOn::feed_list_title()
public string|false
# feed_list_message( )

Override this function to force a message to be displayed in the feed list (instead of data). Useful to alert users when main plugin settings haven't been completed.

Override this function to force a message to be displayed in the feed list (instead of data). Useful to alert users when main plugin settings haven't been completed.

Returns

string|false
string|false

Overrides

GFFeedAddOn::feed_list_message()
public
# requires_credit_card_message( )
public
# feed_settings_fields( )

Overrides

GFFeedAddOn::feed_settings_fields()
public
# other_settings_fields( )
public
# settings_billing_cycle( mixed $field, mixed $echo = true )
public
# settings_setup_fee( mixed $field, mixed $echo = true )
public
# set_trial_onchange( mixed $field )
public
# settings_trial( mixed $field, mixed $echo = true )
public
# recurring_amount_choices( )
public
# product_amount_choices( )
public
# option_choices( )
public
# billing_info_fields( )

Used by

GFPaymentAddOn::get_submission_data()
public
# get_numeric_choices( mixed $min, mixed $max )
public
# supported_billing_intervals( )
public
# get_payment_choices( mixed $form )
public
# get_results_page_config( )

Returns the configuration for the results page. By default this is not activated. To activate the results page override this function and return an array with the configuration data.

Returns the configuration for the results page. By default this is not activated. To activate the results page override this function and return an array with the configuration data.

Example: public function get_results_page_config() { return array( "title" => 'Quiz Results', "capabilities" => array("gravityforms_quiz_results"), "callbacks" => array( "fields" => array($this, 'results_fields'), "calculation" => array($this, 'results_calculation'), "markup" => array($this, 'results_markup'), ) ); }

Overrides

GFAddOn::get_results_page_config()
public
# results_fields( mixed $form )
public
# results_markup( mixed $html, mixed $data, mixed $form, mixed $fields )
public
# get_chart_data( mixed $data )
public static
# get_sales_chart( mixed $sales_data )
public
# results_data( mixed $form, mixed $fields, mixed $search_criteria, mixed $state_array )
public
# get_sales_data( mixed $form_id, mixed $search, mixed $state )
public
# format_chart_h_axis( mixed $result )
public
# get_sales_summary( mixed $form_id )
public
# results_filter_ui( mixed $filter_ui, mixed $form_id, mixed $page_title, mixed $gf_page, mixed $gf_view )
public
# get_payment_methods( mixed $form_id )
public
# array_filter_non_blank( mixed $value )
public static string
# get_entry_table_name( )

Get name for entry table.

Get name for entry table.

Returns

string
string

Since

2.3

Uses

GFFormsModel::get_entry_table_name()
GFFormsModel::get_lead_table_name()
GFPayPalPaymentsPro::get_gravityforms_db_version()
public static string
# get_entry_meta_table_name( )

Get name for entry meta table.

Get name for entry meta table.

Returns

string
string

Since

2.3

Uses

GFFormsModel::get_entry_meta_table_name()
GFFormsModel::get_lead_meta_table_name()
GFPayPalPaymentsPro::get_gravityforms_db_version()
public static string
# get_gravityforms_db_version( )

Get version of Gravity Forms database.

Get version of Gravity Forms database.

Returns

string
string

Since

2.3

Uses

GFFormsModel::get_database_version()
public
# uninstall( )

Called when the user chooses to uninstall the Add-On - after permissions have been checked and before removing all Add-On settings and Form settings.

Called when the user chooses to uninstall the Add-On - after permissions have been checked and before removing all Add-On settings and Form settings.

Override this method to perform additional functions such as dropping database tables.

Return false to cancel the uninstall request.

Overrides

GFFeedAddOn::uninstall()
public
# scripts( )

Override this function to provide a list of scripts to be enqueued. When overriding this function, be sure to call parent::scripts() to ensure the base class scripts are enqueued. Following is an example of the array that is expected to be returned by this function: <pre> <code>

Override this function to provide a list of scripts to be enqueued. When overriding this function, be sure to call parent::scripts() to ensure the base class scripts are enqueued. Following is an example of the array that is expected to be returned by this function:

<code>

array(
       array(
           'handle'    => 'maskedinput',
           'src'       => GFCommon::get_base_url() . '/js/jquery.maskedinput-1.3.min.js',
           'version'   => GFCommon::$version,
           'deps'      => array( 'jquery' ),
           'in_footer' => false,

           // Determines where the script will be enqueued. The script will be enqueued if any of the conditions match.
           'enqueue'   => array(
               // admin_page - Specified one or more pages (known pages) where the script is supposed to be enqueued.
               // To enqueue scripts in the front end (public website), simply don't define this setting.
               array( 'admin_page' => array( 'form_settings', 'plugin_settings' ) ),

               // tab - Specifies a form settings or plugin settings tab in which the script is supposed to be enqueued.
               // If none are specified, the script will be enqueued in any of the form settings or plugin_settings page
               array( 'tab' => 'signature'),

               // query - Specifies a set of query string ($_GET) values.
               // If all specified query string values match the current requested page, the script will be enqueued
               array( 'query' => 'page=gf_edit_forms&view=settings&id=_notempty_' )

               // post - Specifies a set of post ($_POST) values.
               // If all specified posted values match the current request, the script will be enqueued
               array( 'post' => 'posted_field=val' )
           )
       ),
       array(
           'handle'   => 'super_signature_script',
           'src'      => $this->get_base_url() . '/super_signature/ss.js',
           'version'  => $this->_version,
           'deps'     => array( 'jquery'),
           'callback' => array( $this, 'localize_scripts' ),
           'strings'  => array(
               // Accessible in JavaScript using the global variable "[script handle]_strings"
               'stringKey1' => __( 'The string', 'gravityforms' ),
               'stringKey2' => __( 'Another string.', 'gravityforms' )
           )
           "enqueue"  => array(
               // field_types - Specifies one or more field types that requires this script.
               // The script will only be enqueued if the current form has a field of any of the specified field types.
               // Only applies when a current form is available.
               array( 'field_types' => array( 'signature' ) )
           )
       )
   );

</code>

Overrides

GFFeedAddOn::scripts()
public array
# creditcard_token_info( mixed $form )

Override to support creating credit card tokens via Javascript.

Override to support creating credit card tokens via Javascript.

Parameters

$form

Returns

array
array
public string
# add_creditcard_token_input( string $content, GF_Field $field, string $value, string $entry_id, string $form_id )

Add input field for credit card token response.

Add input field for credit card token response.

Parameters

$content
$field
$value
$entry_id
$form_id

Returns

string
string
public array
# force_ajax_for_creditcard_tokens( array $args )

Enables AJAX for forms that create credit card tokens via Javascript.

Enables AJAX for forms that create credit card tokens via Javascript.

Parameters

$args

Returns

array
array
public boolean
# enqueue_creditcard_token_script( array $form )

Determines if GFToken script should be enqueued.

Determines if GFToken script should be enqueued.

Parameters

$form

Returns

boolean
bool
public
# register_creditcard_token_script( array $form, array $field_values, boolean $is_ajax )

Prepare Javascript for creating credit card tokens.

Prepare Javascript for creating credit card tokens.

Parameters

$form
$field_values
$is_ajax
public array
# get_creditcard_token_entry_fields( array $feeds )

Get needed fields for creating credit card tokens.

Get needed fields for creating credit card tokens.

Parameters

$feeds

Returns

array
$fields
public mixed
# supported_currencies( mixed $currencies )

Override this function to add or remove currencies from the list of supported currencies

Override this function to add or remove currencies from the list of supported currencies

Parameters

$currencies
Currently supported currencies

Returns

mixed
- A filtered list of supported currencies

Used by

GFPaymentAddOn::init_admin()
public RGCurrency
# get_currency( string $currency_code = '' )

Retrieve the currency object for the specified currency code.

Retrieve the currency object for the specified currency code.

Parameters

$currency_code

Returns

RGCurrency
RGCurrency
public integer|float
# get_amount_export( integer|float $amount, string $currency_code = '' )

Format the amount for export to the payment gateway.

Format the amount for export to the payment gateway.

Removes currency symbol and if required converts the amount to the smallest unit required by the gateway (e.g. dollars to cents).

Parameters

$amount
The value to be formatted.
$currency_code
The currency code.

Returns

integer|float
int|float
public integer|float
# get_amount_import( integer|float $amount, string $currency_code = '' )

If necessary convert the amount back from the smallest unit required by the gateway (e.g cents to dollars).

If necessary convert the amount back from the smallest unit required by the gateway (e.g cents to dollars).

Parameters

$amount
The value to be formatted.
$currency_code
The currency code.

Returns

integer|float
int|float
public array
# maybe_add_action_amount_formatted( array $action, string $currency_code = '' )

If necessary formats the amount as currency and adds it to the action array.

If necessary formats the amount as currency and adds it to the action array.

Parameters

$action
The payment or subscription properties.
$currency_code
The currency code.

Returns

array
array

Since

2.3.6.6
public
# entry_info( mixed $form_id, mixed $entry )

Used by

GFPaymentAddOn::init_admin()
public
# entry_deleted( mixed $entry_id )

Target of gform_delete_lead hook. Deletes all transactions and callbacks when an entry is deleted.

Target of gform_delete_lead hook. Deletes all transactions and callbacks when an entry is deleted.

Parameters

$entry_id
ID of entry that is being deleted

Used by

GFPaymentAddOn::init_admin()
public
# ajax_cancel_subscription( )

Used by

GFPaymentAddOn::init_ajax()
public
# before_delete_field( integer $form_id, integer $field_id )

Target of gform_before_delete_field hook. Sets relevant payment feeds to inactive when the credit card field is deleted.

Target of gform_before_delete_field hook. Sets relevant payment feeds to inactive when the credit card field is deleted.

Parameters

$form_id
ID of the form being edited.
$field_id
ID of the field being deleted.

Used by

GFPaymentAddOn::init_ajax()
public
# authorization_error( mixed $error_message )
public
# remove_spaces_from_card_number( mixed $card_number )

Used by

GFPaymentAddOn::get_submission_data()
public
# get_supports_callback( )
Methods inherited from GFFeedAddOn
add_default_feed_settings_fields_props(), add_delayed_payment_support(), add_entry_meta(), add_feed_error(), add_frontend_feeds(), add_paypal_post_payment_actions(), ajax_save_feed_order(), ajax_toggle_is_active(), can_create_feed(), can_duplicate_feed(), configure_addon_message(), create_feed_nonce(), delay_feed(), delete_feed(), delete_feeds(), duplicate_feed(), feed_edit_page(), feed_list_no_item_message(), feed_list_page(), feed_settings_title(), form_settings(), form_settings_header(), form_settings_init(), form_settings_sections(), form_settings_title(), get_action_links(), get_active_feeds(), get_bulk_actions(), get_column_value(), get_current_feed(), get_current_feed_id(), get_default_feed_id(), get_default_feed_name(), get_feed(), get_feed_condition_checkbox(), get_feed_condition_conditional_logic(), get_feed_condition_hidden_field(), get_feed_settings_fields(), get_feed_table(), get_feeds(), get_feeds_by_entry(), get_feeds_by_slug(), get_frontend_feeds(), get_paypal_feed(), get_paypal_payment_amount(), get_save_error_message(), get_save_success_message(), get_single_submission_feed(), get_single_submission_feed_by_form(), has_feed(), has_feed_condition_field(), has_frontend_feeds(), has_paypal_payment(), insert_feed(), is_asynchronous(), is_delayed(), is_delayed_payment(), is_detail_page(), is_feed_condition_met(), is_feed_list_page(), is_unique_feed_name(), maybe_delay_feed(), maybe_process_feed(), maybe_save_feed_settings(), notification_events(), paypal_fulfillment(), post_form_duplicated(), pre_process_feeds(), process_bulk_action(), process_feed(), process_single_action(), register_frontend_feeds(), register_frontend_feeds_init_script(), save_feed_order(), save_feed_settings(), settings(), settings_feed_condition(), supported_notification_events(), trim_conditional_logic_vales(), update_feed_active(), update_feed_meta(), update_form_settings(), validate_feed_condition_settings(), verify_feed_nonce()
Methods inherited from GFAddOn
__construct(), add_default_save_button(), add_field(), add_field_after(), add_field_before(), add_form_settings_menu(), add_note(), app_settings(), app_settings_fields(), app_settings_icon(), app_settings_tab(), app_settings_title(), app_settings_uninstall_tab(), app_tab_page(), app_tab_page_footer(), app_tab_page_header(), build_choices(), checkbox_input(), checkbox_item(), choices_have_icon(), create_app_menu(), create_plugin_page_menu(), current_user_can_any(), current_user_can_uninstall(), failed_requirements_init(), field_failed_validation(), field_map_table_header(), field_map_title(), filter_settings(), filter_ure_capabilities_groups_tree(), filter_ure_custom_capability_groups(), form_settings_fields(), form_settings_icon(), form_settings_page_title(), get_all_deprecated_protected_methods(), get_app_menu_icon(), get_app_menu_items(), get_app_setting(), get_app_settings(), get_app_settings_tabs(), get_base_path(), get_base_url(), get_capabilities(), get_choice_attributes(), get_conditional_logic_fields(), get_current_form(), get_current_settings(), get_default_field_select_field(), get_deprecated_protected_methods_for_base_class(), get_dynamic_field_map_fields(), get_entry_meta(), get_error_icon(), get_field(), get_field_attributes(), get_field_errors(), get_field_map_choices(), get_field_map_fields(), get_field_value(), get_first_field_by_type(), get_form_fields_as_choices(), get_form_settings(), get_full_address(), get_full_name(), get_generic_map_fields(), get_gfaddon_base_path(), get_gfaddon_base_url(), get_list_field_value(), get_locking_config(), get_locking_object_id(), get_mapped_field_name(), get_mapped_field_value(), get_mapping_field(), get_members_caps(), get_path(), get_plugin_setting(), get_plugin_settings(), get_plugin_settings_url(), get_posted_settings(), get_previous_settings(), get_registered_addons(), get_required_indicator(), get_save_button(), get_select_option(), get_select_options(), get_setting(), get_short_title(), get_slug(), get_version(), has_app_menu(), has_app_settings(), has_deprecated_elements(), has_plugin_settings_page(), has_setting_field_type(), init_addons(), init_frontend(), is_app_settings(), is_choice_valid(), is_entry_edit(), is_entry_list(), is_entry_view(), is_form_editor(), is_form_list(), is_form_settings(), is_gravityforms_installed(), is_gravityforms_supported(), is_json(), is_locking_edit_page(), is_locking_list_page(), is_locking_view_page(), is_object_locked(), is_plugin_page(), is_plugin_settings(), is_postback(), is_preview(), is_print(), is_results(), is_save_postback(), is_simple_condition_met(), list_row_class(), load_screen_options(), load_text_domain(), lock_info(), maybe_decode_json(), maybe_get_tooltip(), maybe_override_field_value(), maybe_save_app_settings(), maybe_save_form_settings(), maybe_save_plugin_settings(), maybe_wp_kses(), meets_minimum_requirements(), members_register_cap_group(), members_register_caps(), method_is_overridden(), minimum_requirements(), note_avatar(), notes_avatar(), plugin_message(), plugin_page(), plugin_page_container(), plugin_page_icon(), plugin_page_init(), plugin_page_title(), plugin_settings(), plugin_settings_fields(), plugin_settings_icon(), plugin_settings_init(), plugin_settings_link(), plugin_settings_page(), plugin_settings_title(), prepare_field_select_field(), prepare_settings_checkbox_and_select(), prepend_attribute(), register(), remove_field(), render_settings(), render_uninstall(), replace_field(), results_page_init(), save_form_settings(), set_field_error(), set_logging_supported(), set_previous_settings(), set_settings(), setting_dependency_met(), settings_checkbox(), settings_checkbox_and_select(), settings_dynamic_field_map(), settings_field_map(), settings_field_map_select(), settings_field_select(), settings_fields_only(), settings_generic_map(), settings_hidden(), settings_radio(), settings_save(), settings_select(), settings_select_custom(), settings_text(), settings_textarea(), simple_condition(), single_section(), single_setting(), single_setting_label(), single_setting_row(), single_setting_row_save(), styles(), table_exists(), uninstall_confirm_message(), uninstall_warning_message(), update_app_settings(), update_plugin_settings(), upgrade(), validate_checkbox_and_select_settings(), validate_checkbox_settings(), validate_field_map_settings(), validate_field_select_settings(), validate_radio_settings(), validate_select_custom_settings(), validate_select_settings(), validate_settings(), validate_text_settings(), validate_textarea_settings()
Properties summary
protected boolean $_requires_credit_card

Defines if the credit card field is required by the payment add-on.

Defines if the credit card field is required by the payment add-on.

If set to true, user will not be able to create feeds for a form until a credit card field has been added.

Since

Unknown

Used by

GFPaymentAddOn::init_admin()

Used-by

GFPaymentAddOn::before_delete_field()
GFPaymentAddOn::feed_list_message()
GFPaymentAddOn::init_admin()
#false
protected boolean $_supports_callbacks

Defines if the payment add-on supports callbacks.

Defines if the payment add-on supports callbacks.

If set to true, callbacks/webhooks/IPN will be enabled and the appropriate database table will be created.

Since

Unknown

Used-by

GFPaymentAddOn::upgrade_payment()
#false
protected array $authorization

Stores authorization results returned from the payment gateway.

Stores authorization results returned from the payment gateway.

Since

Unknown

Used by

GFPaymentAddOn::validation()
GFPaymentAddOn::entry_post_save()

Used-by

GFPaymentAddOn::entry_post_save()
GFPaymentAddOn::validation()
#array()
protected string $redirect_url

Stores the redirect URL that the user should be sent to for payment.

Stores the redirect URL that the user should be sent to for payment.

Since

Unknown

Used by

GFPaymentAddOn::confirmation()

Used-by

GFPaymentAddOn::confirmation()
GFPaymentAddOn::entry_post_save()
#''
protected array|array $current_feed

Stores the current feed being processed.

Stores the current feed being processed.

Since

Unknown

Used by

GFPaymentAddOn::validation()
GFPaymentAddOn::entry_post_save()

Used-by

GFPaymentAddOn::entry_post_save()
GFPaymentAddOn::validation()
#false
protected array|boolean $current_submission_data

Stores the current submission data being processed.

Stores the current submission data being processed.

Since

Unknown

Used by

GFPaymentAddOn::validation()

Used-by

GFPaymentAddOn::entry_post_save()
GFPaymentAddOn::validation()
#false
protected boolean $is_payment_gateway

Defines if the payment add-on is a payment gateway add-on.

Defines if the payment add-on is a payment gateway add-on.

Since

Unknown

Used by

GFPaymentAddOn::validation()
GFPaymentAddOn::entry_post_save()

Used-by

GFPaymentAddOn::entry_post_save()
GFPaymentAddOn::is_payment_gateway()
GFPaymentAddOn::is_payment_gateway()
#false
protected boolean $_single_feed_submission

Defines if only a single feed should be processed.

Defines if only a single feed should be processed.

Since

Unknown

Used-by

GFFeedAddOn::maybe_process_feed()
#true
protected boolean $_requires_smallest_unit

Indicates if the payment gateway requires monetary amounts to be formatted as the smallest unit for the currency being used.

Indicates if the payment gateway requires monetary amounts to be formatted as the smallest unit for the currency being used.

For example, $100.00 will be formatted as 10000.

Since

Unknown

Used-by

GFPaymentAddOn::get_amount_export()
GFPaymentAddOn::get_amount_import()
#false
Properties inherited from GFFeedAddOn
$_async_feed_processing, $_bypass_feed_delay, $_multiple_feeds, $_single_submission_feed, $_supports_feed_ordering, $_supports_frontend_feeds
Properties inherited from GFAddOn
$_capabilities, $_capabilities_app_menu, $_capabilities_app_settings, $_capabilities_form_settings, $_capabilities_plugin_page, $_capabilities_settings_page, $_capabilities_uninstall, $_full_path, $_min_gravityforms_version, $_path, $_short_title, $_slug, $_title, $_url, $_version, $app_hook_suffix
Gravity Forms API API documentation generated by ApiGen 2.8.0