23 lines
748 B
Ruby
23 lines
748 B
Ruby
class VerifyNumber
|
|
|
|
def self.send_message(phone, pin)
|
|
|
|
url = "http://smspoh.com/api/http/send?key=5QfyN0OtGsFXnOqwtpVAGZCyPGP28nbX_Nm_oPsUw2ybq714T_951ycz3Ypl5URA&message=Local Kitchen,+Pin+Code:+"+pin.to_s+"&recipients="+ phone.to_s
|
|
|
|
begin
|
|
@result = HTTParty.get(url.to_str)
|
|
|
|
rescue HTTParty::Error
|
|
response = {status: false, message: "Can't open membership server "}
|
|
rescue Net::OpenTimeout
|
|
response = { status: false , message: "Can't open membership server "}
|
|
rescue OpenURI::HTTPError
|
|
response = { status: false, message: "Can't open membership server "}
|
|
rescue SocketError
|
|
response = { status: false, message: "Can't open membership server "}
|
|
end
|
|
puts @result
|
|
end
|
|
|
|
end
|