{"record":{"id":"2a92ef009d01ea5b","repo":"antiwork/gumroad","slug":"your-c-dula-de-ciudadan-a-or-c-dula-de-extranjer-a","errorCode":null,"errorMessage":"Your Cédula de Ciudadanía or Cédula de Extranjería must be 6-10 digits. Enter it exactly as it appears on your document — do not add leading zeros, as the number has to match the document you may later be asked to upload.","messagePattern":"Your Cédula de Ciudadanía or Cédula de Extranjería must be 6-10 digits\\. Enter it exactly as it appears on your document — do not add leading zeros, as the number has to match the document you may later be asked to upload\\.","errorType":"exception","errorClass":"StripeBeneficialOwnersManager::InvalidFieldError","httpStatus":422,"severity":"error","filePath":"app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb","lineNumber":228,"sourceCode":"\n  def self.validate_kana_param!(value, label, regex, allowed_description)\n    value = value.to_s\n    return if value.blank?\n    return if value.match?(regex)\n    raise InvalidFieldError, \"#{label} may only contain #{allowed_description}.\"\n  end\n  private_class_method :validate_kana_param!\n\n  # The form's maxLength counts characters so a pasted \"1.123.456.789\" fits, which means a value can\n  # satisfy the input and still carry too few digits. Checking digits here — and normalizing in\n  # build_person_params — keeps this path from handing Stripe a number it will refuse, which is the\n  # rolled-back-create failure that left one seller with eight silent attempts.\n  def self.validate_colombia_id_number!(params, user)\n    return unless user.alive_user_compliance_info&.legal_entity_country_code == Compliance::Countries::COL.alpha2\n    id_number = params[:id_number].to_s\n    return if id_number.strip.blank?\n    return if Compliance::ColombiaIdNumber.valid?(id_number)\n    raise InvalidFieldError, Compliance::ColombiaIdNumber::ERROR_MESSAGE\n  end\n  private_class_method :validate_colombia_id_number!\n\n  def self.representative?(person)\n    relationship = person.is_a?(Hash) ? person[:relationship] || person[\"relationship\"] : person[:relationship]\n    !!(relationship && (relationship[:representative] || relationship[\"representative\"]))\n  end\n  private_class_method :representative?\n\n  def self.symbolize(value)\n    case value\n    when Hash then value.deep_symbolize_keys\n    when Stripe::StripeObject then value.to_hash.deep_symbolize_keys\n    else value\n    end\n  end\n  private_class_method :symbolize\n","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/antiwork/gumroad/blob/afeacbd394069a1cbf0c6c50ee8e900925050370/app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb#L210-L246","documentation":"InvalidFieldError from StripeBeneficialOwnersManager.validate_colombia_id_number! when a Colombian seller's beneficial owner/representative submits an id_number that fails Compliance::ColombiaIdNumber.valid? (Cédula de Ciudadanía / Cédula de Extranjería must be 6-10 digits, no leading zeros added by the user). It only runs when the user's alive compliance info country is CO, and it exists because the form's maxLength counts characters, so a formatted \"1.123.456.789\" can pass the input while carrying too few digits — Stripe would reject it after a rolled-back create. Blank values are skipped.","triggerScenarios":"Creating/updating a beneficial owner for a user whose legal_entity_country_code is \"CO\" with params[:id_number] present but not 6-10 digits — e.g. \"1.123.456\" (7 digits after normalization fails the range) or with user-added leading zeros.","commonSituations":"Sellers typing the document number with dots/commas and dropping digits; users padding with leading zeros believing the document stores them; front-end maxLength giving false confidence; the historical rolled-back-create incident (eight silent attempts) this guard now prevents.","solutions":["Enter the Cédula exactly as printed on the document: 6-10 digits, no extra leading zeros, then resubmit.","If building the form, validate with the same rule client-side (strip separators, count digits, reject outside 6-10) instead of relying on maxLength.","Normalize (strip dots/spaces) before sending — build_person_params normalizes, but the value must still be a valid document number afterwards.","Do not upload/pad zeros to reach 6 digits — the number must match the physical document the seller may later be asked to upload."],"exampleFix":"# before\nparams[:id_number] = \"1.123.456\"   # 7 digits, dots counted by maxLength\n# after\nparams[:id_number] = \"1023456789\" # exactly the digits on the Cédula, 6-10, no added zeros","handlingStrategy":"validation","validationCode":"digits = id_number.to_s.gsub(/[^0-9]/, \"\")\nResult.invalid(Compliance::ColombiaIdNumber::ERROR_MESSAGE) unless (6..10).cover?(digits.length) && !digits.start_with?(\"0\")","typeGuard":"def valid_colombia_cedula?(id_number)\n  Compliance::ColombiaIdNumber.valid?(id_number.to_s)\nend","tryCatchPattern":null,"preventionTips":["Validate digit count client-side (after stripping separators), never rely on maxLength.","Tell sellers to copy the number exactly from the physical Cédula — no padded zeros.","Only collect/validate id_number for Colombian legal entities (country gate)."],"tags":["colombia","kyc","national-id","stripe","beneficial-owners","validation"],"backgroundTag":"national-id-format-invalid","analyzedSha":"afeacbd394069a1cbf0c6c50ee8e900925050370","analyzedAt":"2026-08-21T17:58:52.159Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}