Module: MangoApi::Disputes
- Extended by:
- UriProvider
- Defined in:
- lib/mangopay/api/service/disputes.rb
Overview
Provides API method delegates concerning the Dispute
entity
Class Method Summary collapse
-
.all {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute entities belonging to the current client.
-
.close(id) ⇒ Dispute
Closes a dispute, an optional action which effectively confirms that the dispute will not be contested.
-
.get(id) ⇒ Dispute
Retrieves a dispute entity.
-
.of_user(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute entities belonging to a certain user.
-
.of_wallet(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute entities belonging to a certain wallet.
-
.pending_settlement {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute entities that allow a settlement transfer.
-
.resubmit(id) ⇒ Dispute
Re-submits a dispute entity if it is reopened requiring more documents.
-
.submit(dispute) ⇒ Dispute
Contests a dispute entity.
-
.update(dispute) ⇒ Dispute
Updates the dispute entity identifiable by the provided dispute object’s ID.
Methods included from UriProvider
Class Method Details
.all {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute entities belonging to the current 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
-
dispute_type
-
status
156 157 158 159 160 161 162 |
# File 'lib/mangopay/api/service/disputes.rb', line 156 def all uri = provide_uri(:get_disputes) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |
.close(id) ⇒ Dispute
Closes a dispute, an optional action which effectively confirms that the dispute will not be contested.
31 32 33 34 35 |
# File 'lib/mangopay/api/service/disputes.rb', line 31 def close(id) uri = provide_uri(:close_dispute, id) response = HttpClient.put(uri, MangoModel::Dispute.new) parse response end |
.get(id) ⇒ Dispute
Retrieves a dispute entity.
62 63 64 65 66 |
# File 'lib/mangopay/api/service/disputes.rb', line 62 def get(id) uri = provide_uri(:get_dispute, id) response = HttpClient.get(uri) parse response end |
.of_user(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute entities belonging to a certain user. 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
-
dispute_type
-
status
85 86 87 88 89 90 91 |
# File 'lib/mangopay/api/service/disputes.rb', line 85 def of_user(id) uri = provide_uri(:get_users_disputes, id) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |
.of_wallet(id) {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute entities belonging to a certain wallet. 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
-
dispute_type
-
status
110 111 112 113 114 115 116 |
# File 'lib/mangopay/api/service/disputes.rb', line 110 def of_wallet(id) uri = provide_uri(:get_wallets_disputes, id) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |
.pending_settlement {|filter_request = FilterRequest.new| ... } ⇒ Array
Retrieves dispute entities that allow a settlement transfer. In the event of having credit following a Dispute (because it was lost, or the full amount wasn’t contested), a settlement transfer can optionally be done to transfer funds from the original wallet to the credit wallet. A dispute allows a settlement transfer when there is remaining credit and when funds are still available in the original wallet.
Allowed FilterRequest
params:
-
page
-
per_page
-
sort_field and sort_direction
132 133 134 135 136 137 138 |
# File 'lib/mangopay/api/service/disputes.rb', line 132 def pending_settlement uri = provide_uri(:get_disputes_pending_settlement) filter_request = nil yield filter_request = FilterRequest.new if block_given? results = HttpClient.get(uri, filter_request) parse_results results end |
.resubmit(id) ⇒ Dispute
Re-submits a dispute entity if it is reopened requiring more documents.
52 53 54 55 56 |
# File 'lib/mangopay/api/service/disputes.rb', line 52 def resubmit(id) uri = provide_uri(:resubmit_dispute, id) response = HttpClient.put(uri, MangoModel::Dispute.new) parse response end |
.submit(dispute) ⇒ Dispute
Contests a dispute entity.
41 42 43 44 45 |
# File 'lib/mangopay/api/service/disputes.rb', line 41 def submit(dispute) uri = provide_uri(:submit_dispute, dispute.id) response = HttpClient.put(uri, dispute) parse response end |
.update(dispute) ⇒ Dispute
Updates the dispute entity identifiable by the provided dispute object’s ID.
Dispute
optional properties:
-
tag
and updated data
20 21 22 23 24 |
# File 'lib/mangopay/api/service/disputes.rb', line 20 def update(dispute) uri = provide_uri(:update_dispute, dispute.id) response = HttpClient.put(uri, dispute) parse response end |