arm_validate_payment_gateway_fields

This Filter used to validate payment gateway fields in membership setup form action.

Hook Type: Filter
Usage:
add_filter( 'arm_validate_payment_gateway_fields', 'your_function', 10, 4);
function your_function($pg_errors, $post_data, $gateway_key, $gateway_options) {
    //$pg_errors True OR error message.
    //$post_data Posted membership setup form data.
    //$gateway_key Payment Gateway Key.
    //$gateway_options Payment Gateway Settings Array.
    if($gateway_key == 'custom_gateway') {
        if($post_data[$gateway_key]['card_number'] == '') {
            $pg_errors = 'Please fill required fields';
        } else {
            $pg_errors = true;
        }
    }
    return $pg_errors;
}
Parameters:
$pg_errors
True OR error message
$post_data
Posted membership setup form data
$gateway_key
Payment Gateway Key
$gateway_options
Payment Gateway Settings Array