Skip to content
Open
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
codecov: codecov/codecov@5.0.3
codecov: codecov/codecov@6.0.0

executors:
default:
Expand Down
4 changes: 4 additions & 0 deletions lib/trolley/gateways/VerificationGateway.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def trigger(verification_type, body)
verification_list_builder(@client.post("/v1/verifications/#{verification_type}/trigger", body))
end

def trigger_identity_or_business_verification(body)
verification_list_builder(@client.post('/v1/verifications/trigger', body))
end

def trigger_watchlist(body)
verification_list_builder(@client.post('/v1/verifications/watchlist/trigger', body))
end
Expand Down
14 changes: 14 additions & 0 deletions test/unit/GatewayParityTest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,21 @@ def test_verification_gateway_calls_documented_trust_endpoints
stub_request(:post, "#{API_BASE}/v1/verifications/individual/trigger")
.with(body: '{"recipientIds":["R-123"]}')
.to_return(status: 200, body: verification_response)
stub_request(:post, "#{API_BASE}/v1/verifications/trigger")
.with(body: '{"recipientId":"R-123","types":["individual"],"retryAllowed":true}')
.to_return(status: 200, body: identity_or_business_verification_response)

assert_equal 'WV-123', @gateway.verification.search(verificationType: 'watchlist', page: 1, pageSize: 10).verifications.first.id
assert_equal 'WV-123', @gateway.verification.expire(type: 'individual', verificationIds: ['IV-123']).verifications.first.id
assert_equal 'WV-123', @gateway.verification.trigger_watchlist(recipientIds: ['R-123']).verifications.first.id
assert_equal 'WV-123', @gateway.trust.trigger('individual', recipientIds: ['R-123']).verifications.first.id
identity = @gateway.verification.trigger_identity_or_business_verification(
recipientId: 'R-123',
types: ['individual'],
retryAllowed: true
)
assert_equal 'R-123', identity.recipientId
assert_equal 'IV-123', identity.verifications.first.verificationId
end

def test_existing_deletes_support_single_and_multiple_ids
Expand Down Expand Up @@ -162,6 +172,10 @@ def verification_response
'{"ok":true,"verifications":[{"id":"WV-123","type":"watchlist"}],"meta":{"page":1,"pages":1,"records":1}}'
end

def identity_or_business_verification_response
'{"ok":true,"recipientId":"R-123","verifications":[{"type":"individual","status":"created","verificationId":"IV-123"}]}'
end

def recipient_logs_response
'{"ok":true,"recipientLogs":[{"via":"apikey","ipAddress":"23.93.176.55","userId":"user@example.com","type":"create","fields":[{"name":"referenceId","oldValue":null,"newValue":"external-reference-id"}],"createdAt":"2023-07-07T14:52:45.901Z"}],"meta":{"page":1,"pages":1,"records":1}}'
end
Expand Down