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

Correct phone number failed the validatiton #115

Closed
EveDreamer opened this issue Sep 28, 2015 · 3 comments
Closed

Correct phone number failed the validatiton #115

EveDreamer opened this issue Sep 28, 2015 · 3 comments

Comments

@EveDreamer
Copy link

Hi,
I set a variable named mobile whose value is 13464359857. It is a correct formatted phone number in China. But it could not pass the validation after I did mobile = PhonyRails.normalize_number(mobile, country_code: 'CN'), the validation Phony.plausible?(mobile) will return false.
But if I do not format the original phone number with PhonyRails, Phony.plausible?(mobile) will return true.
Is this a phony_rails issue or phony issue? Thank you!

@joost
Copy link
Owner

joost commented Sep 30, 2015

The country code for CN is +86 according to our data.

irb(main):011:0> m = PhonyRails.normalize_number(mobile, country_code: 'CN')
=> "+8613464359857"

So the above should be a valid China number?

I think otherwise Phony will think it is a +1 (US) number.

@EveDreamer
Copy link
Author

Yes, "+8613464359857" is a valid China mobile number, "13464359857" was formatted by PhonyRails correctly. I was just confused that why "13464359857" could pass Phony's validation while "+8613464359857" could not. Now I know it is a Phony issue. And I will check the source code of Phony. Thank you for your help and sorry for the late reply.

@joost
Copy link
Owner

joost commented Oct 8, 2015

So I guess this can be closed.

@joost joost closed this as completed Oct 8, 2015
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

2 participants