Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions lib/checkout_sdk/api_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,18 @@ def build_multipart_request(file_request, file)
def upload(path, authorization, file_request)
headers = default_headers(authorization)

file = File.open(file_request.file)
File.open(file_request.file) do |file|
form = build_multipart_request(file_request, file)

form = build_multipart_request(file_request, file)
begin
@log.info "post: /#{path}"
response = @multipart_client.run_request(:post, path, form, headers)
rescue Faraday::ClientError => e
raise CheckoutApiException, e.response
end

begin
@log.info "post: /#{path}"
response = @multipart_client.run_request(:post, path, form, headers)
rescue Faraday::ClientError => e
raise CheckoutApiException, e.response
ensure
file.close
parse_response(response)
end

parse_response(response)
end

def parse_response(response)
Expand Down
1 change: 1 addition & 0 deletions lib/checkout_sdk/disputes/dispute_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module DisputeStatus
ARBITRATION_LOST = 'arbitration_lost'
EVIDENCE_REQUIRED = 'evidence_required'
EVIDENCE_UNDER_REVIEW = 'evidence_under_review'
ARB_EVIDENCE_SUBMITTED = 'arb_evidence_submitted'
ARBITRATION_UNDER_REVIEW = 'arbitration_under_review'
end
end
Expand Down
60 changes: 49 additions & 11 deletions lib/checkout_sdk/disputes/disputes_query_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,63 @@
module CheckoutSdk
module Disputes
# @!attribute limit
# @return [Integer]
# The number of results to return.
# [Optional]
# min 1, max 250, default 50
# @return [Integer, nil]
# @!attribute skip
# @return [Integer]
# The number of results to skip.
# [Optional]
# min 0, default 0
# @return [Integer, nil]
# @!attribute id
# @return [String]
# The unique identifier of the dispute.
# [Optional]
# @return [String, nil]
# @!attribute statuses
# @return [String] {DisputeStatus}
# One or more comma-separated statuses to filter by. Works like a logical OR.
# [Optional]
# Example: "evidence_required,evidence_under_review"
# @return [String, nil]
# @!attribute payment_id
# @return [String]
# The unique identifier of the payment.
# [Optional]
# @return [String, nil]
# @!attribute payment_reference
# @return [String]
# An optional reference (such as an order ID) that identifies the payment.
# [Optional]
# @return [String, nil]
# @!attribute payment_arn
# @return [String]
# The acquirer reference number (ARN).
# [Optional]
# @return [String, nil]
# @!attribute this_channel_only
# @return [TrueClass, FalseClass]
# If true, only returns disputes for the channel associated with the secret key.
# [Optional]
# @return [TrueClass, FalseClass, nil]
# @!attribute entity_ids
# @return [String] - Not available on Previous.
# One or more comma-separated client entity IDs. Works like a logical OR.
# [Optional]
# Example: "ent_wxglze3wwywujg4nna5fb7ldli,ent_vkb5zcy64zoe3cwfmaqvqyqyku"
# @return [String, nil]
# @!attribute sub_entity_ids
# @return [String] - Not available on Previous.
# One or more comma-separated sub-entity IDs. Works like a logical OR.
# [Optional]
# Example: "ent_uzm3uxtssvmuxnyrfdffcyjxeu,ent_hy5wtzwzeuwefmsnjtdhw4scfi"
# @return [String, nil]
# @!attribute processing_channel_ids
# One or more comma-separated processing channel IDs. Works like a logical OR.
# [Optional]
# Example: "pc_uzm3uxtssvmuxnyrfdffcyjxeu,pc_hy5wtzwzeuwefmsnjtdhw4scfi"
# @return [String, nil]
# @!attribute segment_ids
# One or more comma-separated segment IDs. Works like a logical OR.
# [Optional]
# @return [String, nil]
# @!attribute payment_mcc
# @return [String] - Not available on Previous.
# The merchant category code (MCC) of the payment (ISO 18245).
# [Optional]
# @return [String, nil]
class DisputesQueryFilter < CheckoutSdk::Common::DateRangeQueryFilter
attr_accessor :limit,
:skip,
Expand All @@ -35,6 +71,8 @@ class DisputesQueryFilter < CheckoutSdk::Common::DateRangeQueryFilter
:this_channel_only,
:entity_ids,
:sub_entity_ids,
:processing_channel_ids,
:segment_ids,
:payment_mcc
end
end
Expand Down
Loading