Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds compiled submitted evidence endpoint. Update Hosted Payment Request #135

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
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
Loading