Skip to content

Commit 790307e

Browse files
authored
Merge pull request #318 from Adyen/sdk-automation/models
Code generation: update services and models
2 parents b9f27a5 + e266efc commit 790307e

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

lib/adyen/services/legalEntityManagement/legal_entities_api.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ def get_legal_entity(id, headers: {})
6262
@client.call_adyen_api(@service, action, {}, headers, @version)
6363
end
6464

65+
# Request periodic data review.
66+
def request_periodic_review(id, headers: {})
67+
endpoint = '/legalEntities/{id}/requestPeriodicReview'.gsub(/{.+?}/, '%s')
68+
endpoint = endpoint.gsub(%r{^/}, '')
69+
endpoint = format(endpoint, id)
70+
71+
action = { method: 'post', url: endpoint }
72+
@client.call_adyen_api(@service, action, {}, headers, @version)
73+
end
74+
6575
# Update a legal entity
6676
def update_legal_entity(request, id, headers: {})
6777
endpoint = '/legalEntities/{id}'.gsub(/{.+?}/, '%s')

spec/lem_spec.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,25 @@
114114
expect(error.msg).to eq('Legal entity not found ErrorCode: 100')
115115
end
116116
end
117+
118+
it 'makes a LegaleEntity /requestPeriodicReview call' do
119+
url = @shared_values[:client].service_url(@shared_values[:service], "legalEntities/LE123/requestPeriodicReview",
120+
@shared_values[:client].legal_entity_management.version)
121+
WebMock.stub_request(:post, url)
122+
.with(
123+
headers: {
124+
'x-api-key' => @shared_values[:client].api_key
125+
}
126+
)
127+
.to_return(
128+
body: '{}'
129+
)
130+
131+
result = @shared_values[:client].legal_entity_management.legal_entities_api.request_periodic_review('LE123')
132+
result.response
133+
134+
expect(result.status)
135+
.to eq(200)
136+
end
137+
117138
end

0 commit comments

Comments
 (0)