Methods summary
public
|
#
pre_init( )
Runs before the payment add-on is initialized.
Runs before the payment add-on is initialized.
Since
Unknown
Uses
Used-by
GFAddOn::__construct()
Overrides
|
public
|
#
init( )
Runs when the payment add-on is initialized.
Runs when the payment add-on is initialized.
Since
Unknown
Uses
Overrides
|
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
Overrides
|
public
|
#
init_ajax( )
Runs only when AJAX actions are being performed.
Runs only when AJAX actions are being performed.
Since
Unknown
Uses
Overrides
|
public
|
#
setup( )
Runs the setup of the payment add-on.
Runs the setup of the payment add-on.
Since
Unknown
Uses
Overrides
|
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
|
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
Used by
|
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
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
Used by
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
Used by
|
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
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
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
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
Used by
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
Used by
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
Used by
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
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
Used by
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
Returns
boolean True if it is a payment gateway. False otherwise.
Since
Unknown
Uses
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
Used by
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
Returns
boolean|GF_Field_CreditCard The credit card field object, if found. Otherwise, false.
Since
Unknown
Uses
Used by
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
Returns
boolean True if the form has a credit card field. False otherwise.
Since
Unknown
Uses
Used-by
GFPaymentAddOn::feed_list_message()
|
public
array
|
#
get_order_data( array $feed, array $form, array $entry )
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
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
Used by
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
Used by
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
|
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
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
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
|
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
|
|
public
|
|
public
|
|
public
|
|
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
Since
2.3.6.6 Added the $action to the GFAPI::send_notifications() $data param.
unknown
Used by
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
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
|
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
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
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
|
public
|
|
public
|
|
public
|
|
public static
|
|
public
|
#
results_data( mixed $form, mixed $fields, mixed $search_criteria, mixed $state_array )
|
public
|
|
public
|
|
public
|
|
public
|
#
results_filter_ui( mixed $filter_ui, mixed $form_id, mixed $page_title, mixed $gf_page, mixed $gf_view )
|
public
|
|
public
|
|
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
|
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
|
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
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
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
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
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
|
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
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
|
|
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
|
public
|
|
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
|
public
|
|
public
|
|
public
|
|