Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/using checkoutanalytics (#2234)
* First use of checkoutanlytics endpoint (for logging onSubmit & createFromAction events) * Added comments and fixed type * Commenting out "target" property until API accepts it * Fixing unit tests * Fixing sonarcloud gripe * Tightening up types * Adding test for event queue * Updated test description * Enhancing test * Adding collect-id unit test * Adding TelemetryEvent type * Increasing test coverage * Adding test * Adding Storage.test * Further checks to ensure checkoutanalytics calls fail silently * Aligning fallback storage solution with normal, window based, Storage API * Some adjustments now actual endpoint is accepting requests * Analytics path read from constant and passed to relevant components * Removing unused components * Fixed unit test * Added comments on the shape of objects for the /checkoutanalytics endpoint * Unit test for when checkoutanalytics url is wrong * Remove constant for mismatching threeDSServerTransID (it is no longer a situation we catch) * Use await when calling collectId * Remove analyticsContext from CoreOptions * Adding createAnalyticsAction function in Analytics to make it simpler for other components to submit analytics * Renaming CAEventsQueue to EventsQueue * Clarifying the "modular" nature of Analytics and EventsQueue * Fixing return type * Pass in containerWidth with initial analytics call * Drop addAnalyticsAction from Analytics module. Tidy up Analytics' types * Switch to v3 of the endpoint * Fix unit test (set new analytics version) * Changes reflecting discussion on final API tweaks * Create analytics-action for when PM selected or mounted. Send in sessionId in initial call * Commented out logs and removed unused code * Moved initial analytics setup to UIElement now that it (potentially) needs to pass on the session.id * Added type * Fixed unit test * Temporarily don't pass isStoredPaymentMethod (waiting for API fix) * Adding isStoredPaymentMethod to analytics event action now the b/e supports it * Adding getter for Analytics' enabled prop so 'do-not-track' can be added as checkoutAttemptId value, if required * fixing e2e tests * remove .only from e2e test * Only load analytics pixel once * comments added * Aligning Dropin & comps so that a 'mounted' event is always sent, from the same place, for both implementations * Renamed initial Analytics call from "send" to "setUp" * Create timer to send events after a set period of time * Setup analytics after render has been called. Make call to submit the "mounted" event from BaseElement c.f. UIElement * DropinComponent sends 'rendered' analytics-action * For clarity UIElement uses switch in submitAnalytics function * Added comment about Dropin also being able to pass a list of paymentMethods to analytics * Use single "rendered" event to describe component mounting, dropin pm list rendering & dropin pm selection * Changing analytics terminology - generic term is events with specific types being: info, log, error * Changing analytics terminology - info events are collected into an an array named "info" (as opposed to the "logs" & "errors" arrays) * Fixing unit tests * Also debounce errors * Fixed unit test * Extends feature/using_checkoutanalytics. First draft: adding focus/blur events for Credit card fields * Second draft: adding error analytics events for Credit card fields * Second draft: adding error analytics events for Credit card fields * Second draft: adding error analytics events for Credit card fields * Using UIElement.submitAnalytics as a gateway for all analytics events (to set event type and create final analytics worthy objects) * Added comment about onFocus/onBlur callbacks now working for non-SFs * Changed constant ANALYTICS_UNFOCUS_STR to have value "unfocus" * Non dropdown fields for Address also have focus/blur analytics * Reduce the analytics info event timer to 5 secs when in development mode * Aligning some analytics values with what the endpoint expects * Fixing typo * Clauses added so unit tests pass * Adding analytics for when an instant PM button is pressed * Fixed TS error * Removing unused code * Keep object sent to onFocus & onBlur callbacks in the form expected by v5 users * Moving logic to create different types of Analytics events into the Analytics module * Improving types * Redeclare BaseElement.this._node *before* we render (was causing an issue in CustomCard) * Checkoutanalytics mvp with 3DS2 events (#2531) * 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 * Feature/using checkoutanalytics mvp iDeal (#2549) * 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. * Feature/using checkoutanalytics mvp qr codes (#2550) * 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) * Add platform prop to all subsequent analytics calls * All events have a unique id * Fixing type * Fixing unit tests * Fixing issue where analytics calls were still being sent despite checkoutAttemptId call failing * Added some tsconfig & linting exclusions * Failed attempt to retrieve checkoutAttemptId returns rejected promise * Refactoring Analytics.test to run in a way that more accurately mimics how analytics events are created * Feature/using checkoutanalytics mapping validation errors (#2583) * Mapping validation error codes to those expected by the endpoint * Fixing unit tests * Changing logic that dictates when we jump focus from PAN to expiryDate * Feature/using checkoutanalytics_with_base64 refactor (#2586) * 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 * Updating card rules for Discover and Diners, just for transparency on what the rules are within securedFields * Fixing e2e tests
- Loading branch information