@flopay/shared 1.16.1 → 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.
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Whether a failed payment is an expected decline: the failure the checkout
3
+ * telemetry records as `payment_declined`, and the merchant receives through
4
+ * `onDecline` (Vue: `decline`) only, never `onError` (Vue: `error`).
5
+ *
6
+ * A decline has no HTTP status or a 4xx one, and carries a decline code, a code
7
+ * containing "declin", or a billing rejection the telemetry already classified
8
+ * as `payment_declined`. A 5xx, or any other status, is a technical failure
9
+ * whatever decline fields it carries.
10
+ *
11
+ * This rule decides telemetry. Merchant callback routing uses
12
+ * {@link isDeclineCallbackFailure}, which also sends an authentication failure
13
+ * to `onDecline` (sdk#558).
14
+ */
15
+ export declare function isExpectedPaymentDecline(error: {
16
+ readonly statusCode?: number;
17
+ readonly code?: string;
18
+ readonly declineCode?: string;
19
+ readonly telemetryOutcome?: string;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopay/shared",
3
- "version": "1.16.1",
3
+ "version": "1.16.3",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {