Class: Dinie::Resources::Customers::KycAttachments
- Inherits:
-
Object
- Object
- Dinie::Resources::Customers::KycAttachments
- Defined in:
- lib/dinie/generated/resources/customers.rb,
sig/dinie/generated/resources/customers.rbs
Overview
customers.kyc_attachments — the KYC attachment-upload subresource.
Instance Method Summary collapse
-
#create(customer_id, request_options: {}, **upload) ⇒ Object
Upload a KYC attachment.
-
#initialize(http) ⇒ KycAttachments
constructor
A new instance of KycAttachments.
-
#upload_selfie(customer_id, request_options: {}, **fields) ⇒ Object
Upload a KYC selfie.
Constructor Details
#initialize(http) ⇒ KycAttachments
Returns a new instance of KycAttachments.
164 165 166 |
# File 'lib/dinie/generated/resources/customers.rb', line 164 def initialize(http) @http = http end |
Instance Method Details
#create(customer_id, request_options: {}, **upload) ⇒ Object
Upload a KYC attachment
Upload a KYC attachment for the customer via multipart/form-data. For document requirements, send a file. For data-type requirements (e.g. email), send a value instead.
176 177 178 179 180 181 |
# File 'lib/dinie/generated/resources/customers.rb', line 176 def create(customer_id, request_options: {}, **upload) form = Dinie.serialize_kyc_upload(**upload) body = Dinie::Internal::Multipart.new(fields: form.fields, file: form.file) raw = @http.request(method: :post, path: "/customers/#{customer_id}/kyc-attachments", body:, request_options:) KycAttachmentResponse.deserialize(raw) end |
#upload_selfie(customer_id, request_options: {}, **fields) ⇒ Object
Upload a KYC selfie
Session-only upload of a selfie for biometric validation. Counterpart of the polymorphic /kyc-attachments route, dedicated to selfies: evidence_type (selfie) and attachment_type (photo) are implicit, so the partner only supplies requirement_id (selfie_{subject_id}) and the file. Requires a session token bound to the customer — a partner bearer is denied (403), even with kyc:upload.
191 192 193 194 195 196 |
# File 'lib/dinie/generated/resources/customers.rb', line 191 def upload_selfie(customer_id, request_options: {}, **fields) body = fields raw = @http.request(method: :post, path: "/customers/#{customer_id}/kyc-attachments/selfie", body:, request_options:) KycAttachmentResponse.deserialize(raw) end |