gform_paypal_hash_matches

gform_paypal_hash_matches

DescriptionUsageParametersExamplesPlacementSource Code

Description
Allows additional validation of the hash to be performed.
Usage
add_filter( 'gform_paypal_hash_matches', 'your_function_name', 10, 4 );

Parameters

$hash_matches bool
Indicates if the hash matches.

$entry_id int
The ID of the current entry

$hash string
The hash.

$custom_field string
The pipe-delimited string in the IPN from PayPal. This contains the entry id and the hash.

Examples
add_filter( 'gform_paypal_hash_matches', 'validate_hash', 10, 4 );
function validate_hash( $hash_matches, $entry_id, $hash, $custom_field ){
//do further checks on the hash or force failure, whatever
if ( $entry_id > 100 ){
return false;
}
return true;
}

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFPayPal::get_entry() in gravityformspaypal/class-gf-paypal.php.

發表回覆

您的郵箱地址不會被公開。 必填項已用 * 標註