Class: DocFox::KycApplication::CreateService
- Inherits:
-
BaseService
- Object
- BaseService
- DocFox::KycApplication::CreateService
- Defined in:
- lib/doc_fox/kyc_application/create_service.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#call ⇒ Object
Create a KYC application.
-
#initialize(data:) ⇒ CreateService
constructor
A new instance of CreateService.
Constructor Details
#initialize(data:) ⇒ CreateService
Returns a new instance of CreateService.
12 13 14 |
# File 'lib/doc_fox/kyc_application/create_service.rb', line 12 def initialize(data:) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/doc_fox/kyc_application/create_service.rb', line 4 def data @data end |
Instance Method Details
#call ⇒ Object
Create a KYC application.
Examples
service = DocFox::KycApplication::CreateService.call(
data: {
type: 'kyc_application',
attributes: {
kyc_entity_template_id: 'aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb',
names: {
first_names: 'Eric Theodore',
last_names: 'Cartman'
},
# ...more fields following the schema definitions.
}
}
)
service.success? # => true
service.errors # => #<ActiveModel::Errors []>
service.response # => #<Faraday::Response ...>
service.response.status # => 201
service.response.body # => {}
service.facade # => #<DocFox::KycApplication::Facade ...>
service.facade.id
service.id
POST /api/v2/kyc_applications
48 49 50 |
# File 'lib/doc_fox/kyc_application/create_service.rb', line 48 def call connection.post('kyc_applications', **params) end |