Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/using checkoutanalytics #2234

Merged
merged 116 commits into from
Mar 11, 2024
Merged

Conversation

sponglord
Copy link
Contributor

@sponglord sponglord commented Jun 22, 2023

Summary

Updating Analytics functionality to work against the new /checkoutanalytics endpoint
This involves:

  • a new procedure to retrieve checkoutAttemptId and send in initial analytics details (channel, flavor, locale etc)
  • a new events queue for the "error", "logs" & "info" that the new endpoint expects
  • generating "log" events for when:
    • onSubmit is called (indicating a "Pay" button press)
    • createFromAction is called (indicating a /payments response mandating an "action")
  • generating "info" events for when a component is rendered, the Dropin PM list is rendered, a PM is selected in the Dropin
  • groundwork for the checkoutanalytics events that the 3DS2 process will generate

Tested scenarios

New unit tests added

Relates to issue: COAPI-6

@github-actions
Copy link
Contributor

github-actions bot commented Jun 22, 2023

Size Change: +12.3 kB (+1%)

Total Size: 1.14 MB

Filename Size Change
packages/lib/dist/adyen.js 302 kB +3.3 kB (+1%)
packages/lib/dist/cjs/index.js 262 kB +3.11 kB (+1%)
packages/lib/dist/es.modern/index.js 125 kB +2.77 kB (+2%)
packages/lib/dist/es/index.js 146 kB +3.12 kB (+2%)
ℹ️ View Unchanged
Filename Size
packages/lib/dist/es.modern/ar.js 6.95 kB
packages/lib/dist/es.modern/cs-CZ.js 6.19 kB
packages/lib/dist/es.modern/da-DK.js 5.62 kB
packages/lib/dist/es.modern/de-DE.js 6.09 kB
packages/lib/dist/es.modern/el-GR.js 7.91 kB
packages/lib/dist/es.modern/es-ES.js 5.73 kB
packages/lib/dist/es.modern/fi-FI.js 5.73 kB
packages/lib/dist/es.modern/fr-FR.js 5.96 kB
packages/lib/dist/es.modern/hr-HR.js 5.99 kB
packages/lib/dist/es.modern/hu-HU.js 6.27 kB
packages/lib/dist/es.modern/it-IT.js 5.81 kB
packages/lib/dist/es.modern/ja-JP.js 6.69 kB
packages/lib/dist/es.modern/ko-KR.js 6.32 kB
packages/lib/dist/es.modern/nl-NL.js 5.76 kB
packages/lib/dist/es.modern/no-NO.js 5.58 kB
packages/lib/dist/es.modern/pl-PL.js 6.27 kB
packages/lib/dist/es.modern/pt-BR.js 5.78 kB
packages/lib/dist/es.modern/pt-PT.js 5.91 kB
packages/lib/dist/es.modern/ro-RO.js 6.05 kB
packages/lib/dist/es.modern/ru-RU.js 7.39 kB
packages/lib/dist/es.modern/sk-SK.js 6.36 kB
packages/lib/dist/es.modern/sl-SI.js 5.91 kB
packages/lib/dist/es.modern/sv-SE.js 5.59 kB
packages/lib/dist/es.modern/zh-CN.js 6.13 kB
packages/lib/dist/es.modern/zh-TW.js 6.22 kB
packages/lib/dist/es/ar.js 6.95 kB
packages/lib/dist/es/cs-CZ.js 6.19 kB
packages/lib/dist/es/da-DK.js 5.62 kB
packages/lib/dist/es/de-DE.js 6.09 kB
packages/lib/dist/es/el-GR.js 7.91 kB
packages/lib/dist/es/es-ES.js 5.73 kB
packages/lib/dist/es/fi-FI.js 5.73 kB
packages/lib/dist/es/fr-FR.js 5.96 kB
packages/lib/dist/es/hr-HR.js 5.99 kB
packages/lib/dist/es/hu-HU.js 6.27 kB
packages/lib/dist/es/it-IT.js 5.81 kB
packages/lib/dist/es/ja-JP.js 6.69 kB
packages/lib/dist/es/ko-KR.js 6.32 kB
packages/lib/dist/es/nl-NL.js 5.76 kB
packages/lib/dist/es/no-NO.js 5.58 kB
packages/lib/dist/es/pl-PL.js 6.27 kB
packages/lib/dist/es/pt-BR.js 5.78 kB
packages/lib/dist/es/pt-PT.js 5.91 kB
packages/lib/dist/es/ro-RO.js 6.05 kB
packages/lib/dist/es/ru-RU.js 7.39 kB
packages/lib/dist/es/sk-SK.js 6.36 kB
packages/lib/dist/es/sl-SI.js 5.91 kB
packages/lib/dist/es/sv-SE.js 5.59 kB
packages/lib/dist/es/zh-CN.js 6.13 kB
packages/lib/dist/es/zh-TW.js 6.22 kB

compressed-size-action

* Add 3DS2 analytics events for data sent & iframe loaded. Plus error event when paymentData missing in 3DS2

* Using UIElement.submitAnalytics for 3DS2

* Fixed clause (had been changed to test error)

* Move app specific analytics logic to a separate "processing" function. This separates concerns and makes testing easier

* core.ts uses sendAnalytics function

* Comments added regarding what properties are added to what analytics objects

* Redeclare BaseElement.this._node *before* we render (was causing an issue in CustomCard)

* Card has onConfigSuccess function to send analytics info event (type="configured") when SFS have all configured

* Adding analytics logs for when 3DS2 fingerprint or challenge complete

* Also pass isStoredPaymentMethod and brand with "configured" analytics events for storedCards

* Added unit tests for Card & GooglePay testing the shape of the analytics objects they generate

* Added unit tests for 3DS2 errors - testing the shape of the analytics objects they generate

* Fixing type

* Jumping through hoops for sonarcloud

* Jumping through hoops for sonarcloud

* Removing console.log

* Specifying type. Move card related, "is it a stored card" logic, out of UIElement

* Fixing linting

* Fixing linting, tightening up onSubmitAnalytics type

* After SDKs meeting: removing target prop from "submit" log events

* Added "focus" & "unfocus" info events to Custom Card comp
* Adding selected info event for issuerList buttons

* IssuerList handles analytics for both dropdown & issuerList buttons

* Detect and send analytics event when issuerList's dropdown is expanded

* Detect and send analytics event (debounced) when issuerList search functionality is used

* Moved debounce function to own util file

* Fixes for unit tests

* Made debounce for search a constant

* Adding new unit tests

* Removing child comp's submitAnalytics function (since all it does is call super). Removing unused param.
* Detect and send analytics event when qrCode's "Copy" btn is pressed

* Fixing unit test fail

* Removing child comp's submitAnalytics function (since all it does is call super)
# Conflicts:
#	packages/lib/src/core/core.ts
# Conflicts:
#	packages/lib/tsconfig.json
* Mapping validation error codes to those expected by the endpoint

* Fixing unit tests
* Extending branch feature_using_checkoutanalytics to add 3DS2 analytic-actions (for data sent & iframe loaded)

* commenting out console logs

* Extending branch feature_using_checkoutanalytics_with_3DS2_events to add base64 refactor code (more errors detected in decode process)

* Changing analytics terminology - generic term is events with specific types being: info, log, error

* Changing analytics terminology - generic term is events with specific types being: info, log, error

* Fixing unit tests

* Fixing unit tests

* Fixed unit test

* Adding util to determine if base64 decoding has lead to an error object. Tightened up types

* Changing message for actionHandled when challenge iframe loaded
Copy link

sonarqubecloud bot commented Mar 8, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@sponglord sponglord merged commit e440a5c into main Mar 11, 2024
8 of 10 checks passed
@sponglord sponglord deleted the feature/using_checkoutanalytics branch March 11, 2024 11:12
@github-actions github-actions bot mentioned this pull request Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants