Class: Telnyx::Verification

Inherits:
APIResource show all
Extended by:
APIOperations::Create, APIOperations::NestedResource
Defined in:
lib/telnyx/verification.rb

Defined Under Namespace

Classes: Response

Constant Summary collapse

OBJECT_NAME =
"verify_verification".freeze
RESOURCE_PATH =
"verifications".freeze

Instance Attribute Summary

Attributes inherited from APIResource

#save_with_parent

Class Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::NestedResource

nested_resource_class_methods

Methods inherited from APIResource

class_name, identified_resource_url, inherited, #refresh, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from TelnyxObject

#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Telnyx::TelnyxObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Telnyx::TelnyxObject

Class Method Details

.call(params = {}, opts = {}) ⇒ Object

Trigger a call verification.



29
30
31
# File 'lib/telnyx/verification.rb', line 29

def self.call(params = {}, opts = {})
  create(params, { **opts, resource_url: "#{resource_url}/call" })
end

.flashcall(params = {}, opts = {}) ⇒ Object

Trigger a flashcall verification.



44
45
46
# File 'lib/telnyx/verification.rb', line 44

def self.flashcall(params = {}, opts = {})
  create(params, { **opts, resource_url: "#{resource_url}/flashcall" })
end

.psd2(params = {}, opts = {}) ⇒ Object

Trigger a PSD2 verification.



39
40
41
# File 'lib/telnyx/verification.rb', line 39

def self.psd2(params = {}, opts = {})
  create(params, { **opts, resource_url: "#{resource_url}/psd2" })
end

.sms(params = {}, opts = {}) ⇒ Object

Trigger an SMS verification.



34
35
36
# File 'lib/telnyx/verification.rb', line 34

def self.sms(params = {}, opts = {})
  create(params, { **opts, resource_url: "#{resource_url}/sms" })
end

.submit_code(params = {}) ⇒ Object



22
23
24
25
26
# File 'lib/telnyx/verification.rb', line 22

def self.submit_code(params = {})
  url = "#{resource_url}/by_phone_number/#{CGI.escape params[:phone_number]}/actions/verify"
  resp, _opts = request(:post, url, params)
  Response.construct_from resp.data[:data]
end

.whatsapp(params = {}, opts = {}) ⇒ Object

Trigger a whatsapp verification.



49
50
51
# File 'lib/telnyx/verification.rb', line 49

def self.whatsapp(params = {}, opts = {})
  create(params, { **opts, resource_url: "#{resource_url}/whatsapp" })
end