bookmark_bordergform_authorizenet_validation_message

Description

This filter can be used to modify the validation message added to the credit card field when Authorize.net returns an error during card authorization.

Usage

The filter which would run for all Authorize.net feeds can be used like so:

add_filter( 'gform_authorizenet_validation_message', 'your_function_name', 10, 5 );

Parameters

  • $message string

    The default error message.

  • $validation_result array

    An associative array containing the form validation result, the form object, and the number of the page where the validation error occurred.

  • $post array

    The global $_POST containing the input values posted by the browser.

  • $response object

    The response from Authorize.net.

  • $responsetype string

    The type of response. Possible values: arb or aim.

Examples

1. Use the Authorize.net Response Reason Text

add_filter( 'gform_authorizenet_validation_message', function( $message, $validation_result, $post, $response, $responsetype ) {
    $message = $response->response_reason_text;

    return $message;
}, 10, 5 );

Placement

Your code snippet should be placed in the functions.php file of your active theme.

Source Code

This filter is located in GFAuthorizeNet::authorize() and GFAuthorizeNet::subscribe() in class-gf-authorizenet.php