@astrasyncai/verification-gateway 5.4.2 → 5.6.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/README.md +74 -21
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +12 -3
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +12 -3
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.d.ts +1 -1
- package/dist/adapters/mcp.js +12 -3
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +12 -3
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +1 -1
- package/dist/adapters/nextjs.d.ts +1 -1
- package/dist/adapters/nextjs.js +12 -3
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +12 -3
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +41 -1
- package/dist/adapters/sdk.d.ts +41 -1
- package/dist/adapters/sdk.js +54 -3
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +54 -3
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +12 -3
- package/dist/bin/astrasync-codex-hook.js +12 -3
- package/dist/bin/astrasync-guard.js +12 -3
- package/dist/bin/astrasync.js +13 -3
- package/dist/browser/background.js +12 -3
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +12 -3
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.js +12 -3
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +12 -3
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +12 -3
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +12 -3
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +1 -1
- package/dist/edge-config.d.ts +1 -1
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +1 -1
- package/dist/edge-core/index.d.ts +1 -1
- package/dist/edge-core/index.js +12 -3
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +12 -3
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +12 -3
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +12 -3
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +1 -1
- package/dist/git-trigger/git-hooks.d.ts +1 -1
- package/dist/index.d.mts +121 -4
- package/dist/index.d.ts +121 -4
- package/dist/index.js +54 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -3
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-Bd2O3eX1.d.mts → types-BCmHFdkJ.d.mts} +78 -1
- package/dist/{types-BU04qAAR.d.mts → types-BK_pRNSs.d.mts} +78 -1
- package/dist/{types-BU04qAAR.d.ts → types-BK_pRNSs.d.ts} +78 -1
- package/dist/{types-DMChboN_.d.ts → types-CwY5IY-0.d.ts} +78 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +12 -3
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +12 -3
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -425,11 +425,72 @@ interface VerificationResult {
|
|
|
425
425
|
* instrument on file (steer the user to add one via onboarding).
|
|
426
426
|
*/
|
|
427
427
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
428
|
+
/**
|
|
429
|
+
* 5.5.0 (astra-pay): interim merchant self-settlement token. Present ONLY
|
|
430
|
+
* for firstParty merchants opted into settlement_mode='self_settle' on the
|
|
431
|
+
* confirm leg — YOUR server charges with this material on the shared Stripe
|
|
432
|
+
* account and reports the outcome via `client.reportSettlement()`.
|
|
433
|
+
* MERCHANT-ONLY lane: never expose it to the agent plane, never log it,
|
|
434
|
+
* never echo it back over the bridge handoff (the bridge strips it
|
|
435
|
+
* defensively). Charge with idempotency key `voucher:<jti>` and
|
|
436
|
+
* `metadata.jti` — that lets the platform webhook auto-reconcile even if
|
|
437
|
+
* your report never arrives.
|
|
438
|
+
*/
|
|
439
|
+
settlementToken?: MerchantSettlementToken;
|
|
440
|
+
/**
|
|
441
|
+
* 5.6.0 (astra-pay): fulfilment contact for first-party confirm legs.
|
|
442
|
+
* The platform always resolves an email for the merchant — the agent's
|
|
443
|
+
* `buyerEmail` when one was supplied, else the buyer's account email
|
|
444
|
+
* (`emailSource` says which). Present on every first-party confirm leg that
|
|
445
|
+
* progressed (settled, pending_merchant, held, requires_action) so it can be
|
|
446
|
+
* stored with a pending order; only FULFIL against it once the order is
|
|
447
|
+
* settled / pending_merchant. MERCHANT-ONLY lane like `settlementToken` —
|
|
448
|
+
* the bridge strips it from the agent plane. An explicit `buyerEmail` on the
|
|
449
|
+
* confirm handoff body wins over `fulfilment.email` (the platform default).
|
|
450
|
+
*/
|
|
451
|
+
fulfilment?: FulfilmentInfo;
|
|
428
452
|
/** Timestamp of verification */
|
|
429
453
|
verifiedAt: Date;
|
|
430
454
|
/** TTL for this result (seconds) */
|
|
431
455
|
cacheTtl?: number;
|
|
432
456
|
}
|
|
457
|
+
/**
|
|
458
|
+
* 5.5.0 (astra-pay): agent-blind settlement token for self-settling
|
|
459
|
+
* first-party merchants. Self-describing via `type`, so a Stripe Shared
|
|
460
|
+
* Payment Token can replace the raw customer/payment-method pair without a
|
|
461
|
+
* contract change.
|
|
462
|
+
*/
|
|
463
|
+
interface MerchantSettlementToken {
|
|
464
|
+
type: 'stripe_delegated_charge';
|
|
465
|
+
stripeCustomerId: string;
|
|
466
|
+
stripePaymentMethodId: string;
|
|
467
|
+
/** Integer minor units — money is never a float on the wire. */
|
|
468
|
+
amountMinor: number;
|
|
469
|
+
/** Upper-case ISO-4217. */
|
|
470
|
+
currency: string;
|
|
471
|
+
/** Verification session id — the report-back key. */
|
|
472
|
+
sessionId: string | null;
|
|
473
|
+
/** The pending kya_shop_order row your report resolves. */
|
|
474
|
+
orderId: string;
|
|
475
|
+
/** Settlement spine: charge with Stripe idempotency key `voucher:<jti>`
|
|
476
|
+
* and set `metadata.jti` on the PaymentIntent. */
|
|
477
|
+
jti: string;
|
|
478
|
+
statementSuffix: string | null;
|
|
479
|
+
/** Advisory charge-by bound (ISO); stuck orders are ops-swept after it. */
|
|
480
|
+
expiresAt: string;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* 5.6.0 (astra-pay): fulfilment contact block. `emailSource` is an OPEN union
|
|
484
|
+
* (same rule as settlement statuses): treat unknown sources like
|
|
485
|
+
* 'agent_provided' — the email is still the one to use.
|
|
486
|
+
*/
|
|
487
|
+
interface FulfilmentInfo {
|
|
488
|
+
/** Canonicalized (trimmed, lower-cased) receipt/delivery email. */
|
|
489
|
+
email: string;
|
|
490
|
+
/** 'agent_provided' = the agent passed buyerEmail on this confirm;
|
|
491
|
+
* 'account' = platform default — the buyer's account email. */
|
|
492
|
+
emailSource: 'agent_provided' | 'account' | (string & {});
|
|
493
|
+
}
|
|
433
494
|
/**
|
|
434
495
|
* 5.3.0 (astra-pay): sanitized outcome of first-party charge-at-redeem
|
|
435
496
|
* settlement. Carries NO voucher/instrument material — the settlement channel
|
|
@@ -440,9 +501,16 @@ interface VerificationResult {
|
|
|
440
501
|
* approves, the platform re-drives the confirm with the SAME
|
|
441
502
|
* checkoutSessionId and that re-drive carries the settling outcome
|
|
442
503
|
* (one order row per session — the re-drive claims the same row).
|
|
504
|
+
*
|
|
505
|
+
* 5.5.0: OPEN union — the platform may introduce statuses (e.g.
|
|
506
|
+
* `pending_merchant` for self-settling merchants) ahead of your SDK version.
|
|
507
|
+
* Rule: treat any status you don't recognize as PENDING, never as failed.
|
|
508
|
+
* Also 5.5.0: `no_instrument` on a held/approved session is NON-terminal —
|
|
509
|
+
* the human's approval is NOT consumed; a re-drive with the same
|
|
510
|
+
* checkoutSessionId settles once a card is on file.
|
|
443
511
|
*/
|
|
444
512
|
interface SettlementOutcomeInfo {
|
|
445
|
-
status: 'settled' | 'failed' | 'requires_action' | 'no_instrument' | 'requires_approval';
|
|
513
|
+
status: 'settled' | 'failed' | 'requires_action' | 'no_instrument' | 'requires_approval' | 'pending_merchant' | (string & {});
|
|
446
514
|
/** First-party order id — the buyer sees the purchase in their AstraSync
|
|
447
515
|
* dashboard orders view (no public receipt page). */
|
|
448
516
|
orderId?: string;
|
|
@@ -532,6 +600,15 @@ interface VerificationRequest {
|
|
|
532
600
|
currency: string;
|
|
533
601
|
};
|
|
534
602
|
}>;
|
|
603
|
+
/**
|
|
604
|
+
* 5.6.0 (astra-pay): buyer's receipt/delivery email, forwarded on the
|
|
605
|
+
* confirm leg only. TRANSIT-ONLY fulfilment PII — the platform echoes it
|
|
606
|
+
* back (canonicalized) in `VerificationResult.fulfilment` for first-party
|
|
607
|
+
* merchants and never persists it. When omitted, the platform defaults
|
|
608
|
+
* `fulfilment.email` to the buyer's account email, so supplying this is
|
|
609
|
+
* only needed for an alternate contact (gift delivery etc.).
|
|
610
|
+
*/
|
|
611
|
+
buyerEmail?: string;
|
|
535
612
|
/** Whether this is a sub-agent request */
|
|
536
613
|
isSubAgentRequest?: boolean;
|
|
537
614
|
/** Parent agent ID for sub-agent requests */
|
|
@@ -475,11 +475,72 @@ interface VerificationResult {
|
|
|
475
475
|
* instrument on file (steer the user to add one via onboarding).
|
|
476
476
|
*/
|
|
477
477
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
478
|
+
/**
|
|
479
|
+
* 5.5.0 (astra-pay): interim merchant self-settlement token. Present ONLY
|
|
480
|
+
* for firstParty merchants opted into settlement_mode='self_settle' on the
|
|
481
|
+
* confirm leg — YOUR server charges with this material on the shared Stripe
|
|
482
|
+
* account and reports the outcome via `client.reportSettlement()`.
|
|
483
|
+
* MERCHANT-ONLY lane: never expose it to the agent plane, never log it,
|
|
484
|
+
* never echo it back over the bridge handoff (the bridge strips it
|
|
485
|
+
* defensively). Charge with idempotency key `voucher:<jti>` and
|
|
486
|
+
* `metadata.jti` — that lets the platform webhook auto-reconcile even if
|
|
487
|
+
* your report never arrives.
|
|
488
|
+
*/
|
|
489
|
+
settlementToken?: MerchantSettlementToken;
|
|
490
|
+
/**
|
|
491
|
+
* 5.6.0 (astra-pay): fulfilment contact for first-party confirm legs.
|
|
492
|
+
* The platform always resolves an email for the merchant — the agent's
|
|
493
|
+
* `buyerEmail` when one was supplied, else the buyer's account email
|
|
494
|
+
* (`emailSource` says which). Present on every first-party confirm leg that
|
|
495
|
+
* progressed (settled, pending_merchant, held, requires_action) so it can be
|
|
496
|
+
* stored with a pending order; only FULFIL against it once the order is
|
|
497
|
+
* settled / pending_merchant. MERCHANT-ONLY lane like `settlementToken` —
|
|
498
|
+
* the bridge strips it from the agent plane. An explicit `buyerEmail` on the
|
|
499
|
+
* confirm handoff body wins over `fulfilment.email` (the platform default).
|
|
500
|
+
*/
|
|
501
|
+
fulfilment?: FulfilmentInfo;
|
|
478
502
|
/** Timestamp of verification */
|
|
479
503
|
verifiedAt: Date;
|
|
480
504
|
/** TTL for this result (seconds) */
|
|
481
505
|
cacheTtl?: number;
|
|
482
506
|
}
|
|
507
|
+
/**
|
|
508
|
+
* 5.5.0 (astra-pay): agent-blind settlement token for self-settling
|
|
509
|
+
* first-party merchants. Self-describing via `type`, so a Stripe Shared
|
|
510
|
+
* Payment Token can replace the raw customer/payment-method pair without a
|
|
511
|
+
* contract change.
|
|
512
|
+
*/
|
|
513
|
+
interface MerchantSettlementToken {
|
|
514
|
+
type: 'stripe_delegated_charge';
|
|
515
|
+
stripeCustomerId: string;
|
|
516
|
+
stripePaymentMethodId: string;
|
|
517
|
+
/** Integer minor units — money is never a float on the wire. */
|
|
518
|
+
amountMinor: number;
|
|
519
|
+
/** Upper-case ISO-4217. */
|
|
520
|
+
currency: string;
|
|
521
|
+
/** Verification session id — the report-back key. */
|
|
522
|
+
sessionId: string | null;
|
|
523
|
+
/** The pending kya_shop_order row your report resolves. */
|
|
524
|
+
orderId: string;
|
|
525
|
+
/** Settlement spine: charge with Stripe idempotency key `voucher:<jti>`
|
|
526
|
+
* and set `metadata.jti` on the PaymentIntent. */
|
|
527
|
+
jti: string;
|
|
528
|
+
statementSuffix: string | null;
|
|
529
|
+
/** Advisory charge-by bound (ISO); stuck orders are ops-swept after it. */
|
|
530
|
+
expiresAt: string;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* 5.6.0 (astra-pay): fulfilment contact block. `emailSource` is an OPEN union
|
|
534
|
+
* (same rule as settlement statuses): treat unknown sources like
|
|
535
|
+
* 'agent_provided' — the email is still the one to use.
|
|
536
|
+
*/
|
|
537
|
+
interface FulfilmentInfo {
|
|
538
|
+
/** Canonicalized (trimmed, lower-cased) receipt/delivery email. */
|
|
539
|
+
email: string;
|
|
540
|
+
/** 'agent_provided' = the agent passed buyerEmail on this confirm;
|
|
541
|
+
* 'account' = platform default — the buyer's account email. */
|
|
542
|
+
emailSource: 'agent_provided' | 'account' | (string & {});
|
|
543
|
+
}
|
|
483
544
|
/**
|
|
484
545
|
* 5.3.0 (astra-pay): sanitized outcome of first-party charge-at-redeem
|
|
485
546
|
* settlement. Carries NO voucher/instrument material — the settlement channel
|
|
@@ -490,9 +551,16 @@ interface VerificationResult {
|
|
|
490
551
|
* approves, the platform re-drives the confirm with the SAME
|
|
491
552
|
* checkoutSessionId and that re-drive carries the settling outcome
|
|
492
553
|
* (one order row per session — the re-drive claims the same row).
|
|
554
|
+
*
|
|
555
|
+
* 5.5.0: OPEN union — the platform may introduce statuses (e.g.
|
|
556
|
+
* `pending_merchant` for self-settling merchants) ahead of your SDK version.
|
|
557
|
+
* Rule: treat any status you don't recognize as PENDING, never as failed.
|
|
558
|
+
* Also 5.5.0: `no_instrument` on a held/approved session is NON-terminal —
|
|
559
|
+
* the human's approval is NOT consumed; a re-drive with the same
|
|
560
|
+
* checkoutSessionId settles once a card is on file.
|
|
493
561
|
*/
|
|
494
562
|
interface SettlementOutcomeInfo {
|
|
495
|
-
status: 'settled' | 'failed' | 'requires_action' | 'no_instrument' | 'requires_approval';
|
|
563
|
+
status: 'settled' | 'failed' | 'requires_action' | 'no_instrument' | 'requires_approval' | 'pending_merchant' | (string & {});
|
|
496
564
|
/** First-party order id — the buyer sees the purchase in their AstraSync
|
|
497
565
|
* dashboard orders view (no public receipt page). */
|
|
498
566
|
orderId?: string;
|
|
@@ -582,6 +650,15 @@ interface VerificationRequest {
|
|
|
582
650
|
currency: string;
|
|
583
651
|
};
|
|
584
652
|
}>;
|
|
653
|
+
/**
|
|
654
|
+
* 5.6.0 (astra-pay): buyer's receipt/delivery email, forwarded on the
|
|
655
|
+
* confirm leg only. TRANSIT-ONLY fulfilment PII — the platform echoes it
|
|
656
|
+
* back (canonicalized) in `VerificationResult.fulfilment` for first-party
|
|
657
|
+
* merchants and never persists it. When omitted, the platform defaults
|
|
658
|
+
* `fulfilment.email` to the buyer's account email, so supplying this is
|
|
659
|
+
* only needed for an alternate contact (gift delivery etc.).
|
|
660
|
+
*/
|
|
661
|
+
buyerEmail?: string;
|
|
585
662
|
/** Whether this is a sub-agent request */
|
|
586
663
|
isSubAgentRequest?: boolean;
|
|
587
664
|
/** Parent agent ID for sub-agent requests */
|
|
@@ -475,11 +475,72 @@ interface VerificationResult {
|
|
|
475
475
|
* instrument on file (steer the user to add one via onboarding).
|
|
476
476
|
*/
|
|
477
477
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
478
|
+
/**
|
|
479
|
+
* 5.5.0 (astra-pay): interim merchant self-settlement token. Present ONLY
|
|
480
|
+
* for firstParty merchants opted into settlement_mode='self_settle' on the
|
|
481
|
+
* confirm leg — YOUR server charges with this material on the shared Stripe
|
|
482
|
+
* account and reports the outcome via `client.reportSettlement()`.
|
|
483
|
+
* MERCHANT-ONLY lane: never expose it to the agent plane, never log it,
|
|
484
|
+
* never echo it back over the bridge handoff (the bridge strips it
|
|
485
|
+
* defensively). Charge with idempotency key `voucher:<jti>` and
|
|
486
|
+
* `metadata.jti` — that lets the platform webhook auto-reconcile even if
|
|
487
|
+
* your report never arrives.
|
|
488
|
+
*/
|
|
489
|
+
settlementToken?: MerchantSettlementToken;
|
|
490
|
+
/**
|
|
491
|
+
* 5.6.0 (astra-pay): fulfilment contact for first-party confirm legs.
|
|
492
|
+
* The platform always resolves an email for the merchant — the agent's
|
|
493
|
+
* `buyerEmail` when one was supplied, else the buyer's account email
|
|
494
|
+
* (`emailSource` says which). Present on every first-party confirm leg that
|
|
495
|
+
* progressed (settled, pending_merchant, held, requires_action) so it can be
|
|
496
|
+
* stored with a pending order; only FULFIL against it once the order is
|
|
497
|
+
* settled / pending_merchant. MERCHANT-ONLY lane like `settlementToken` —
|
|
498
|
+
* the bridge strips it from the agent plane. An explicit `buyerEmail` on the
|
|
499
|
+
* confirm handoff body wins over `fulfilment.email` (the platform default).
|
|
500
|
+
*/
|
|
501
|
+
fulfilment?: FulfilmentInfo;
|
|
478
502
|
/** Timestamp of verification */
|
|
479
503
|
verifiedAt: Date;
|
|
480
504
|
/** TTL for this result (seconds) */
|
|
481
505
|
cacheTtl?: number;
|
|
482
506
|
}
|
|
507
|
+
/**
|
|
508
|
+
* 5.5.0 (astra-pay): agent-blind settlement token for self-settling
|
|
509
|
+
* first-party merchants. Self-describing via `type`, so a Stripe Shared
|
|
510
|
+
* Payment Token can replace the raw customer/payment-method pair without a
|
|
511
|
+
* contract change.
|
|
512
|
+
*/
|
|
513
|
+
interface MerchantSettlementToken {
|
|
514
|
+
type: 'stripe_delegated_charge';
|
|
515
|
+
stripeCustomerId: string;
|
|
516
|
+
stripePaymentMethodId: string;
|
|
517
|
+
/** Integer minor units — money is never a float on the wire. */
|
|
518
|
+
amountMinor: number;
|
|
519
|
+
/** Upper-case ISO-4217. */
|
|
520
|
+
currency: string;
|
|
521
|
+
/** Verification session id — the report-back key. */
|
|
522
|
+
sessionId: string | null;
|
|
523
|
+
/** The pending kya_shop_order row your report resolves. */
|
|
524
|
+
orderId: string;
|
|
525
|
+
/** Settlement spine: charge with Stripe idempotency key `voucher:<jti>`
|
|
526
|
+
* and set `metadata.jti` on the PaymentIntent. */
|
|
527
|
+
jti: string;
|
|
528
|
+
statementSuffix: string | null;
|
|
529
|
+
/** Advisory charge-by bound (ISO); stuck orders are ops-swept after it. */
|
|
530
|
+
expiresAt: string;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* 5.6.0 (astra-pay): fulfilment contact block. `emailSource` is an OPEN union
|
|
534
|
+
* (same rule as settlement statuses): treat unknown sources like
|
|
535
|
+
* 'agent_provided' — the email is still the one to use.
|
|
536
|
+
*/
|
|
537
|
+
interface FulfilmentInfo {
|
|
538
|
+
/** Canonicalized (trimmed, lower-cased) receipt/delivery email. */
|
|
539
|
+
email: string;
|
|
540
|
+
/** 'agent_provided' = the agent passed buyerEmail on this confirm;
|
|
541
|
+
* 'account' = platform default — the buyer's account email. */
|
|
542
|
+
emailSource: 'agent_provided' | 'account' | (string & {});
|
|
543
|
+
}
|
|
483
544
|
/**
|
|
484
545
|
* 5.3.0 (astra-pay): sanitized outcome of first-party charge-at-redeem
|
|
485
546
|
* settlement. Carries NO voucher/instrument material — the settlement channel
|
|
@@ -490,9 +551,16 @@ interface VerificationResult {
|
|
|
490
551
|
* approves, the platform re-drives the confirm with the SAME
|
|
491
552
|
* checkoutSessionId and that re-drive carries the settling outcome
|
|
492
553
|
* (one order row per session — the re-drive claims the same row).
|
|
554
|
+
*
|
|
555
|
+
* 5.5.0: OPEN union — the platform may introduce statuses (e.g.
|
|
556
|
+
* `pending_merchant` for self-settling merchants) ahead of your SDK version.
|
|
557
|
+
* Rule: treat any status you don't recognize as PENDING, never as failed.
|
|
558
|
+
* Also 5.5.0: `no_instrument` on a held/approved session is NON-terminal —
|
|
559
|
+
* the human's approval is NOT consumed; a re-drive with the same
|
|
560
|
+
* checkoutSessionId settles once a card is on file.
|
|
493
561
|
*/
|
|
494
562
|
interface SettlementOutcomeInfo {
|
|
495
|
-
status: 'settled' | 'failed' | 'requires_action' | 'no_instrument' | 'requires_approval';
|
|
563
|
+
status: 'settled' | 'failed' | 'requires_action' | 'no_instrument' | 'requires_approval' | 'pending_merchant' | (string & {});
|
|
496
564
|
/** First-party order id — the buyer sees the purchase in their AstraSync
|
|
497
565
|
* dashboard orders view (no public receipt page). */
|
|
498
566
|
orderId?: string;
|
|
@@ -582,6 +650,15 @@ interface VerificationRequest {
|
|
|
582
650
|
currency: string;
|
|
583
651
|
};
|
|
584
652
|
}>;
|
|
653
|
+
/**
|
|
654
|
+
* 5.6.0 (astra-pay): buyer's receipt/delivery email, forwarded on the
|
|
655
|
+
* confirm leg only. TRANSIT-ONLY fulfilment PII — the platform echoes it
|
|
656
|
+
* back (canonicalized) in `VerificationResult.fulfilment` for first-party
|
|
657
|
+
* merchants and never persists it. When omitted, the platform defaults
|
|
658
|
+
* `fulfilment.email` to the buyer's account email, so supplying this is
|
|
659
|
+
* only needed for an alternate contact (gift delivery etc.).
|
|
660
|
+
*/
|
|
661
|
+
buyerEmail?: string;
|
|
585
662
|
/** Whether this is a sub-agent request */
|
|
586
663
|
isSubAgentRequest?: boolean;
|
|
587
664
|
/** Parent agent ID for sub-agent requests */
|
|
@@ -425,11 +425,72 @@ interface VerificationResult {
|
|
|
425
425
|
* instrument on file (steer the user to add one via onboarding).
|
|
426
426
|
*/
|
|
427
427
|
settlementOutcome?: SettlementOutcomeInfo;
|
|
428
|
+
/**
|
|
429
|
+
* 5.5.0 (astra-pay): interim merchant self-settlement token. Present ONLY
|
|
430
|
+
* for firstParty merchants opted into settlement_mode='self_settle' on the
|
|
431
|
+
* confirm leg — YOUR server charges with this material on the shared Stripe
|
|
432
|
+
* account and reports the outcome via `client.reportSettlement()`.
|
|
433
|
+
* MERCHANT-ONLY lane: never expose it to the agent plane, never log it,
|
|
434
|
+
* never echo it back over the bridge handoff (the bridge strips it
|
|
435
|
+
* defensively). Charge with idempotency key `voucher:<jti>` and
|
|
436
|
+
* `metadata.jti` — that lets the platform webhook auto-reconcile even if
|
|
437
|
+
* your report never arrives.
|
|
438
|
+
*/
|
|
439
|
+
settlementToken?: MerchantSettlementToken;
|
|
440
|
+
/**
|
|
441
|
+
* 5.6.0 (astra-pay): fulfilment contact for first-party confirm legs.
|
|
442
|
+
* The platform always resolves an email for the merchant — the agent's
|
|
443
|
+
* `buyerEmail` when one was supplied, else the buyer's account email
|
|
444
|
+
* (`emailSource` says which). Present on every first-party confirm leg that
|
|
445
|
+
* progressed (settled, pending_merchant, held, requires_action) so it can be
|
|
446
|
+
* stored with a pending order; only FULFIL against it once the order is
|
|
447
|
+
* settled / pending_merchant. MERCHANT-ONLY lane like `settlementToken` —
|
|
448
|
+
* the bridge strips it from the agent plane. An explicit `buyerEmail` on the
|
|
449
|
+
* confirm handoff body wins over `fulfilment.email` (the platform default).
|
|
450
|
+
*/
|
|
451
|
+
fulfilment?: FulfilmentInfo;
|
|
428
452
|
/** Timestamp of verification */
|
|
429
453
|
verifiedAt: Date;
|
|
430
454
|
/** TTL for this result (seconds) */
|
|
431
455
|
cacheTtl?: number;
|
|
432
456
|
}
|
|
457
|
+
/**
|
|
458
|
+
* 5.5.0 (astra-pay): agent-blind settlement token for self-settling
|
|
459
|
+
* first-party merchants. Self-describing via `type`, so a Stripe Shared
|
|
460
|
+
* Payment Token can replace the raw customer/payment-method pair without a
|
|
461
|
+
* contract change.
|
|
462
|
+
*/
|
|
463
|
+
interface MerchantSettlementToken {
|
|
464
|
+
type: 'stripe_delegated_charge';
|
|
465
|
+
stripeCustomerId: string;
|
|
466
|
+
stripePaymentMethodId: string;
|
|
467
|
+
/** Integer minor units — money is never a float on the wire. */
|
|
468
|
+
amountMinor: number;
|
|
469
|
+
/** Upper-case ISO-4217. */
|
|
470
|
+
currency: string;
|
|
471
|
+
/** Verification session id — the report-back key. */
|
|
472
|
+
sessionId: string | null;
|
|
473
|
+
/** The pending kya_shop_order row your report resolves. */
|
|
474
|
+
orderId: string;
|
|
475
|
+
/** Settlement spine: charge with Stripe idempotency key `voucher:<jti>`
|
|
476
|
+
* and set `metadata.jti` on the PaymentIntent. */
|
|
477
|
+
jti: string;
|
|
478
|
+
statementSuffix: string | null;
|
|
479
|
+
/** Advisory charge-by bound (ISO); stuck orders are ops-swept after it. */
|
|
480
|
+
expiresAt: string;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* 5.6.0 (astra-pay): fulfilment contact block. `emailSource` is an OPEN union
|
|
484
|
+
* (same rule as settlement statuses): treat unknown sources like
|
|
485
|
+
* 'agent_provided' — the email is still the one to use.
|
|
486
|
+
*/
|
|
487
|
+
interface FulfilmentInfo {
|
|
488
|
+
/** Canonicalized (trimmed, lower-cased) receipt/delivery email. */
|
|
489
|
+
email: string;
|
|
490
|
+
/** 'agent_provided' = the agent passed buyerEmail on this confirm;
|
|
491
|
+
* 'account' = platform default — the buyer's account email. */
|
|
492
|
+
emailSource: 'agent_provided' | 'account' | (string & {});
|
|
493
|
+
}
|
|
433
494
|
/**
|
|
434
495
|
* 5.3.0 (astra-pay): sanitized outcome of first-party charge-at-redeem
|
|
435
496
|
* settlement. Carries NO voucher/instrument material — the settlement channel
|
|
@@ -440,9 +501,16 @@ interface VerificationResult {
|
|
|
440
501
|
* approves, the platform re-drives the confirm with the SAME
|
|
441
502
|
* checkoutSessionId and that re-drive carries the settling outcome
|
|
442
503
|
* (one order row per session — the re-drive claims the same row).
|
|
504
|
+
*
|
|
505
|
+
* 5.5.0: OPEN union — the platform may introduce statuses (e.g.
|
|
506
|
+
* `pending_merchant` for self-settling merchants) ahead of your SDK version.
|
|
507
|
+
* Rule: treat any status you don't recognize as PENDING, never as failed.
|
|
508
|
+
* Also 5.5.0: `no_instrument` on a held/approved session is NON-terminal —
|
|
509
|
+
* the human's approval is NOT consumed; a re-drive with the same
|
|
510
|
+
* checkoutSessionId settles once a card is on file.
|
|
443
511
|
*/
|
|
444
512
|
interface SettlementOutcomeInfo {
|
|
445
|
-
status: 'settled' | 'failed' | 'requires_action' | 'no_instrument' | 'requires_approval';
|
|
513
|
+
status: 'settled' | 'failed' | 'requires_action' | 'no_instrument' | 'requires_approval' | 'pending_merchant' | (string & {});
|
|
446
514
|
/** First-party order id — the buyer sees the purchase in their AstraSync
|
|
447
515
|
* dashboard orders view (no public receipt page). */
|
|
448
516
|
orderId?: string;
|
|
@@ -532,6 +600,15 @@ interface VerificationRequest {
|
|
|
532
600
|
currency: string;
|
|
533
601
|
};
|
|
534
602
|
}>;
|
|
603
|
+
/**
|
|
604
|
+
* 5.6.0 (astra-pay): buyer's receipt/delivery email, forwarded on the
|
|
605
|
+
* confirm leg only. TRANSIT-ONLY fulfilment PII — the platform echoes it
|
|
606
|
+
* back (canonicalized) in `VerificationResult.fulfilment` for first-party
|
|
607
|
+
* merchants and never persists it. When omitted, the platform defaults
|
|
608
|
+
* `fulfilment.email` to the buyer's account email, so supplying this is
|
|
609
|
+
* only needed for an alternate contact (gift delivery etc.).
|
|
610
|
+
*/
|
|
611
|
+
buyerEmail?: string;
|
|
535
612
|
/** Whether this is a sub-agent request */
|
|
536
613
|
isSubAgentRequest?: boolean;
|
|
537
614
|
/** Parent agent ID for sub-agent requests */
|
package/dist/ui/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-
|
|
1
|
+
import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-BK_pRNSs.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Verification Interstitial Component
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-
|
|
1
|
+
import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-BK_pRNSs.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AstraSync Verification Interstitial Component
|
package/dist/verify.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-
|
|
1
|
+
import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-BCmHFdkJ.mjs';
|
|
2
2
|
import { ObservedMetadata } from './metadata-capture.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/verify.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-
|
|
1
|
+
import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-CwY5IY-0.js';
|
|
2
2
|
import { ObservedMetadata } from './metadata-capture.js';
|
|
3
3
|
|
|
4
4
|
/**
|
package/dist/verify.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(verify_exports, {
|
|
|
36
36
|
module.exports = __toCommonJS(verify_exports);
|
|
37
37
|
|
|
38
38
|
// src/version.ts
|
|
39
|
-
var SDK_VERSION = "5.
|
|
39
|
+
var SDK_VERSION = "5.6.0";
|
|
40
40
|
|
|
41
41
|
// src/http.ts
|
|
42
42
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -358,6 +358,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
358
358
|
if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
|
|
359
359
|
if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
|
|
360
360
|
if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
|
|
361
|
+
if (requestData.buyerEmail) body.buyerEmail = requestData.buyerEmail;
|
|
361
362
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
362
363
|
if (requestData.attemptId) body.attemptId = requestData.attemptId;
|
|
363
364
|
if (requestData.considerationSet) body.considerationSet = requestData.considerationSet;
|
|
@@ -530,7 +531,12 @@ async function verify(config, request, options) {
|
|
|
530
531
|
recommendationReasons: apiResponse.recommendationReasons,
|
|
531
532
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
532
533
|
settlement: apiResponse.settlement,
|
|
533
|
-
settlementOutcome: apiResponse.settlementOutcome
|
|
534
|
+
settlementOutcome: apiResponse.settlementOutcome,
|
|
535
|
+
// 5.5.0 self-settlement: merchant-only material — passes through to the
|
|
536
|
+
// MERCHANT caller only (bridge callers strip it before the agent plane).
|
|
537
|
+
settlementToken: apiResponse.settlementToken,
|
|
538
|
+
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
539
|
+
fulfilment: apiResponse.fulfilment
|
|
534
540
|
};
|
|
535
541
|
return result2;
|
|
536
542
|
}
|
|
@@ -588,7 +594,10 @@ async function verify(config, request, options) {
|
|
|
588
594
|
warningHeader: apiResponse.warningHeader,
|
|
589
595
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
590
596
|
settlement: apiResponse.settlement,
|
|
591
|
-
settlementOutcome: apiResponse.settlementOutcome
|
|
597
|
+
settlementOutcome: apiResponse.settlementOutcome,
|
|
598
|
+
settlementToken: apiResponse.settlementToken,
|
|
599
|
+
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
600
|
+
fulfilment: apiResponse.fulfilment
|
|
592
601
|
};
|
|
593
602
|
if (result.recommendation === "deny") {
|
|
594
603
|
result.policyAllowed = false;
|