gform_authorizenet_validation_message

gform_authorizenet_validation_message

DescriptionUsageParametersExamples1. Use the Authorize.net Response Reason TextPlacementSource Code

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:
1add_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
12345add_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

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注