Class: SatMx::VerifyRequest Private

Inherits:
Object
  • Object
show all
Defined in:
lib/sat_mx/verify_request.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body:, client:) ⇒ VerifyRequest

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of VerifyRequest.



21
22
23
24
# File 'lib/sat_mx/verify_request.rb', line 21

def initialize(body:, client:)
  @body = body
  @client = client
end

Class Method Details

.call(request_id:, requester_rfc:, access_token:, private_key:, certificate:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



14
15
16
17
18
19
# File 'lib/sat_mx/verify_request.rb', line 14

def self.call(request_id:, requester_rfc:, access_token:, private_key:, certificate:)
  new(
    body: VerifyRequestBody.new(request_id:, requester_rfc:, certificate:),
    client: Client.new(private_key:, access_token:)
  ).call
end

Instance Method Details

#callObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



26
27
28
29
30
31
32
33
34
35
36
# File 'lib/sat_mx/verify_request.rb', line 26

def call
  response = client.verify_request(body.generate)
  case response.status
  when 200..299
    check_body_status(response.xml)
  when 400..599
    Result.new(success?: false, value: nil, xml: response.xml)
  else
    SatMx::Error
  end
end