@flopay/shared 1.14.8 → 1.14.10

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/types.d.ts CHANGED
@@ -644,6 +644,19 @@ export type PayPalSessionIntent = (PayPalLegacySessionIntentRequest & PayPalSess
644
644
  providerObjectType: 'setup_token';
645
645
  });
646
646
  export type SessionIntent = StripeSessionIntent | PayPalSessionIntent;
647
+ /**
648
+ * What `PaymentAPI.createSessionIntent` yields when the billing API answers the intent
649
+ * request with `202 checkout_processing` (the session-intent fence is held by an earlier
650
+ * operation, for example a PayPal capture under review) and polling `/status` reaches a
651
+ * verdict. There is no intent to confirm: `response` is the same `Response` a `/process`
652
+ * call produces for that verdict (`204` success, `200` authorized, `400` JSON decline).
653
+ */
654
+ export interface SettledSessionIntent {
655
+ settled: true;
656
+ response: Response;
657
+ }
658
+ /** A created session intent, or the settled verdict of a session that was already processing. */
659
+ export type SessionIntentResult = SessionIntent | SettledSessionIntent;
647
660
  export type SessionIntentDeclineRequest = {
648
661
  provider: 'stripe';
649
662
  paymentMethodCategory: NonCardPaymentMethodCategory;
@@ -817,6 +830,14 @@ export interface CardCaptureOutcomeEvent {
817
830
  declineReason?: string;
818
831
  /** Human-readable message for `decline` / `error`. */
819
832
  message?: string;
833
+ /**
834
+ * Optional status-response `vaultOutcome` block the hosted form relayed when the
835
+ * backend refused the capture with a buyer-actionable code.
836
+ */
837
+ vaultOutcome?: {
838
+ code: string;
839
+ message?: string;
840
+ };
820
841
  /**
821
842
  * Provider-hosted next-action URL the buyer must complete on
822
843
  * `action_required` (e.g. Stripe 3DS-2 challenge page). Absent on every
@@ -869,6 +890,11 @@ export interface VaultCaptureResultMessage {
869
890
  intentId?: string;
870
891
  declineReason?: string;
871
892
  message?: string;
893
+ /** Optional status-response `vaultOutcome` block, relayed by the hosted form. */
894
+ vaultOutcome?: {
895
+ code: string;
896
+ message?: string;
897
+ };
872
898
  /**
873
899
  * Provider-hosted next-action URL the buyer must complete on
874
900
  * `type === 'action_required'` (e.g. Stripe 3DS-2 challenge page). The host
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Buyer-email capture refusal (flopay/backend#2186, sdk#469).
3
+ *
4
+ * When the backend refuses a card capture because the checkout session has no
5
+ * buyer email, the session status response carries an optional, additive
6
+ * `vaultOutcome` block: `{ code: 'checkout_session_buyer_email_required',
7
+ * message?: <buyer-safe text> }`. The hosted card form relays that block on its
8
+ * terminal `error` outcome. The SDK then shows an "enter your email" prompt and
9
+ * re-enables the card form so the buyer can add the email and pay.
10
+ *
11
+ * The behaviour is gated strictly on the exact code: a missing block, or a block
12
+ * with any other code, leaves today's handling untouched.
13
+ */
14
+ /** The `vaultOutcome.code` the backend sends when the session has no buyer email. */
15
+ export declare const CHECKOUT_SESSION_BUYER_EMAIL_REQUIRED = "checkout_session_buyer_email_required";
16
+ /** Built-in prompt shown when the backend's block carries no buyer-safe message. */
17
+ export declare const BUYER_EMAIL_REQUIRED_PROMPT = "Enter your email address to continue paying.";
18
+ /**
19
+ * The prompt to show for a relayed `vaultOutcome` block, or `null` when the
20
+ * block is absent, malformed, or carries any code other than
21
+ * {@link CHECKOUT_SESSION_BUYER_EMAIL_REQUIRED} (callers then keep today's path).
22
+ * The backend's `message` is defined as safe to show; when it is missing or
23
+ * blank the built-in {@link BUYER_EMAIL_REQUIRED_PROMPT} is used.
24
+ */
25
+ export declare function buyerEmailRequiredPrompt(vaultOutcome: unknown): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flopay/shared",
3
- "version": "1.14.8",
3
+ "version": "1.14.10",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "publishConfig": {