-
Notifications
You must be signed in to change notification settings - Fork 144
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
Fastlane analytics #3175
base: fastlane
Are you sure you want to change the base?
Fastlane analytics #3175
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ import getOrderStatus from '../../../core/Services/order-status'; | |
import './DropinComponent.scss'; | ||
import { sanitizeOrder } from '../../internal/UIElement/utils'; | ||
import { PaymentAmount } from '../../../types/global-types'; | ||
import { ANALYTICS_RENDERED_STR } from '../../../core/Analytics/constants'; | ||
import { ANALYTICS_EVENT, ANALYTICS_RENDERED_STR, InfoEventTypes } from '../../../core/Analytics/constants'; | ||
import AdyenCheckoutError from '../../../core/Errors/AdyenCheckoutError'; | ||
import Button from '../../internal/Button'; | ||
import type { DropinComponentProps, DropinComponentState, DropinStatus, DropinStatusProps, onOrderCancelData } from '../types'; | ||
|
@@ -126,6 +126,12 @@ export class DropinComponent extends Component<DropinComponentProps, DropinCompo | |
this.setState({ | ||
showDefaultPaymentMethodList: true | ||
}); | ||
|
||
this.props.modules?.analytics.sendAnalytics('dropin', { | ||
type: ANALYTICS_EVENT.info, | ||
infoType: InfoEventTypes.clicked, | ||
target: 'otherpaymentmethod_button' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to my comment above - can the backend handle this target value, "otherpaymentmethod_button" without errors? |
||
}); | ||
}; | ||
|
||
closeActivePaymentMethod() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ import { CardConfiguration } from '../../components/Card/types'; | |
import CardInputDefaultProps from '../../components/Card/components/CardInput/defaultProps'; | ||
import { DEFAULT_CARD_GROUP_TYPES } from '../../components/internal/SecuredFields/lib/constants'; | ||
import { notFalsy } from '../../utils/commonUtils'; | ||
import { isConfigurationValid as isFastlaneComponentConfigValid } from '../../components/Card/components/Fastlane/utils/validate-configuration'; | ||
|
||
const MAX_LENGTH = 128; | ||
export const getUTCTimestamp = () => Date.now(); | ||
|
@@ -98,6 +99,7 @@ export const getCardConfigData = (cardProps: CardConfiguration): CardConfigData | |
doBinLookup, | ||
enableStoreDetails, | ||
exposeExpiryDate, | ||
fastlaneConfiguration, | ||
forceCompat, | ||
hasHolderName, | ||
hideCVC, | ||
|
@@ -133,14 +135,15 @@ export const getCardConfigData = (cardProps: CardConfiguration): CardConfigData | |
|
||
const riskEnabled = cardProps.modules?.risk?.enabled; | ||
|
||
const isFastlaneConfigValid = isFastlaneComponentConfigValid(fastlaneConfiguration); | ||
|
||
const billingAddressModeValue = cardProps.onAddressLookup ? 'lookup' : billingAddressMode; | ||
|
||
let showKCPType: 'none' | 'auto' | 'atStart' = 'none'; | ||
if (configuration?.koreanAuthenticationRequired === true) { | ||
showKCPType = countryCode?.toLowerCase() === 'kr' ? 'atStart' : 'auto'; | ||
} | ||
|
||
// @ts-ignore commenting out props until endpoint is ready | ||
const configData: CardConfigData = { | ||
autoFocus, | ||
...(billingAddressAllowedCountries?.length > 0 && { | ||
|
@@ -192,7 +195,15 @@ export const getCardConfigData = (cardProps: CardConfiguration): CardConfigData | |
hasOnLoad: onLoad !== CardInputDefaultProps.onLoad, | ||
// Card level props | ||
hasOnBinLookup: !!onBinLookup, | ||
hasOnEnterKeyPressed: !!onEnterKeyPressed | ||
hasOnEnterKeyPressed: !!onEnterKeyPressed, | ||
/** | ||
* Fastlane | ||
*/ | ||
// CHECK: Do we always append the prop even if it is not used? e.g. merchants not using fastlane | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what is the best here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For other, universal, props we want to know what config the merchant has ended up with, be it something they've set deliberately or a default that we've set for them. |
||
...(isFastlaneConfigValid && { | ||
hasFastlaneConfigured: true, | ||
isFastlaneConsentDefaultOn: fastlaneConfiguration.defaultToggleState | ||
}) | ||
}; | ||
|
||
return configData; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any backend changes needed?
Have you tested that we don't get network errors sending in new properties like "isToggleOn", "isFastlaneSignupRendered"?