Skip to content

Commit

Permalink
Adds compiled submitted evidence endpoint. Update Hosted Payment Requ…
Browse files Browse the repository at this point in the history
…est (#135)

* Add disabled_payment_methods

* Add compiled submitted evidence endpoint to disputes
  • Loading branch information
armando-rodriguez-cko authored Mar 25, 2024
1 parent 6fa4926 commit 834fd9f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/checkout_sdk/disputes/disputes_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class DisputesClient < Client
FILES = 'files'
ACCEPT = 'accept'
EVIDENCE = 'evidence'
SUBMITTED = 'submitted'
SCHEME_FILES = 'schemefiles'
private_constant :DISPUTES, :FILES, :ACCEPT, :EVIDENCE, :SCHEME_FILES

Expand Down Expand Up @@ -47,6 +48,11 @@ def submit_evidence(dispute_id)
api_client.invoke_post(build_path(DISPUTES, dispute_id, EVIDENCE), sdk_authorization)
end

# @param [String] dispute_id
def get_compiled_submitted_evidence(dispute_id)
api_client.invoke_get(build_path(DISPUTES, dispute_id, EVIDENCE, SUBMITTED), sdk_authorization)
end

# @param [String] dispute_id
def get_dispute_scheme_files(dispute_id)
api_client.invoke_get(build_path(DISPUTES, dispute_id, SCHEME_FILES), sdk_authorization)
Expand Down
3 changes: 3 additions & 0 deletions lib/checkout_sdk/payments/hosted/hosted_payments_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ module Payments
# @return [ProcessingSettings]
# @!attribute allow_payment_methods
# @return [Array(CheckoutSdk::Common::PaymentSourceType)]
# @!attribute disabled_payment_methods
# @return [Array(CheckoutSdk::Common::PaymentSourceType)]
# @!attribute products
# @return [Array(CheckoutSdk::Common::Product)]
# @!attribute risk
Expand Down Expand Up @@ -66,6 +68,7 @@ class HostedPaymentsSession
:recipient,
:processing,
:allow_payment_methods,
:disabled_payment_methods,
:products,
:risk,
:success_url,
Expand Down
7 changes: 7 additions & 0 deletions spec/checkout_sdk/disputes/disputes_integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@
expect(response.http_metadata.status_code).to eq 204
end

it 'should compiled submitted evidence successfully' do
response = default_sdk.disputes.get_compiled_submitted_evidence(@dispute.id, request)

expect(response).not_to be nil
expect(response).file_id.not_to be nil
end

it 'should have new values for updated fields' do
response = default_sdk.disputes.get_evidence(@dispute.id)

Expand Down

0 comments on commit 834fd9f

Please sign in to comment.