Skip to content

Commit c22d33d

Browse files
committed
Update logic and correc test
1 parent 8f23adf commit c22d33d

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/adyen/client.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ def live_url_prefix=(value)
6464

6565
# base URL for API given service and @env
6666
def service_url_base(service)
67-
# maps 'Disputes' to expected service name 'DisputesService' for URL matching
68-
service = 'DisputesService' if service == 'Disputes'
6967
if @env == :mock
7068
@mock_service_url_base
7169
else
@@ -82,8 +80,11 @@ def service_url_base(service)
8280
when 'PosTerminalManagement'
8381
url = "https://postfmapi-#{@env}.adyen.com/postfmapi/terminal"
8482
supports_live_url_prefix = false
85-
when 'DataProtectionService', 'DisputesService'
86-
url = "https://ca-#{@env}.adyen.com/ca/services/#{service}"
83+
when 'Disputes'
84+
url = "https://ca-#{@env}.adyen.com/ca/services/DisputeService"
85+
supports_live_url_prefix = false
86+
when 'DataProtection'
87+
url = "https://ca-#{@env}.adyen.com/ca/services/DataProtectionService"
8788
supports_live_url_prefix = false
8889
when 'LegalEntityManagement'
8990
url = "https://kyc-#{@env}.adyen.com/lem"

spec/client_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
it 'correctly maps Disputes to DisputesService and generates valid URL' do
301301
client = Adyen::Client.new(env: :test)
302302
expect(client.service_url_base('Disputes'))
303-
.to eq('https://ca-test.adyen.com/ca/services/DisputesService')
303+
.to eq('https://ca-test.adyen.com/ca/services/DisputeService')
304304
end
305305

306306
it 'checks the creation of SessionAuthentication url for the test env' do

0 commit comments

Comments
 (0)