Skip to content

Commit

Permalink
Removing unused type
Browse files Browse the repository at this point in the history
  • Loading branch information
sponglord committed Mar 11, 2024
1 parent c40b00e commit 7ec0316
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { httpPost } from '../../core/Services/http';
import { pick } from '../internal/SecuredFields/utils';
import { ThreeDS2AnalyticsObject, ThreeDS2FingerprintResponse } from './types';
import { ThreeDS2FingerprintResponse } from './types';
import AdyenCheckoutError from '../../core/Errors/AdyenCheckoutError';
import { THREEDS2_FINGERPRINT_SUBMIT } from './config';
import { THREEDS2_ERROR, THREEDS2_FINGERPRINT_SUBMIT } from './config';
import {
ANALYTICS_EVENT_ERROR,
ANALYTICS_API_ERROR,
ANALYTICS_ERROR_CODE_NO_DETAILS_FOR_FRICTIONLESS,
ANALYTICS_ERROR_CODE_NO_ACTION_FOR_CHALLENGE,
ANALYTICS_SDK_ERROR,
ANALYTICS_ERROR_CODE_NO_COMPONENT_FOR_ACTION
} from '../../core/Analytics/constants';
import { SendAnalyticsObject } from '../../core/Analytics/types';

/**
* ThreeDS2DeviceFingerprint, onComplete, calls a new, internal, endpoint which
Expand All @@ -28,7 +28,7 @@ export default function callSubmit3DS2Fingerprint({ data }): void {
}
)
.then(resData => {
let analyticsErrorObject: ThreeDS2AnalyticsObject;
let analyticsErrorObject: SendAnalyticsObject;

/**
* Frictionless (no challenge) flow OR "refused" flow
Expand All @@ -43,7 +43,7 @@ export default function callSubmit3DS2Fingerprint({ data }): void {
);

analyticsErrorObject = {
event: ANALYTICS_EVENT_ERROR,
type: THREEDS2_ERROR,
code: ANALYTICS_ERROR_CODE_NO_DETAILS_FOR_FRICTIONLESS,
errorType: ANALYTICS_API_ERROR,
message: `${THREEDS2_FINGERPRINT_SUBMIT}: no details object in a response indicating a "frictionless" flow`
Expand All @@ -66,7 +66,7 @@ export default function callSubmit3DS2Fingerprint({ data }): void {
);

analyticsErrorObject = {
event: ANALYTICS_EVENT_ERROR,
type: THREEDS2_ERROR,
code: ANALYTICS_ERROR_CODE_NO_ACTION_FOR_CHALLENGE,
errorType: ANALYTICS_API_ERROR,
message: `${THREEDS2_FINGERPRINT_SUBMIT}: no action object in a response indicating a "challenge" flow`
Expand All @@ -86,7 +86,7 @@ export default function callSubmit3DS2Fingerprint({ data }): void {
console.debug('Handled Error::callSubmit3DS2Fingerprint::FAILED:: no actionHandler');

analyticsErrorObject = {
event: ANALYTICS_EVENT_ERROR,
type: THREEDS2_ERROR,
code: ANALYTICS_ERROR_CODE_NO_COMPONENT_FOR_ACTION,
errorType: ANALYTICS_SDK_ERROR,
message: `${THREEDS2_FINGERPRINT_SUBMIT}: no component defined to handle the action response`
Expand Down
6 changes: 0 additions & 6 deletions packages/lib/src/components/ThreeDS2/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { ANALYTICS_EVENT, AnalyticsObject } from '../../core/Analytics/types';

/**
* See
* https://docs.adyen.com/checkout/3d-secure/api-reference#threeds2result
Expand Down Expand Up @@ -81,7 +79,3 @@ type CheckoutThreeDS2Action = {
subtype: string;
authorisationToken: string;
};

export type ThreeDS2AnalyticsObject = Pick<AnalyticsObject, 'code' | 'errorType' | 'message' | 'type' | 'metadata'> & {
event: ANALYTICS_EVENT;
};

0 comments on commit 7ec0316

Please sign in to comment.