Skip to content

Commit 7020d92

Browse files
authored
Update DisputesService in Client (#296)
* added fix for disputeService * added comment
1 parent 7f0ecd0 commit 7020d92

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/adyen/client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def live_url_prefix=(value)
5353

5454
# base URL for API given service and @env
5555
def service_url_base(service)
56+
# maps 'Disputes' to expected service name 'DisputesService' for URL matching
57+
service = 'DisputesService' if service == 'Disputes'
5658
if @env == :mock
5759
@mock_service_url_base
5860
else

spec/client_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,4 +278,10 @@
278278
expect(client.service_url('PosMobile', 'sessions', nil))
279279
.to eq('https://checkout-test.adyen.com/checkout/possdk/sessions')
280280
end
281+
282+
it 'correctly maps Disputes to DisputesService and generates valid URL' do
283+
client = Adyen::Client.new(env: :test)
284+
expect(client.service_url_base('Disputes'))
285+
.to eq('https://ca-test.adyen.com/ca/services/DisputesService')
286+
end
281287
end

0 commit comments

Comments
 (0)