Общими усилиями в чате Yii получилось такое решение.
public function rules()
{
return [
[['user_id', 'payment_method', 'credit_card_number', 'credit_card_expr', 'credit_card_cvv', 'credit_card_info','type_pay'], 'required', 'when' => function($model) {
return $model->type_pay == 0;
},'whenClient' => "function (attribute, value) {
return $('input[name=\"Payment[type_pay]\"]:checked').val() == 0;
}"],
[[ 'pre_auth_payment', 'day_month', 'transit_number', 'institution_id', 'account_num'], 'required', 'when' => function($model) {
return $model->type_pay == 1;
},'whenClient' => "function (attribute, value) {
return $('input[name=\"Payment[type_pay]\"]:checked').val() == 1;
}"],
[['user_id'], 'integer'],
[['type_pay'], 'required'],
[['payment_method', 'credit_card_number', 'credit_card_expr', 'credit_card_cvv', 'credit_card_info', 'pre_auth_payment', 'day_month', 'transit_number', 'institution_id', 'account_num'], 'string', 'max' => 255]
];
}