Class: Msg91::Otp

Inherits:
Object
  • Object
show all
Defined in:
lib/msg91/otp.rb

Class Method Summary collapse

Class Method Details

.resend_otp(retrytype, mobile, optional_params = {}) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/msg91/otp.rb', line 19

def self.resend_otp(retrytype, mobile, optional_params = {})
  auth_key = Msg91.configuration.auth_key
  params = { retrytype: retrytype, mobile: mobile, authkey: auth_key }
  params.merge!(optional_params) unless optional_params.empty?
  path = 'api/v5/otp/retry'
  Msg91::HttpClient.new.get(path, params)
end

.send_otp(template_id, mobile, optional_params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/msg91/otp.rb', line 3

def self.send_otp(template_id, mobile, optional_params = {})
  auth_key = Msg91.configuration.auth_key
  params = { template_id: template_id, mobile: mobile, authkey: auth_key }
  params.merge!(optional_params) unless optional_params.empty?
  path = '/api/v5/otp'
  Msg91::HttpClient.new.get(path, params)
end

.verify_otp(mobile, optional_params = {}) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/msg91/otp.rb', line 11

def self.verify_otp(mobile, optional_params = {})
  auth_key = Msg91.configuration.auth_key
  params = { mobile: mobile, authkey: auth_key }
  params.merge!(optional_params) unless optional_params.empty?
  path = 'api/v5/otp/verify'
  Msg91::HttpClient.new.get(path, params)
end