Skip to main content

GFPaymentAddOn

Class GFPaymentAddOn

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

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:28

Details​

Properties​

PropertyTypeDescription
$_requires_credit_cardboolTrue if the payment add-on requires a credit card field. Otherwise, false.
$_supports_callbacksboolTrue if the add-on supports callbacks. Otherwise, false.
$authorizationarrayStores authorization results returned from the payment gateway.
$redirect_urlstringThe URL to redirect to. Defaults to empty string.
$current_feedarray | arrayThe current Feed Object. Defaults to false.
$current_submission_dataarray | boolThe form submission data. Defaults to false.
$is_payment_gatewayboolSet to true if it is a payment gateway add-on. Defaults to false.
$_single_feed_submissionboolTrue if only a single feed should be processed. Otherwise, false.
$_requires_smallest_unitboolTrue if the smallest unit should be used. Otherwise, will include the decimal places.
$_supports_feed_reprocessingboolOut of the box, payment add-ons do not support feed reprocessing.

Methods​

MethodDescription
pre_init()Runs before the payment add-on is initialized.
init()Runs when the payment add-on is initialized.
init_admin()Runs only when the payment add-on is initialized in the admin.
init_ajax()Runs only when AJAX actions are being performed.
setup()Runs the setup of the payment add-on.
post_gravityforms_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.
maybe_delay_feed_processing()Determines if feed processing is delayed by the payment feed configuration.
payment_status_changed()Reprocess feeds and triggers gform_post_payment_status_change hook when the payment status changes.
trigger_payment_delayed_feeds()Triggers processing of delayed feeds for other add-ons.
get_frontend_feeds()Adds additional relevant information for payment add-ons to the frontend feeds
get_post_payment_actions_config()Override to specify where the "Post Payment Action" setting should appear on the payment add-on feed.
confirmation()Handles post-submission confirmations.
redirect_url()Override this function to specify a URL to the third party payment processor.
maybe_validate()Check if the rest of the form has passed validation, is the last page, and that the honeypot field has not been completed.
maybe_add_payment_status_to_meta()Handle the entry meta conditional logic confirmations. Adds support for the payment_status entry field to the confirmation condition logic setting.
get_conditional_logic_payment_statuses()Returns the payment statuses that can be used in conditional logic. Override this function to add support for payment statuses in conditional logic.
validation()Handles the validation and processing of payments.
is_valid_payment_amount()Determines if the payment_amount for the current submission is valid for processing.
authorize()Override this method to add integration code to the payment processor in order to authorize a credit card with or
capture()Override this method to capture a single payment that has been authorized via the authorize() method.
subscribe()Override this method to add integration code to the payment processor in order to create a subscription.
cancel()Override this method to add integration code to the payment processor in order to cancel a subscription.
get_validation_result()Gets the payment validation result.
maybe_process_feed()Sets the processed feed meta.
entry_post_save()Handles additional processing after an entry is saved.
process_capture()Processed the capturing of payments.
process_subscription()Processes payment subscriptions.
insert_transaction()Inserts a new transaction item.
get_payment_feed()Gets the payment submission feed.
is_payment_gateway()Determines if this is a payment gateway add-on.
get_submission_data()Gets the payment submission data.
get_credit_card_field()Gets the credit card field object.
has_credit_card_field()Checks if a form has a credit card field.
get_order_data()Gets payment order data.
get_payment_field()Returns what should be used to prepare the payment amount; the form_total or the ID of a specific product field.
is_callback_valid()Checks if the callback should be processed by this payment add-on.
maybe_process_callback()Conditionally initiates processing of the callback.
register_callback()Registers a callback action.
is_duplicate_callback()Checks if a callback is duplicate.
start_subscription()Used to start a new subscription. Updates the associcated entry with the payment and transaction details and adds an entry note.
add_subscription_payment()A payment on an existing subscription.
get_entry_by_transaction_id()Retrieves the ID of the entry associated with the supplied subscription or transaction ID.
post_payment_action()Helper for making the gform_post_payment_action hook available to the various payment interaction methods. Also handles sending notifications for payment events.
reprocess_feeds()Reprocesses feeds that are configured with Payment Status conditional logic.
get_feeds_to_reprocess()Filters out feeds that are not configured with Payment Status conditional logic.
get_feed_settings_entry_meta()Returning an empty array because payment feed logic is evaluated before entry meta is saved.
feed_list_title()Remove the add new button from the title if the form requires a credit card field.
get_entry_table_name()Get name for entry table.
get_entry_meta_table_name()Get name for entry meta table.
get_gravityforms_db_version()Get version of Gravity Forms database.
creditcard_token_info()Override to support creating credit card tokens via Javascript.
add_creditcard_token_input()Add input field for credit card token response.
force_ajax_for_creditcard_tokens()Enables AJAX for forms that create credit card tokens via Javascript.
enqueue_creditcard_token_script()Determines if GFToken script should be enqueued.
register_creditcard_token_script()Prepare Javascript for creating credit card tokens.
get_creditcard_token_entry_fields()Get needed fields for creating credit card tokens.
supported_currencies()Override this function to add or remove currencies from the list of supported currencies
get_currency()Retrieve the currency object for the specified currency code.
get_amount_export()Format the amount for export to the payment gateway.
get_amount_import()If necessary convert the amount back from the smallest unit required by the gateway (e.g cents to dollars).
maybe_add_action_amount_formatted()If necessary formats the amount as currency and adds it to the action array.
entry_deleted()Target of gform_delete_entry hook. Deletes all transactions and callbacks when an entry is deleted.
before_delete_field()Target of gform_before_delete_field hook. Sets relevant payment feeds to inactive when the credit card field is
entries_filter_count_queries()Callback for gform_entries_filter_count_queries; registers the db queries to be used to get the entry counts for the filters.
filter_links_entry_list()Callback for gform_filter_links_entry_list; registers the filter links to be displayed on the entries list page.

Method Reference​

pre_init()​

public function pre_init()

Runs before the payment add-on is initialized.

Returns​

  • void

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:189

init()​

public function init()

Runs when the payment add-on is initialized.

Returns​

  • void

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:214

init_admin()​

public function init_admin()

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

Returns​

  • void

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:274

init_ajax()​

public function init_ajax()

Runs only when AJAX actions are being performed.

Returns​

  • void

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:310

setup()​

public function setup()

Runs the setup of the payment add-on.

Returns​

  • void

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:330

post_gravityforms_upgrade()​

public function post_gravityforms_upgrade( $db_version, $previous_db_version, $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.

Parameters​

NameTypeDefaultDescription
$db_versionCurrent Gravity Forms database version
$previous_db_versionPrevious Gravity Forms database version
$force_upgradeTrue if this is a request to force an upgrade. False if this is a standard upgrade (due to version change)

Source: includes/addon/class-gf-payment-addon.php:426

maybe_delay_feed_processing()​

public function maybe_delay_feed_processing( $is_delayed, $form, $entry, $slug )

Determines if feed processing is delayed by the payment feed configuration.

Parameters​

NameTypeDefaultDescription
$is_delayedboolIs feed processing delayed?
$formarrayThe form currently being processed.
$entryarrayThe entry currently being processed.
$slugstringThe Add-On slug e.g. gravityformsmailchimp

Returns​

  • bool

Since: 2.4.13

Source: includes/addon/class-gf-payment-addon.php:456

payment_status_changed()​

public function payment_status_changed( $entry_id, $previous_status )

Reprocess feeds and triggers gform_post_payment_status_change hook when the payment status changes.

Parameters​

NameTypeDefaultDescription
$entry_idintThe entry ID whose payment status has changed.
$previous_statusstringThe previous payment status. return void

Since: 2.9.20

Source: includes/addon/class-gf-payment-addon.php:479

trigger_payment_delayed_feeds()​

public function trigger_payment_delayed_feeds( $transaction_id, $payment_feed, $entry, $form )

Triggers processing of delayed feeds for other add-ons.

Parameters​

NameTypeDefaultDescription
$transaction_idstringThe transaction or subscription ID.
$payment_feedarrayThe payment feed which originated the transaction.
$entryarrayThe entry currently being processed.
$formarrayThe form currently being processed.

Since: 2.4.13

Source: includes/addon/class-gf-payment-addon.php:518

get_frontend_feeds()​

public function get_frontend_feeds( $form )

Adds additional relevant information for payment add-ons to the frontend feeds

Parameters​

NameTypeDefaultDescription
$formarrayThe Form object to get Frontend Feeds from.

Returns​

  • array — An array with feeds eligible to be a Front End Feed, including feed data necessary for payment add-ons.

Since: unknown

Source: includes/addon/class-gf-payment-addon.php:545

get_post_payment_actions_config()​

public function get_post_payment_actions_config( $feed_slug )

Override to specify where the "Post Payment Action" setting should appear on the payment add-on feed.

Parameters​

NameTypeDefaultDescription
$feed_slugstringThe feed add-on slug.

Returns​

  • array

Since: 2.4.13

Source: includes/addon/class-gf-payment-addon.php:600

confirmation()​

public function confirmation( $confirmation, $form, $entry, $ajax )

Handles post-submission confirmations.

Parameters​

NameTypeDefaultDescription
$confirmationarrayThe confirmation details.
$formarrayThe Form Object that the confirmation is being run for.
$entryarrayThe Entry Object associated with the submission.
$ajaxboolIf the submission was done using AJAX.

Returns​

  • array — The confirmation details.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:632

redirect_url()​

public function redirect_url( $feed, $submission_data, $form, $entry )

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​

NameTypeDefaultDescription
$feedarrayActive payment feed containing all the configuration data.
$submission_dataarrayContains form field data submitted by the user as well as payment information (i.e. payment amount, setup fee, line items, etc...).
$formarrayCurrent form array containing all form settings.
$entryarrayCurrent entry array containing entry information (i.e data submitted by users).

Returns​

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

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:660

maybe_validate()​

public function maybe_validate( $validation_result, $context='api-submit' )

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

Parameters​

NameTypeDefaultDescription
$validation_resultarrayContains the validation result, the Form Object, and the failed validation page number.
$contextstring'api-submit'The context for the current submission. Possible values: form-submit, api-submit, api-validate.

Returns​

  • array — $validation_result

Since:

  • Unknown
  • 2.6.4 (Added the $context param.)

Source: includes/addon/class-gf-payment-addon.php:675

maybe_add_payment_status_to_meta()​

public function maybe_add_payment_status_to_meta( $entry_meta, $form, $context='' )

Handle the entry meta conditional logic confirmations. Adds support for the payment_status entry field to the confirmation condition logic setting.

Parameters​

NameTypeDefaultDescription
$entry_metaarrayThe entry meta.
$formarrayThe form object.
$contextstring''The context indicating where the payment statuses will be used. Possible values: confirmation, feed, pre_evaluate.

Returns​

  • array — Returns the entry meta, with the payment_status field added to it.

Since:

  • 2.9.1
  • 2.9.19 (Added the $context param.)

Source: includes/addon/class-gf-payment-addon.php:705

get_conditional_logic_payment_statuses()​

public function get_conditional_logic_payment_statuses( $form )

Returns the payment statuses that can be used in conditional logic. Override this function to add support for payment statuses in conditional logic.

Example: return array( 'Paid' => __( 'Paid', 'gravityforms' ), 'Failed' => __( 'Failed', 'gravityforms' ), 'Processing' => __( 'Processing', 'gravityforms' ), );

Parameters​

NameTypeDefaultDescription
$formarrayThe form object.

Returns​

  • array — Return an array with the payment statuses that can be used in conditional logic. Return an empty array to disable this feature.

Since: 2.9.19

Source: includes/addon/class-gf-payment-addon.php:758

validation()​

public function validation( $validation_result )

Handles the validation and processing of payments.

Parameters​

NameTypeDefaultDescription
$validation_resultarrayThe validation details to use.

Returns​

  • array — The validation details after completion.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:790

is_valid_payment_amount()​

public function is_valid_payment_amount( $submission_data, $feed, $form, $entry )

Determines if the payment_amount for the current submission is valid for processing.

Parameters​

NameTypeDefaultDescription
$submission_dataarrayThe customer and transaction data.
$feedarrayThe feed to be processed.
$formarrayThe form being processed.
$entryarrayThe temporary entry created from the submitted values.

Returns​

  • bool

Since: 2.4.18

Source: includes/addon/class-gf-payment-addon.php:881

authorize()​

public function authorize( $feed, $submission_data, $form, $entry )

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​

NameTypeDefaultDescription
$feedarrayCurrent configured payment feed.
$submission_dataarrayContains form field data submitted by the user as well as payment information (i.e. payment amount, setup fee, line items, etc...).
$formarrayThe Form Object.
$entryarrayThe 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

Source: includes/addon/class-gf-payment-addon.php:945

capture()​

public function capture( $authorization, $feed, $submission_data, $form, $entry )

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​

NameTypeDefaultDescription
$authorizationarrayContains the result of the authorize() function.
$feedarrayCurrent configured payment feed.
$submission_dataarrayContains form field data submitted by the user as well as payment information. (i.e. payment amount, setup fee, line items, etc...).
$formarrayCurrent form array containing all form settings.
$entryarrayCurrent 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

Source: includes/addon/class-gf-payment-addon.php:976

subscribe()​

public function subscribe( $feed, $submission_data, $form, $entry )

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​

NameTypeDefaultDescription
$feedarrayCurrent configured payment feed.
$submission_dataarrayContains form field data submitted by the user as well as payment information (i.e. payment amount, setup fee, line items, etc...).
$formarrayCurrent form array containing all form settings.
$entryarrayCurrent 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

Source: includes/addon/class-gf-payment-addon.php:1027

cancel()​

public function cancel( $entry, $feed )

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​

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

Returns​

  • bool — Returns true if the subscription was cancelled successfully and false otherwise.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1047

get_validation_result()​

public function get_validation_result( $validation_result, $authorization_result )

Gets the payment validation result.

Parameters​

NameTypeDefaultDescription
$validation_resultarrayContains the form validation results.
$authorization_resultarrayContains the form authorization results.

Returns​

  • array — The validation result for the credit card field.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1064

maybe_process_feed()​

public function maybe_process_feed( $entry, $form )

Sets the processed feed meta.

Parameters​

NameTypeDefaultDescription
$entryarrayThe Entry Object currently being processed.
$formarrayThe Form Object currently being processed.

Returns​

  • array

Since: 2.4.13 (Overrode to prevent processed feed meta being set when a different add-on processed the submission.)

Source: includes/addon/class-gf-payment-addon.php:1093

entry_post_save()​

public function entry_post_save( $entry, $form )

Handles additional processing after an entry is saved.

Parameters​

NameTypeDefaultDescription
$entryarrayThe Entry Object.
$formarrayThe Form Object.

Returns​

  • array — The Entry Object.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1123

process_capture()​

public function process_capture( $authorization, $feed, $submission_data, $form, $entry )

Processed the capturing of payments.

Parameters​

NameTypeDefaultDescription
$authorizationarrayThe payment authorization details.
$feedarrayThe Feed Object.
$submission_dataarrayThe form submission data.
$formarrayThe Form Object.
$entryarrayThe Entry Object.

Returns​

  • array — The Entry Object.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1197

process_subscription()​

public function process_subscription( $authorization, $feed, $submission_data, $form, $entry )

Processes payment subscriptions.

Parameters​

NameTypeDefaultDescription
$authorizationarrayThe payment authorization details.
$feedarrayThe Feed Object.
$submission_dataarrayThe form submission data.
$formarrayThe Form Object.
$entryarrayThe Entry Object.

Returns​

  • array — The Entry Object.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1255

insert_transaction()​

public function insert_transaction( $entry_id, $transaction_type, $transaction_id, $amount, $is_recurring=null, $subscription_id=null )

Inserts a new transaction item.

Parameters​

NameTypeDefaultDescription
$entry_idintThe entry ID that contains the transaction.
$transaction_typestringThe transaction type.
$transaction_idstringThe ID of the transaction to be inserted.
$amountfloatThe transaction amount.
$is_recurringint | nullnullIf the transaction is recurring. Defaults to null.
$subscription_idstring | nullnullThe subscription ID tied to the transaction, if related to a subscription. Defaults to null.

Returns​

  • int | WP_Error — The row ID from the database entry. WP_Error if error.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1328

get_payment_feed()​

public function get_payment_feed( $entry, $form=false )

Gets the payment submission feed.

Parameters​

NameTypeDefaultDescription
$entryarrayThe Entry Object.
$formbool | arrayfalseThe Form Object. Defaults to false.

Returns​

  • array — The submission feed.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1384

is_payment_gateway()​

public function is_payment_gateway( $entry_id )

Determines if this is a payment gateway add-on.

Parameters​

NameTypeDefaultDescription
$entry_idintThe entry ID.

Returns​

  • bool — True if it is a payment gateway. False otherwise.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1423

get_submission_data()​

public function get_submission_data( $feed, $form, $entry )

Gets the payment submission data.

Parameters​

NameTypeDefaultDescription
$feedarrayThe Feed Object.
$formarrayThe Form Object.
$entryarrayThe Entry Object.

Returns​

  • array — The payment submission data.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1458

get_credit_card_field()​

public function get_credit_card_field( $form )

Gets the credit card field object.

Parameters​

NameTypeDefaultDescription
$formarrayThe Form Object.

Returns​

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1522

has_credit_card_field()​

public function has_credit_card_field( $form )

Checks if a form has a credit card field.

Parameters​

NameTypeDefaultDescription
$formarrayThe Form Object.

Returns​

  • bool — True if the form has a credit card field. False otherwise.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1541

get_order_data()​

public function get_order_data( $feed, $form, $entry )

Gets payment order data.

Parameters​

NameTypeDefaultDescription
$feedarrayThe Feed Object.
$formarrayThe Form Object.
$entryarrayThe Entry Object.

Returns​

  • array — { The order data.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1568

get_payment_field()​

public function get_payment_field( $feed )

Returns what should be used to prepare the payment amount; the form_total or the ID of a specific product field.

Override if your add-on uses custom choices for the transactionType setting or does not use the standard recurringAmount and paymentAmount settings.

Parameters​

NameTypeDefaultDescription
$feedarrayThe current feed.

Returns​

  • string

Since: 2.4.17

Source: includes/addon/class-gf-payment-addon.php:1685

is_callback_valid()​

public function is_callback_valid()

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

Returns​

  • bool — True if valid. False otherwise.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1702

maybe_process_callback()​

public function maybe_process_callback()

Conditionally initiates processing of the callback.

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

Returns​

  • void

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1731

register_callback()​

public function register_callback( $callback_id, $entry_id )

Registers a callback action.

Parameters​

NameTypeDefaultDescription
$callback_idstringThe callback ID for the action.
$entry_idintThe entry ID associated with the callback.

Returns​

  • void

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1962

is_duplicate_callback()​

public function is_duplicate_callback( $callback_id )

Checks if a callback is duplicate.

Parameters​

NameTypeDefaultDescription
$callback_idstringThe callback ID to chack.

Returns​

  • bool — If the callback is a duplicate, true. Otherwise, false.

Since: Unknown

Source: includes/addon/class-gf-payment-addon.php:1991

start_subscription()​

public function start_subscription( $entry, $subscription )

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

Parameters​

NameTypeDefaultDescription
$entry[array]Entry object
$subscription
$subscription_id[string]ID of the subscription
$amount[float]Numeric amount of the initial subscription payment

Returns​

  • [array] — $entry Entry Object

Source: includes/addon/class-gf-payment-addon.php:2237

add_subscription_payment()​

public function add_subscription_payment( $entry, $action )

A payment on an existing subscription.

Parameters​

NameTypeDefaultDescription
$entry[array]Entry object
$action
$data[array]Transaction data including 'amount' and 'subscriber_id'

Returns​

  • true

Source: includes/addon/class-gf-payment-addon.php:2284

get_entry_by_transaction_id()​

public function get_entry_by_transaction_id( $transaction_id )

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

Parameters​

NameTypeDefaultDescription
$transaction_idstringThe subscription or transaction ID.

Returns​

  • 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

Source: includes/addon/class-gf-payment-addon.php:2476

post_payment_action()​

public function post_payment_action( $entry, $action )

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

Parameters​

NameTypeDefaultDescription
$entryarray
$actionarray

Since:

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

Source: includes/addon/class-gf-payment-addon.php:2505

reprocess_feeds()​

public function reprocess_feeds( $entry )

Reprocesses feeds that are configured with Payment Status conditional logic.

Parameters​

NameTypeDefaultDescription
$entryarrayThe entry object.
$formarrayThe form object.

Since: 2.9.20

Source: includes/addon/class-gf-payment-addon.php:2530

get_feeds_to_reprocess()​

public function get_feeds_to_reprocess( $feeds, $entry, $form )

Filters out feeds that are not configured with Payment Status conditional logic.

Parameters​

NameTypeDefaultDescription
$feedsarrayThe feeds to be processed.
$entryarrayThe entry currently being processed.
$formarrayThe form currently being processed.

Returns​

  • array — The filtered feeds that are configured with Payment Status conditional logic.

Since: 2.9.20

Source: includes/addon/class-gf-payment-addon.php:2553

get_feed_settings_entry_meta()​

public function get_feed_settings_entry_meta( $form, $entry_meta=[] )

Returning an empty array because payment feed logic is evaluated before entry meta is saved.

Parameters​

NameTypeDefaultDescription
$formarrayThe form the feed is being created or edited for.
$entry_metaarray[]An empty array or the entry meta fields to be assigned to the JavaScript entry_meta variable.

Returns​

  • array

Since: 2.9

Source: includes/addon/class-gf-payment-addon.php:2648

feed_list_title()​

public function feed_list_title()

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

Returns​

  • string

Source: includes/addon/class-gf-payment-addon.php:2657

get_entry_table_name()​

public static function get_entry_table_name()

Get name for entry table.

Returns​

  • string

Since: 2.3

Source: includes/addon/class-gf-payment-addon.php:3658

get_entry_meta_table_name()​

public static function get_entry_meta_table_name()

Get name for entry meta table.

Returns​

  • string

Since: 2.3

Source: includes/addon/class-gf-payment-addon.php:3676

get_gravityforms_db_version()​

public static function get_gravityforms_db_version()

Get version of Gravity Forms database.

Returns​

  • string

Since: 2.3

Source: includes/addon/class-gf-payment-addon.php:3692

creditcard_token_info()​

public function creditcard_token_info( $form )

Override to support creating credit card tokens via Javascript.

Parameters​

NameTypeDefaultDescription
$formmixed

Returns​

  • array

Source: includes/addon/class-gf-payment-addon.php:3778

add_creditcard_token_input()​

public function add_creditcard_token_input( $content, $field, $value, $entry_id, $form_id )

Add input field for credit card token response.

Parameters​

NameTypeDefaultDescription
$contentstring
$fieldGF_Field
$valuestring
$entry_idstring
$form_idstring

Returns​

  • string

Source: includes/addon/class-gf-payment-addon.php:3797

force_ajax_for_creditcard_tokens()​

public function force_ajax_for_creditcard_tokens( $args )

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

Parameters​

NameTypeDefaultDescription
$argsarray

Returns​

  • array

Source: includes/addon/class-gf-payment-addon.php:3824

enqueue_creditcard_token_script()​

public function enqueue_creditcard_token_script( $form )

Determines if GFToken script should be enqueued.

Parameters​

NameTypeDefaultDescription
$formarray

Returns​

  • bool

Source: includes/addon/class-gf-payment-addon.php:3843

register_creditcard_token_script()​

public function register_creditcard_token_script( $form, $field_values, $is_ajax )

Prepare Javascript for creating credit card tokens.

Parameters​

NameTypeDefaultDescription
$formarray
$field_valuesarray
$is_ajaxbool

Returns​

  • void

Source: includes/addon/class-gf-payment-addon.php:3860

get_creditcard_token_entry_fields()​

public function get_creditcard_token_entry_fields( $feeds )

Get needed fields for creating credit card tokens.

Parameters​

NameTypeDefaultDescription
$feedsarray

Returns​

  • array — $fields

Source: includes/addon/class-gf-payment-addon.php:3893

supported_currencies()​

public function supported_currencies( $currencies )

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

Parameters​

NameTypeDefaultDescription
$currenciesCurrently supported currencies

Returns​

  • mixed — A filtered list of supported currencies

Source: includes/addon/class-gf-payment-addon.php:3915

get_currency()​

public function get_currency( $currency_code='' )

Retrieve the currency object for the specified currency code.

Parameters​

NameTypeDefaultDescription
$currency_codestring''

Returns​

Source: includes/addon/class-gf-payment-addon.php:3926

get_amount_export()​

public function get_amount_export( $amount, $currency_code='' )

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​

NameTypeDefaultDescription
$amountint | floatThe value to be formatted.
$currency_codestring''The currency code.

Returns​

  • int | float

Source: includes/addon/class-gf-payment-addon.php:3944

get_amount_import()​

public function get_amount_import( $amount, $currency_code='' )

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

Parameters​

NameTypeDefaultDescription
$amountint | floatThe value to be formatted.
$currency_codestring''The currency code.

Returns​

  • int | float

Source: includes/addon/class-gf-payment-addon.php:3963

maybe_add_action_amount_formatted()​

public function maybe_add_action_amount_formatted( $action, $currency_code='' )

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

Parameters​

NameTypeDefaultDescription
$actionarrayThe payment or subscription properties.
$currency_codestring''The currency code.

Returns​

  • array

Since: 2.3.6.6

Source: includes/addon/class-gf-payment-addon.php:3983

entry_deleted()​

public function entry_deleted( $entry_id )

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

Parameters​

NameTypeDefaultDescription
$entry_id. ID of entry that is being deleted

Source: includes/addon/class-gf-payment-addon.php:4027

before_delete_field()​

public function before_delete_field( $form_id, $field_id )

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

deleted.

Parameters​

NameTypeDefaultDescription
$form_idintID of the form being edited.
$field_idintID of the field being deleted.

Source: includes/addon/class-gf-payment-addon.php:4076

entries_filter_count_queries()​

public static function entries_filter_count_queries( $queries )

Callback for gform_entries_filter_count_queries; registers the db queries to be used to get the entry counts for the filters.

Parameters​

NameTypeDefaultDescription
$queriesarrayThe filter count queries.

Returns​

  • array

Since: 2.9.16.

Source: includes/addon/class-gf-payment-addon.php:4174

filter_links_entry_list()​

public static function filter_links_entry_list( $filter_links, $form, $include_counts, $counts )

Callback for gform_filter_links_entry_list; registers the filter links to be displayed on the entries list page.

Parameters​

NameTypeDefaultDescription
$filter_linksarrayThe filter links to be displayed.
$formarrayThe form that the entries are being viewed for.
$include_countsboolIndicates if the entry counts should be included. True for above the entries list table. False for the screen options.
$countsarrayThe number of entries that match the filters when $include_counts is true.

Since: 2.9.16

Source: includes/addon/class-gf-payment-addon.php:4203