Skip to content

Giving invalid validation for following numbers  #126

@ghost

Description

23776671338

Country Code ---- 237
Country --- Cameroon
TelephoneNumber.invalid?('76671338', 'CM', [:mobile, :fixed_line])
giving true for this

559282828685
Country Code -- 55
Country -- BR
TelephoneNumber.invalid?('9282828685', 'BR', [:mobile, :fixed_line])

But these two numbers i have received from whatsapp meta webhook

[{"id"=>"102901402735930", "changes"=>[{"value"=>{"messaging_product"=>"whatsapp", "metadata"=>{"display_phone_number"=>"918069195810", "phone_number_id"=>"109626598719981"}, "contacts"=>[{"profile"=>{"name"=>"A. Banderas"}, "wa_id"=>"23776671338"}], "messages"=>[{"context"=>{"from"=>"918069195810", "id"=>"wamid.HBgLMjM3NzY2NzEzMzgVAgARGBI0NDNDNTk2QjI3RDk5MDc2RTAA"}, "from"=>"23776671338", "id"=>"wamid.HBgLMjM3NzY2NzEzMzgVAgASGBQzQUQ3QkU0NTg2RDQ1QTZDNERERQA=", "timestamp"=>"1681753310", "type"=>"interactive", "interactive"=>{"type"=>"list_reply", "list_reply"=>{"id"=>"2", "title"=>"CNSGH To CMDLA", "description"=>"Shanghai (CNSGH), Shanghai, Ch.. To Douala (CMDLA), Douala, Cameroon"}}}]}, "field"=>"messages"}]}]

[{"id"=>"102901402735930", "changes"=>[{"value"=>{"messaging_product"=>"whatsapp", "metadata"=>{"display_phone_number"=>"918069195810", "phone_number_id"=>"109626598719981"}, "contacts"=>[{"profile"=>{"name"=>"Daniella Martins"}, "wa_id"=>"559282828685"}], "messages"=>[{"context"=>{"from"=>"918069195810", "id"=>"wamid.HBgMNTU5MjgyODI4Njg1FQIAERgSRTVBMTU1MzQyRjI1OTJFNkZCAA=="}, "from"=>"559282828685", "id"=>"wamid.HBgMNTU5MjgyODI4Njg1FQIAEhgUM0FCN0QzNUNCQ0E1NTk3NDEzQTEA", "timestamp"=>"1681183686", "type"=>"interactive", "interactive"=>{"type"=>"button_reply", "button_reply"=>{"id"=>"1", "title"=>"Make a new search"}}}]}, "field"=>"messages"}]}]

If these two are verified from whatsapp , so i should also be able to save these numbers in my database, but the gem gives invalid for both

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions