@odus/checkout 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/getCheckoutDetails.query.d.ts.map +1 -1
- package/dist/checkout.es.js +190 -166
- package/dist/components/checkout/form/Form.d.ts +11 -1
- package/dist/components/checkout/form/Form.d.ts.map +1 -1
- package/dist/components/checkout/form/FormComponentManager.d.ts +4 -0
- package/dist/components/checkout/form/FormComponentManager.d.ts.map +1 -1
- package/dist/components/checkout/form/PaymentMethods.d.ts +2 -0
- package/dist/components/checkout/form/PaymentMethods.d.ts.map +1 -1
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts +4 -0
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts.map +1 -1
- package/dist/core/api/CheckoutAPI.service.d.ts.map +1 -1
- package/dist/core/vgs/VGSCollectService.d.ts +6 -0
- package/dist/core/vgs/VGSCollectService.d.ts.map +1 -1
- package/dist/core/vgs/vgsCsp.d.ts +17 -0
- package/dist/core/vgs/vgsCsp.d.ts.map +1 -0
- package/dist/elements/ApplePayElement.d.ts +3 -0
- package/dist/elements/ApplePayElement.d.ts.map +1 -1
- package/dist/elements/BaseElement.d.ts +7 -0
- package/dist/elements/BaseElement.d.ts.map +1 -1
- package/dist/elements/OdusElements.d.ts +2 -1
- package/dist/elements/OdusElements.d.ts.map +1 -1
- package/dist/elements/card/VgsCardAdapter.d.ts.map +1 -1
- package/dist/elements.es.js +243 -219
- package/dist/phone.js +2 -0
- package/dist/services/checkout/Checkout.service.d.ts +1 -1
- package/dist/services/checkout/Checkout.service.d.ts.map +1 -1
- package/dist/services/checkout/CheckoutForm.service.d.ts +2 -1
- package/dist/services/checkout/CheckoutForm.service.d.ts.map +1 -1
- package/dist/services/telemetry/CheckoutReadiness.service.d.ts +88 -0
- package/dist/services/telemetry/CheckoutReadiness.service.d.ts.map +1 -0
- package/dist/services/telemetry/Telemetry.service.d.ts +6 -0
- package/dist/services/telemetry/Telemetry.service.d.ts.map +1 -1
- package/dist/shared.js +1312 -1049
- package/dist/types/api/ApiError.type.d.ts +3 -0
- package/dist/types/api/ApiError.type.d.ts.map +1 -1
- package/dist/types/telemetry/TelemetryEvents.type.d.ts +156 -3
- package/dist/types/telemetry/TelemetryEvents.type.d.ts.map +1 -1
- package/dist/utils/helpers/failureCause.util.d.ts +24 -0
- package/dist/utils/helpers/failureCause.util.d.ts.map +1 -0
- package/dist/utils/helpers/stageFailure.util.d.ts +35 -0
- package/dist/utils/helpers/stageFailure.util.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/services/telemetry/LoadTimer.service.d.ts +0 -28
- package/dist/services/telemetry/LoadTimer.service.d.ts.map +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { FailureClass } from '../telemetry/TelemetryEvents.type';
|
|
1
2
|
export type ApiError = {
|
|
2
3
|
message: string;
|
|
3
4
|
status: number;
|
|
4
5
|
statusText: string;
|
|
5
6
|
details?: any;
|
|
7
|
+
/** Set where the HTTP status alone cannot say why the call failed. */
|
|
8
|
+
failureClass?: FailureClass;
|
|
6
9
|
};
|
|
7
10
|
//# sourceMappingURL=ApiError.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiError.type.d.ts","sourceRoot":"","sources":["../../../src/types/api/ApiError.type.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"ApiError.type.d.ts","sourceRoot":"","sources":["../../../src/types/api/ApiError.type.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,sEAAsE;IACtE,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC"}
|
|
@@ -18,6 +18,8 @@ export declare const CheckoutEvents: {
|
|
|
18
18
|
readonly VGS_TOKENIZATION_FAILED: "vgs.tokenization.failed";
|
|
19
19
|
readonly CARD_CAPTURE_UNAVAILABLE: "card.capture.unavailable";
|
|
20
20
|
readonly APPLE_PAY_START_FAILED: "apple_pay.start.failed";
|
|
21
|
+
readonly CHECKOUT_STAGE_STARTED: "checkout.stage.started";
|
|
22
|
+
readonly CHECKOUT_STAGE_OUTCOME: "checkout.stage.outcome";
|
|
21
23
|
};
|
|
22
24
|
export type CheckoutEventName = (typeof CheckoutEvents)[keyof typeof CheckoutEvents];
|
|
23
25
|
export declare const CheckoutMeasurements: {
|
|
@@ -47,6 +49,53 @@ export type PaymentSubmitAttributes = {
|
|
|
47
49
|
payment_id: string;
|
|
48
50
|
payment_method?: string;
|
|
49
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Why a payment call failed. Sent as `failure_class` on
|
|
54
|
+
* `payment.association.failed` and `payment.submit.failed`, so a failure we
|
|
55
|
+
* caused can be told apart from a merchant error or a decline.
|
|
56
|
+
*/
|
|
57
|
+
export declare const FailureClasses: {
|
|
58
|
+
/** No HTTP response arrived. */
|
|
59
|
+
readonly NETWORK: "network";
|
|
60
|
+
/** The API answered 4xx: a merchant error, an invalid key or a decline. */
|
|
61
|
+
readonly CLIENT_ERROR: "client_error";
|
|
62
|
+
/** The API answered with a status that is not 2xx or 4xx, usually 5xx. */
|
|
63
|
+
readonly SERVER_ERROR: "server_error";
|
|
64
|
+
/** The API answered 2xx with a body the SDK cannot use. */
|
|
65
|
+
readonly INVALID_RESPONSE: "invalid_response";
|
|
66
|
+
/** The SDK did not send the request, because a precondition was missing. */
|
|
67
|
+
readonly NOT_SENT: "not_sent";
|
|
68
|
+
/** The SDK code itself threw. */
|
|
69
|
+
readonly SDK_ERROR: "sdk_error";
|
|
70
|
+
/** A callback the merchant gave the SDK threw. */
|
|
71
|
+
readonly MERCHANT_CALLBACK: "merchant_callback";
|
|
72
|
+
};
|
|
73
|
+
export type FailureClass = (typeof FailureClasses)[keyof typeof FailureClasses];
|
|
74
|
+
/** The value of `http_status` when the failure has no HTTP status. */
|
|
75
|
+
export declare const NO_HTTP_STATUS = "none";
|
|
76
|
+
export type FailureCauseAttributes = {
|
|
77
|
+
failure_class: FailureClass;
|
|
78
|
+
/** The HTTP status code, or `none` when the SDK has no status for the failure. */
|
|
79
|
+
http_status: string;
|
|
80
|
+
};
|
|
81
|
+
export type PaymentSubmitFailedAttributes = PaymentSubmitAttributes & FailureCauseAttributes & {
|
|
82
|
+
error_message: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Where an association stopped. `checkout_details` is the request for the
|
|
86
|
+
* checkout details and the check of its answer. `form_setup` is the drop-in
|
|
87
|
+
* form setup that follows it, which is SDK code only.
|
|
88
|
+
*/
|
|
89
|
+
export declare const PaymentAssociationFailedStages: {
|
|
90
|
+
readonly CHECKOUT_DETAILS: "checkout_details";
|
|
91
|
+
readonly FORM_SETUP: "form_setup";
|
|
92
|
+
};
|
|
93
|
+
export type PaymentAssociationFailedStage = (typeof PaymentAssociationFailedStages)[keyof typeof PaymentAssociationFailedStages];
|
|
94
|
+
export type PaymentAssociationFailedAttributes = FailureCauseAttributes & {
|
|
95
|
+
payment_id: string;
|
|
96
|
+
stage: PaymentAssociationFailedStage;
|
|
97
|
+
error_message: string;
|
|
98
|
+
};
|
|
50
99
|
export type PaymentResultAttributes = {
|
|
51
100
|
payment_id: string;
|
|
52
101
|
status: string;
|
|
@@ -62,10 +111,37 @@ export type VGSIframeLoadedAttributes = {
|
|
|
62
111
|
export type VGSTokenizationAttributes = {
|
|
63
112
|
duration_ms?: string;
|
|
64
113
|
error_message?: string;
|
|
65
|
-
error_code?:
|
|
114
|
+
error_code?: TokenizationFailureCause;
|
|
115
|
+
/** The status VGS answered with, when the failure has one. */
|
|
116
|
+
http_status?: string;
|
|
66
117
|
vgs_trace_id?: string;
|
|
67
118
|
vgs_fingerprint?: string;
|
|
68
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* Why a card did not tokenize. Sent as `error_code` on
|
|
122
|
+
* `vgs.tokenization.failed`. Only `invalid_input` is the shopper's: VGS
|
|
123
|
+
* refused what the shopper typed. Every other cause is a failure of the
|
|
124
|
+
* integration.
|
|
125
|
+
*/
|
|
126
|
+
export declare const TokenizationFailureCauses: {
|
|
127
|
+
/** VGS validated the fields and refused the shopper's input. */
|
|
128
|
+
readonly INVALID_INPUT: "invalid_input";
|
|
129
|
+
/** VGS reported a failure that does not name an invalid field. */
|
|
130
|
+
readonly REQUEST_FAILED: "request_failed";
|
|
131
|
+
/** The card API answered with errors. */
|
|
132
|
+
readonly REJECTED: "rejected";
|
|
133
|
+
/** The card API answered without a card id. */
|
|
134
|
+
readonly NO_CARD_ID: "no_card_id";
|
|
135
|
+
/** The card was created, and the update that adds its expiry failed. */
|
|
136
|
+
readonly CARD_UPDATE_FAILED: "card_update_failed";
|
|
137
|
+
/** The VGS form or its session was not there to tokenize with. */
|
|
138
|
+
readonly NOT_INITIALIZED: "not_initialized";
|
|
139
|
+
/** The card block failed closed, so there was nothing to tokenize. */
|
|
140
|
+
readonly CAPTURE_UNAVAILABLE: "capture_unavailable";
|
|
141
|
+
/** SDK code threw, and VGS was not asked. */
|
|
142
|
+
readonly SDK_ERROR: "sdk_error";
|
|
143
|
+
};
|
|
144
|
+
export type TokenizationFailureCause = (typeof TokenizationFailureCauses)[keyof typeof TokenizationFailureCauses];
|
|
69
145
|
/**
|
|
70
146
|
* The card block failed closed. `reason` says which precondition was missing,
|
|
71
147
|
* so a whole environment without card tokenization is visible as a spike here
|
|
@@ -98,11 +174,19 @@ export declare const ApplePayStartFailedStages: {
|
|
|
98
174
|
export type ApplePayStartFailedStage = (typeof ApplePayStartFailedStages)[keyof typeof ApplePayStartFailedStages];
|
|
99
175
|
/**
|
|
100
176
|
* Why a checkout load ended without the checkout becoming ready. Sent as the
|
|
101
|
-
* `reason` of `checkout.
|
|
102
|
-
* `
|
|
177
|
+
* `reason` of `checkout.stage.outcome` for the readiness stage, and of
|
|
178
|
+
* `checkout.load_time` and `form.render_time`.
|
|
103
179
|
*/
|
|
104
180
|
export declare const CheckoutLoadFailureReasons: {
|
|
105
181
|
readonly ASSOCIATION_FAILED: "association_failed";
|
|
182
|
+
/** SDK code threw while it put the checkout on the page. */
|
|
183
|
+
readonly MOUNT_FAILED: "mount_failed";
|
|
184
|
+
/** The merchant mounted into a container that does not exist. */
|
|
185
|
+
readonly CONTAINER_NOT_FOUND: "container_not_found";
|
|
186
|
+
/** The drop-in form could not draw one of its parts. */
|
|
187
|
+
readonly FORM_RENDER_FAILED: "form_render_failed";
|
|
188
|
+
/** The merchant's Content Security Policy blocked VGS. */
|
|
189
|
+
readonly VGS_BLOCKED_BY_CSP: "vgs_blocked_by_csp";
|
|
106
190
|
readonly INIT_FAILED: "init_failed";
|
|
107
191
|
readonly FIELDS_NOT_READY: "fields_not_ready";
|
|
108
192
|
readonly NO_TOKENIZATION_SESSION: "no_tokenization_session";
|
|
@@ -113,5 +197,74 @@ export type CheckoutLoadOutcome = {
|
|
|
113
197
|
} | {
|
|
114
198
|
status: 'failed';
|
|
115
199
|
reason: CheckoutLoadFailureReason;
|
|
200
|
+
/** Detail sent beside the reason, such as which form part failed. */
|
|
201
|
+
attributes?: Record<string, string>;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* The two stages of a checkout session that the readiness objective counts.
|
|
205
|
+
* Each stage sends one `checkout.stage.outcome`, which carries its valid event
|
|
206
|
+
* and, when it failed, its bad event.
|
|
207
|
+
*/
|
|
208
|
+
export declare const CheckoutStages: {
|
|
209
|
+
readonly READINESS: "readiness";
|
|
210
|
+
readonly FIRST_SUBMIT: "first_submit";
|
|
211
|
+
};
|
|
212
|
+
export type CheckoutStage = (typeof CheckoutStages)[keyof typeof CheckoutStages];
|
|
213
|
+
export declare const ReadinessOutcomes: {
|
|
214
|
+
readonly READY: "ready";
|
|
215
|
+
/** A failure that is ours ended the stage. */
|
|
216
|
+
readonly FAILED: "failed";
|
|
217
|
+
/** The stage reached no outcome before the deadline. */
|
|
218
|
+
readonly DEADLINE: "deadline";
|
|
219
|
+
/** The page closed, or the merchant destroyed the checkout, first. */
|
|
220
|
+
readonly LEFT: "left";
|
|
221
|
+
};
|
|
222
|
+
export type ReadinessOutcome = (typeof ReadinessOutcomes)[keyof typeof ReadinessOutcomes];
|
|
223
|
+
export declare const SubmitOutcomes: {
|
|
224
|
+
readonly SUCCEEDED: "succeeded";
|
|
225
|
+
readonly FAILED: "failed";
|
|
116
226
|
};
|
|
227
|
+
export type SubmitOutcome = (typeof SubmitOutcomes)[keyof typeof SubmitOutcomes];
|
|
228
|
+
/**
|
|
229
|
+
* Whose failure ended the stage. The objective counts `ours` as bad, leaves
|
|
230
|
+
* `not_ours` out of both halves, and reads `none` as good — except a `left`
|
|
231
|
+
* stage, which is bad when `waited_ms` passes the grace time.
|
|
232
|
+
*/
|
|
233
|
+
export declare const StageFaults: {
|
|
234
|
+
readonly OURS: "ours";
|
|
235
|
+
readonly NOT_OURS: "not_ours";
|
|
236
|
+
readonly NONE: "none";
|
|
237
|
+
};
|
|
238
|
+
export type StageFault = (typeof StageFaults)[keyof typeof StageFaults];
|
|
239
|
+
/** The `reason` of a stage that has no failure to name. */
|
|
240
|
+
export declare const NO_STAGE_REASON = "none";
|
|
241
|
+
export declare const SubmitFailureReasons: {
|
|
242
|
+
readonly TOKENIZATION_FAILED: "tokenization_failed";
|
|
243
|
+
readonly APPLE_PAY_START_FAILED: "apple_pay_start_failed";
|
|
244
|
+
readonly AUTHORIZE_FAILED: "authorize_failed";
|
|
245
|
+
};
|
|
246
|
+
export type SubmitFailureReason = (typeof SubmitFailureReasons)[keyof typeof SubmitFailureReasons];
|
|
247
|
+
export type StageFailure<Reason extends string> = {
|
|
248
|
+
reason: Reason;
|
|
249
|
+
/** Detail sent beside the reason: a status, a cause, a stage. */
|
|
250
|
+
attributes?: Record<string, string>;
|
|
251
|
+
};
|
|
252
|
+
export type SubmitStageResult = {
|
|
253
|
+
outcome: typeof SubmitOutcomes.SUCCEEDED;
|
|
254
|
+
paymentMethod: string;
|
|
255
|
+
} | (StageFailure<SubmitFailureReason> & {
|
|
256
|
+
outcome: typeof SubmitOutcomes.FAILED;
|
|
257
|
+
fault: Exclude<StageFault, 'none'>;
|
|
258
|
+
paymentMethod: string;
|
|
259
|
+
});
|
|
260
|
+
export type CheckoutStageOutcomeAttributes = {
|
|
261
|
+
stage: CheckoutStage;
|
|
262
|
+
outcome: ReadinessOutcome | SubmitOutcome;
|
|
263
|
+
reason: string;
|
|
264
|
+
fault: StageFault;
|
|
265
|
+
/** Milliseconds the shopper waited. Sent for the readiness stage only. */
|
|
266
|
+
waited_ms?: string;
|
|
267
|
+
payment_id?: string;
|
|
268
|
+
payment_method?: string;
|
|
269
|
+
} & Record<string, string>;
|
|
117
270
|
//# sourceMappingURL=TelemetryEvents.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TelemetryEvents.type.d.ts","sourceRoot":"","sources":["../../../src/types/telemetry/TelemetryEvents.type.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"TelemetryEvents.type.d.ts","sourceRoot":"","sources":["../../../src/types/telemetry/TelemetryEvents.type.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;CAuCjB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAMvD,eAAO,MAAM,oBAAoB;;;;;;CAMvB,CAAC;AAEX,MAAM,MAAM,uBAAuB,G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M,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FailureCauseAttributes, FailureClass } from '../../types/telemetry/TelemetryEvents.type';
|
|
2
|
+
/**
|
|
3
|
+
* Records why the call failed. The error itself does not change, and the same
|
|
4
|
+
* error is returned. A non-object cannot carry a tag and is returned as it is.
|
|
5
|
+
*/
|
|
6
|
+
export declare const tagFailure: <T>(error: T, failureClass: FailureClass, status?: number) => T;
|
|
7
|
+
/**
|
|
8
|
+
* Records the HTTP status of a parsed response body, so a later check that
|
|
9
|
+
* rejects the body can still report the status.
|
|
10
|
+
*/
|
|
11
|
+
export declare const rememberResponseStatus: <T>(body: T, status: number) => T;
|
|
12
|
+
export declare const responseStatusOf: (body: unknown) => number | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Reads the telemetry attributes that say why a payment call failed. A tag
|
|
15
|
+
* comes first. An error with an HTTP status and no tag is classified by the
|
|
16
|
+
* status. An error with neither came from SDK code.
|
|
17
|
+
*/
|
|
18
|
+
export declare const describeFailure: (error: unknown) => FailureCauseAttributes;
|
|
19
|
+
/**
|
|
20
|
+
* Runs a merchant callback. If it throws, the error is tagged as the
|
|
21
|
+
* merchant's and thrown again, so the flow around it does not change.
|
|
22
|
+
*/
|
|
23
|
+
export declare const runMerchantCallback: (callback: () => void) => void;
|
|
24
|
+
//# sourceMappingURL=failureCause.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"failureCause.util.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/failureCause.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EAGlB,MAAM,4CAA4C,CAAC;AAkBpD;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,EAC1B,OAAO,CAAC,EACR,cAAc,YAAY,EAC1B,SAAS,MAAM,KACd,CAMF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,MAAM,KAAG,CAMnE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,MAAM,OAAO,KAAG,MAAM,GAAG,SACD,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,sBAyBhD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,IAAI,KAAG,IAM1D,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ApplePayStartFailedStage, CheckoutLoadFailureReason, PaymentAssociationFailedStage, StageFailure, SubmitStageResult, TokenizationFailureCause } from '../../types/telemetry/TelemetryEvents.type';
|
|
2
|
+
/**
|
|
3
|
+
* Records why a card did not tokenize. The error itself does not change, and
|
|
4
|
+
* the same error is returned, so a caller that reads the VGS errors still
|
|
5
|
+
* reads them.
|
|
6
|
+
*/
|
|
7
|
+
export declare const tagTokenizationFailure: <T>(error: T, cause: TokenizationFailureCause) => T;
|
|
8
|
+
export declare const tokenizationCauseOf: (error: unknown) => TokenizationFailureCause | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Describes a failed association for the readiness stage, and says whether
|
|
11
|
+
* the failure is ours.
|
|
12
|
+
*/
|
|
13
|
+
export declare const describeAssociationFailure: (error: unknown, stage: PaymentAssociationFailedStage) => StageFailure<CheckoutLoadFailureReason> & {
|
|
14
|
+
ours: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Describes a failed first submit. A tokenization failure is ours unless VGS
|
|
18
|
+
* refused the shopper's input. Any other failure is described by its HTTP
|
|
19
|
+
* cause.
|
|
20
|
+
*/
|
|
21
|
+
export declare const describeSubmitFailure: (error: unknown, paymentMethod: string) => Extract<SubmitStageResult, {
|
|
22
|
+
outcome: "failed";
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Describes a card that did not tokenize. A failure without a recorded cause
|
|
26
|
+
* came from SDK code. Only the shopper's invalid input is not ours.
|
|
27
|
+
*/
|
|
28
|
+
export declare const describeTokenizationFailure: (error: unknown, paymentMethod: string) => Extract<SubmitStageResult, {
|
|
29
|
+
outcome: "failed";
|
|
30
|
+
}>;
|
|
31
|
+
/** Apple Pay could not start, so the shopper could not use a method we drew. */
|
|
32
|
+
export declare const applePayStartFailure: (stage: ApplePayStartFailedStage) => Extract<SubmitStageResult, {
|
|
33
|
+
outcome: "failed";
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=stageFailure.util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stageFailure.util.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/stageFailure.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAK9B,KAAK,6BAA6B,EAClC,KAAK,YAAY,EAGjB,KAAK,iBAAiB,EAEtB,KAAK,wBAAwB,EAE9B,MAAM,4CAA4C,CAAC;AAQpD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,EACtC,OAAO,CAAC,EACR,OAAO,wBAAwB,KAC9B,CAMF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,OAAO,OAAO,KACb,wBAAwB,GAAG,SAC+B,CAAC;AAsB9D;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GACrC,OAAO,OAAO,EACd,OAAO,6BAA6B,KACnC,YAAY,CAAC,yBAAyB,CAAC,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAQ3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,OAAO,EACd,eAAe,MAAM,KACpB,OAAO,CAAC,iBAAiB,EAAE;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAgBlD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,OAAO,EACd,eAAe,MAAM,KACpB,OAAO,CAAC,iBAAiB,EAAE;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAclD,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,wBAAwB,KAC9B,OAAO,CAAC,iBAAiB,EAAE;IAAE,OAAO,EAAE,QAAQ,CAAA;CAAE,CAMjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { CheckoutLoadOutcome } from '../../types/telemetry/TelemetryEvents.type';
|
|
2
|
-
/**
|
|
3
|
-
* Times how long the shopper waits for the checkout, once per SDK instance.
|
|
4
|
-
*
|
|
5
|
-
* - `checkout.load_time` runs from the SDK constructor to the first outcome.
|
|
6
|
-
* - `form.render_time` runs from the later of the first mount and the first
|
|
7
|
-
* usable association answer to the first outcome, so it leaves out the API
|
|
8
|
-
* round trip and the time the merchant took to call either.
|
|
9
|
-
*
|
|
10
|
-
* A failed load is sent too, with `status=failed` and a `reason`. A figure
|
|
11
|
-
* taken only over loads that finished would improve when slow loads start to
|
|
12
|
-
* fail. A load that never reaches an outcome sends nothing.
|
|
13
|
-
*/
|
|
14
|
-
export declare class LoadTimer {
|
|
15
|
-
private readonly _startedAt;
|
|
16
|
-
private _mountedAt?;
|
|
17
|
-
private _associatedAt?;
|
|
18
|
-
private _reported;
|
|
19
|
-
markMounted(): void;
|
|
20
|
-
markAssociated(): void;
|
|
21
|
-
/**
|
|
22
|
-
* Sends the first outcome and ignores every later one. A `ready` outcome
|
|
23
|
-
* counts only once the checkout is both mounted and associated, because
|
|
24
|
-
* before that the shopper cannot pay whatever the card block says.
|
|
25
|
-
*/
|
|
26
|
-
settle(outcome: CheckoutLoadOutcome): void;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=LoadTimer.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoadTimer.service.d.ts","sourceRoot":"","sources":["../../../src/services/telemetry/LoadTimer.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,4CAA4C,CAAC;AAGpD;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAChD,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,SAAS,CAAS;IAE1B,WAAW,IAAI,IAAI;IAInB,cAAc,IAAI,IAAI;IAItB;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI;CAoC3C"}
|