Track events of identity verification using a credit card
What does this MR do and why?
This MR resolves: https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/125
It adds frontend Snowplow event tracking for Identity Verification using a credit card.
Tracked events
Event | category |
action |
property |
---|---|---|---|
Successful verification | 'IdentityVerification::CreditCard |
'success' |
|
Failed verification | 'IdentityVerification::CreditCard |
'failed_attempt' |
'<error message>' |
Notes:
- Reasons for failed verification can be either client-side or server-side validation errors
- depends on the type of error (e.g.
'Invalid Card Type'
,'[BusinessValidationError] Expiration date must be a future date.'
)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Setup
- Configure your GDK to run Snowplow Micro
- Enable
arkose_labs_signup_challenge
feature. This feature is responsible for interfacing with Arkose Labs to assign arisk_band
for new users.$ rails console > Feature.enable(:arkose_labs_signup_challenge) > ApplicationSetting.first.update({ arkose_labs_public_api_key: '****', arkose_labs_private_api_key: '****', arkose_labs_namespace: 'client' })
- Enable feature flags for identity verification
$ rails console > Feature.enable(:identity_verification) > Feature.enable(:identity_verification_credit_card)
Validate
-
Sign up for a new account. After, you should be redirected to the Identity Verification page (
http://localhost:3000/users/identity_verification
) -
(Optional) If you don't see the credit card verification step, update the new user's risk band data to have
'High'
value then refresh the Identity Verification page$ rails console > u = User.last > risk_band = u.custom_attributes.by_key('arkose_risk_band').first > risk_band.update(value: 'High')
-
Enter the following card details to trigger a client-side error:
Error: card number is invalid
-
Navigate to
http://localhost:9091/micro/good
(the port number may be different depending on your setup) and validate that an event with the following properties was fired:category
action
property
'IdentityVerification::CreditCard
'failed_attempt'
'Invalid Card Type'
-
Enter the following card details to trigger a server-side error:
Error: the expiration date is in the past
-
Navigate to
http://localhost:9091/micro/good
and validate that an event with the following properties was fired:category
action
property
'IdentityVerification::CreditCard
'failed_attempt'
'[BusinessValidationError] Expiration date must be a future date.'
-
Enter the following card details to trigger successful verification:
-
Navigate to
http://localhost:9091/micro/good
and validate that an event with the following properties was fired:category
action
'IdentityVerification::CreditCard
'sucess'
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.