Class: DocFox::EvidenceSubmission::RejectService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/doc_fox/evidence_submission/reject_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, reason:) ⇒ RejectService

Returns a new instance of RejectService.



12
13
14
15
# File 'lib/doc_fox/evidence_submission/reject_service.rb', line 12

def initialize(id:, reason:)
  @id     = id
  @reason = reason
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/doc_fox/evidence_submission/reject_service.rb', line 4

def id
  @id
end

#reasonObject (readonly)

Returns the value of attribute reason.



4
5
6
# File 'lib/doc_fox/evidence_submission/reject_service.rb', line 4

def reason
  @reason
end

Instance Method Details

#callObject

Reject an active evidence submission.

https://www.docfoxapp.com/api/v2/documentation#tag/Evidence-Submissions/paths/~1api~1v2~1evidence_submissions~1%7Bevidence_submission_id%7D~1reject/patch

Examples

service = DocFox::EvidenceSubmission::RejectService.call(id: '', reason: '')

service.success? # => true
service.errors # => #<ActiveModel::Errors []>

service.response # => #<Faraday::Response ...>
service.response.status # => 200
service.response.body # => {}

service.facade # => #<DocFox::EvidenceSubmission::Facade ...>
service.facade.id
service.id

PATCH /api/v2/kyc_applications/:id/archive



37
38
39
# File 'lib/doc_fox/evidence_submission/reject_service.rb', line 37

def call
  connection.patch("evidence_submissions/#{id}/reject", **params)
end