def validate_response_on_success(payment_transaction, response)
      if response.type != success_response_type
        raise ValidationError, "Response type '#{response.type}' does " +
                               "not match success response type '#{success_response_type}'"
      end

      missed_fields = []

      response_fields_definition.each do |field_name|
        missed_fields << field_name unless response.key? field_name
      end

      unless missed_fields.empty?
        raise ValidationError, "Some required fields missed or empty in Response: #{missed_fields.join ', '}"
      end

      validate_client_id payment_transaction, response
    end
def validate_response_on_success(payment_transaction, response)
      if response.type != success_response_type
        raise ValidationError, "Response type '#{response.type}' does " +
                               "not match success response type '#{success_response_type}'"
      end

      missed_fields = []

      response_fields_definition.each do |field_name|
        missed_fields << field_name unless response.key? field_name
      end

      unless missed_fields.empty?
        raise ValidationError, "Some required fields missed or empty in Response: #{missed_fields.join ', '}"
      end

      validate_client_id payment_transaction, response
    end
Validates response before payment transaction updating
 if payment transaction is processing or approved

 @param    payment_transaction   [PaymentTransaction]    Payment transaction
 @param    response              [Response]              Response for validating