@flopay/shared 1.16.2 → 1.16.3
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/constants.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/payment-decline.d.ts +35 -3
- package/package.json +1 -1
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* as `payment_declined`. A 5xx, or any other status, is a technical failure
|
|
9
9
|
* whatever decline fields it carries.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* This rule decides telemetry. Merchant callback routing uses
|
|
12
|
+
* {@link isDeclineCallbackFailure}, which also sends an authentication failure
|
|
13
|
+
* to `onDecline` (sdk#558).
|
|
14
14
|
*/
|
|
15
15
|
export declare function isExpectedPaymentDecline(error: {
|
|
16
16
|
readonly statusCode?: number;
|
|
@@ -18,3 +18,35 @@ export declare function isExpectedPaymentDecline(error: {
|
|
|
18
18
|
readonly declineCode?: string;
|
|
19
19
|
readonly telemetryOutcome?: string;
|
|
20
20
|
}): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether a failed payment is an authentication failure: 3DS or PayPal
|
|
23
|
+
* authentication ended the attempt (a 3DS timeout, a failed challenge, or PayPal
|
|
24
|
+
* asking the buyer to re-authenticate). Like a decline, it has no HTTP status
|
|
25
|
+
* or a 4xx one; a 5xx is a technical failure whatever code it carries.
|
|
26
|
+
*
|
|
27
|
+
* Telemetry does not use this: a 3DS timeout is still recorded as an
|
|
28
|
+
* abandonment, not as `payment_declined` (see {@link isExpectedPaymentDecline}).
|
|
29
|
+
*/
|
|
30
|
+
export declare function isPaymentAuthenticationFailure(error: {
|
|
31
|
+
readonly statusCode?: number;
|
|
32
|
+
readonly code?: string;
|
|
33
|
+
}): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a failed payment reaches the merchant through `onDecline` (Vue:
|
|
36
|
+
* `decline`) rather than `onError` (Vue: `error`): an expected decline (sdk#557)
|
|
37
|
+
* or an authentication failure (sdk#558). Every other failure is technical and
|
|
38
|
+
* reaches `onError` only. Each failure therefore reaches exactly one of the two
|
|
39
|
+
* callbacks.
|
|
40
|
+
*
|
|
41
|
+
* Every saved-payment, PayPal-return and automatic-payment path in React and
|
|
42
|
+
* Vue uses this one rule for its callback routing, so the paths cannot drift
|
|
43
|
+
* apart. A path that cannot emit a decline (Vue without a session id, the
|
|
44
|
+
* automatic payment button without `emitDecline: true`) still reports the
|
|
45
|
+
* failure through `onError`, so none is lost.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isDeclineCallbackFailure(error: {
|
|
48
|
+
readonly statusCode?: number;
|
|
49
|
+
readonly code?: string;
|
|
50
|
+
readonly declineCode?: string;
|
|
51
|
+
readonly telemetryOutcome?: string;
|
|
52
|
+
}): boolean;
|