Module: MangoApi::DisputeDocuments
- Extended by:
- UriProvider
- Defined in:
- lib/mangopay/api/service/dispute_documents.rb
Overview
Provides API method delegates for the DisputeDocument
entity
Class Method Summary collapse
-
.all {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute documents belonging to the current environment’s client.
-
.consult(id) ⇒ Array
Creates temporary URLs where each page of a dispute document can be viewed.
-
.create(document, dispute_id) ⇒ DisputeDocument
Creates a new dispute document entity.
-
.get(id) ⇒ DisputeDocument
Retrieves a dispute document entity.
-
.of_dispute(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute documents belonging to a certain dispute.
-
.submit(id, dispute_id) ⇒ DisputeDocument
Submits a dispute document entity for approval.
-
.upload_page(id, dispute_id, path) ⇒ Object
Uploads a dispute document page.
Methods included from UriProvider
Class Method Details
.all {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute documents belonging to the current environment’s client. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.
Allowed FilterRequest
params:
-
page
-
per_page
-
sort_field and sort_direction
-
before_date
-
after_date
-
status
-
type
106 107 108 109 110 111 112 |
# File 'lib/mangopay/api/service/dispute_documents.rb', line 106 def all uri = provide_uri(:get_dispute_documents) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |
.consult(id) ⇒ Array
Creates temporary URLs where each page of a dispute document can be viewed
119 120 121 122 123 |
# File 'lib/mangopay/api/service/dispute_documents.rb', line 119 def consult(id) uri = provide_uri(:consult_dispute_document, id) results = HttpClient.post(uri, nil) parse_consults results end |
.create(document, dispute_id) ⇒ DisputeDocument
Creates a new dispute document entity.
DisputeDocument
properties:
-
Required
-
type
-
-
Optional
-
tag
-
document to be created
25 26 27 28 29 |
# File 'lib/mangopay/api/service/dispute_documents.rb', line 25 def create(document, dispute_id) uri = provide_uri(:create_dispute_document, dispute_id) response = HttpClient.post(uri, document) parse response end |
.get(id) ⇒ DisputeDocument
Retrieves a dispute document entity.
61 62 63 64 65 |
# File 'lib/mangopay/api/service/dispute_documents.rb', line 61 def get(id) uri = provide_uri(:get_dispute_document, id) response = HttpClient.get(uri) parse response end |
.of_dispute(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute documents belonging to a certain dispute. Allows configuration of paging and sorting parameters by yielding a filtering object to a provided block. When no filters are specified, will retrieve the first page of 10 newest results.
Allowed FilterRequest
params:
-
page
-
per_page
-
sort_field and sort_direction
-
before_date
-
after_date
-
status
-
type
83 84 85 86 87 88 89 |
# File 'lib/mangopay/api/service/dispute_documents.rb', line 83 def of_dispute(id) uri = provide_uri(:get_disputes_documents, id) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |
.submit(id, dispute_id) ⇒ DisputeDocument
Submits a dispute document entity for approval
50 51 52 53 54 55 |
# File 'lib/mangopay/api/service/dispute_documents.rb', line 50 def submit(id, dispute_id) uri = provide_uri(:submit_dispute_document, dispute_id, id) request = SubmitDocumentRequest.new response = HttpClient.put(uri, request) parse response end |
.upload_page(id, dispute_id, path) ⇒ Object
Uploads a dispute document page. Allowed extensions: .pdf .jpeg .jpg .gif .png
that the page is being uploaded for
38 39 40 41 42 43 |
# File 'lib/mangopay/api/service/dispute_documents.rb', line 38 def upload_page(id, dispute_id, path) uri = provide_uri(:upload_dispute_document_page, dispute_id, id) body = UploadFileRequest.new body.file = FileEncoder.encode_base64 path HttpClient.post(uri, body) end |