Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Giving invalid validation for following numbers #126

Open
PallavSharma17 opened this issue Apr 24, 2023 · 0 comments
Open

Giving invalid validation for following numbers #126

PallavSharma17 opened this issue Apr 24, 2023 · 0 comments

Comments

@PallavSharma17
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant