{"record":{"id":"8043e65f9770af74","repo":"antiwork/gumroad","slug":"label-must-include-katakana-characters","errorCode":null,"errorMessage":"#{label} must include katakana characters.","messagePattern":"#(.+?) must include katakana characters\\.","errorType":"exception","errorClass":"StripeBeneficialOwnersManager::InvalidFieldError","httpStatus":422,"severity":"error","filePath":"app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb","lineNumber":206,"sourceCode":"    # request with a blank country would skip these checks and still be sent to Stripe as a\n    # Japanese kana address.\n    address_country = address[:country].to_s.strip.presence || user.alive_user_compliance_info&.legal_entity_country_code\n    return unless address_country == Compliance::Countries::JPN.alpha2\n\n    { building_number_kana: \"Block / Building number (Kana)\",\n      street_address_kana: \"Town/Cho-me (Kana)\",\n      city_kana: \"City/Ward (Kana)\" }.each do |key, label|\n      validate_kana_param!(address[key], label, UserComplianceInfo::KANA_ADDRESS_REGEX, \"katakana, latin characters, digits, spaces, dashes, and dots\")\n    end\n\n    # The building number is often just digits and dashes (e.g. \"1-1\"), so only the town and\n    # city fields must actually contain katakana — matching the browser-side rules.\n    { street_address_kana: \"Town/Cho-me (Kana)\",\n      city_kana: \"City/Ward (Kana)\" }.each do |key, label|\n      value = address[key].to_s\n      next if value.blank?\n      next if value.match?(UserComplianceInfo::HAS_KATAKANA)\n      raise InvalidFieldError, \"#{label} must include katakana characters.\"\n    end\n  end\n  private_class_method :validate_jp_kana_address_format!\n\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","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/antiwork/gumroad/blob/afeacbd394069a1cbf0c6c50ee8e900925050370/app/business/payments/merchant_registration/implementations/stripe/stripe_beneficial_owners_manager.rb#L188-L224","documentation":"InvalidFieldError from StripeBeneficialOwnersManager.validate_jp_kana_address_format! (StripeBeneficialOwnersManager.validate_jp_kana_address_format!). For Japanese beneficial owners, Stripe requires the kana address block; the town/cho-me (street_address_kana) and city/ward (city_kana) values must actually contain katakana — digits-and-dashes-only values like \"1-1\" pass the character whitelist but fail here. Blank values are skipped; the check mirrors the browser-side rules so client and server agree.","triggerScenarios":"Submitting a JP beneficial owner with street_address_kana or city_kana filled in only with latin/digits/dashes/spaces (e.g. \"1-1\" or \"Shibuya\") with no katakana characters (UserComplianceInfo::HAS_KATAKANA does not match).","commonSituations":"Sellers pasting the romaji/latin address into the kana fields; IME left in latin mode so the kana conversion never happened; form prefill copying the kanji/latin address block into the kana block; automated imports using the latin address for all four address variants.","solutions":["Enter the town/cho-me and city/ward in katakana (e.g. \"シブヤ\" not \"Shibuya\") in the two kana fields and resubmit.","Keep the other kana fields (block/building) consistent with the whitelist check — they only need valid characters, not actual katakana.","If building a client, replicate the browser-side rule: require HAS_KATAKANA on those two fields before submit to avoid the round trip.","For data imports, run a kana conversion (romaji->katakana) or leave the fields blank rather than duplicating latin values."],"exampleFix":"# before\naddress = { street_address_kana: \"1-1\", city_kana: \"Shibuya\", ... }\n# after (katakana in the two fields that require it)\naddress = { street_address_kana: \"ジンヤマエ１－１\", city_kana: \"シブヤ\", ... }","handlingStrategy":"validation","validationCode":"KATAKANA = /[\\p{Katakana}]/\nreturn if value.blank?\nraise InvalidFieldError unless KATAKANA.match?(value)","typeGuard":"def contains_katakana?(value)\n  value.to_s.match?(UserComplianceInfo::HAS_KATAKANA)\nend","tryCatchPattern":null,"preventionTips":["Apply the same HAS_KATAKANA check in the form before submit.","Use an IME kana input mode for kana fields so latin text can't be entered.","Leave non-required kana fields blank instead of pasting the latin address."],"tags":["stripe","japan","katakana","kyc","beneficial-owners","localization","validation"],"backgroundTag":"locale-specific-field-validation","analyzedSha":"afeacbd394069a1cbf0c6c50ee8e900925050370","analyzedAt":"2026-08-21T17:58:52.159Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}