Class: Twilio::REST::Verify::V2::ServiceContext::VerificationCheckList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service/verification_check.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid: nil) ⇒ VerificationCheckList

Initialize the VerificationCheckList

Parameters:

  • Version that contains the resource



28
29
30
31
32
33
34
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 28

def initialize(version, service_sid: nil)
    super(version)
    # Path Solution
    @solution = { service_sid: service_sid }
    @uri = "/Services/#{@solution[:service_sid]}/VerificationCheck"
    
end

Instance Method Details

#create(code: :unset, to: :unset, verification_sid: :unset, amount: :unset, payee: :unset, sna_client_token: :unset) ⇒ VerificationCheckInstance

Create the VerificationCheckInstance

Parameters:

  • (defaults to: :unset)

    The 4-10 character string being verified.

  • (defaults to: :unset)

    The phone number or [email](www.twilio.com/docs/verify/email) to verify. Either this parameter or the ‘verification_sid` must be specified. Phone numbers must be in [E.164 format](www.twilio.com/docs/glossary/what-e164).

  • (defaults to: :unset)

    A SID that uniquely identifies the Verification Check. Either this parameter or the ‘to` phone number/(www.twilio.com/docs/verify/email) must be specified.

  • (defaults to: :unset)

    The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

  • (defaults to: :unset)

    The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

  • (defaults to: :unset)

    A sna client token received in sna url invocation response needs to be passed in Verification Check request and should match to get successful response.

Returns:

  • Created VerificationCheckInstance



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 44

def create(
    code: :unset, 
    to: :unset, 
    verification_sid: :unset, 
    amount: :unset, 
    payee: :unset, 
    sna_client_token: :unset
)

    data = Twilio::Values.of({
        'Code' => code,
        'To' => to,
        'VerificationSid' => verification_sid,
        'Amount' => amount,
        'Payee' => payee,
        'SnaClientToken' => sna_client_token,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    VerificationCheckInstance.new(
        @version,
        payload,
        service_sid: @solution[:service_sid],
    )
end

#to_sObject

Provide a user friendly representation



80
81
82
# File 'lib/twilio-ruby/rest/verify/v2/service/verification_check.rb', line 80

def to_s
    '#<Twilio.Verify.V2.VerificationCheckList>'
end