wpcf7_stripe_skip_spam_check()CF7 1.0

Skips the spam check if it is not necessary.

Хуков нет.

Возвращает

true|false. True if the spam check is not necessary.

Использование

wpcf7_stripe_skip_spam_check( $skip_spam_check, $submission );
$skip_spam_check (обязательный)
-
$submission (обязательный)
-

Код wpcf7_stripe_skip_spam_check() CF7 5.9.3

function wpcf7_stripe_skip_spam_check( $skip_spam_check, $submission ) {
	$service = WPCF7_Stripe::get_instance();

	if ( ! $service->is_active() ) {
		return $skip_spam_check;
	}

	if ( ! empty( $_POST['_wpcf7_stripe_payment_intent'] ) ) {
		$pi_id = trim( $_POST['_wpcf7_stripe_payment_intent'] );
		$payment_intent = $service->api()->retrieve_payment_intent( $pi_id );

		if ( isset( $payment_intent['status'] )
		and ( 'succeeded' === $payment_intent['status'] ) ) {
			$submission->push( 'payment_intent', $pi_id );
		}
	}

	if ( ! empty( $submission->pull( 'payment_intent' ) )
	and $submission->verify_posted_data_hash() ) {
		$skip_spam_check = true;
	}

	return $skip_spam_check;
}