@attesso/types 1.0.6 → 1.0.7
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.
|
@@ -4,13 +4,22 @@
|
|
|
4
4
|
* Types for the asynchronous mandate request flow where agents
|
|
5
5
|
* create requests and users approve via link.
|
|
6
6
|
*/
|
|
7
|
+
import type { FeeMode, FeeRegion, MandateFees } from './mandate.js';
|
|
7
8
|
export type MandateRequestStatus = 'pending' | 'approved' | 'expired' | 'rejected' | 'cancelled';
|
|
8
9
|
/**
|
|
9
10
|
* Request body for creating a mandate request.
|
|
10
11
|
*/
|
|
11
12
|
export interface CreateMandateRequestInput {
|
|
12
|
-
/**
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* The amount in cents. Interpretation depends on feeMode:
|
|
15
|
+
* - markup (default): This is the spending limit. Fees added on top.
|
|
16
|
+
* - inclusive: This is the total charge. Fees deducted.
|
|
17
|
+
*/
|
|
18
|
+
amount: number;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `amount` instead. Kept for backward compatibility.
|
|
21
|
+
*/
|
|
22
|
+
maxAmount?: number;
|
|
14
23
|
/** ISO 4217 currency code (default: "USD") */
|
|
15
24
|
currency?: string;
|
|
16
25
|
/** Category for the spending (e.g., "travel", "shopping") */
|
|
@@ -25,6 +34,18 @@ export interface CreateMandateRequestInput {
|
|
|
25
34
|
callbackUrl?: string;
|
|
26
35
|
/** Pass-through metadata */
|
|
27
36
|
metadata?: Record<string, unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Fee calculation mode. Default: 'markup'.
|
|
39
|
+
* - markup: Amount is spending limit, fees added on top.
|
|
40
|
+
* - inclusive: Amount is total charge, fees deducted.
|
|
41
|
+
*/
|
|
42
|
+
feeMode?: FeeMode;
|
|
43
|
+
/** Region for Stripe fee calculation. Default: 'EEA'. */
|
|
44
|
+
region?: FeeRegion;
|
|
45
|
+
/** Developer fee percentage (0-5%). */
|
|
46
|
+
developerFeePercent?: number;
|
|
47
|
+
/** Developer fixed fee in cents. */
|
|
48
|
+
developerFeeFixed?: number;
|
|
28
49
|
}
|
|
29
50
|
/**
|
|
30
51
|
* Response from creating a mandate request.
|
|
@@ -46,11 +67,20 @@ export interface CreateMandateRequestResponse {
|
|
|
46
67
|
*/
|
|
47
68
|
export interface ApprovedMandateDetails {
|
|
48
69
|
id: string;
|
|
70
|
+
/** @deprecated Use spendingLimit/totalCharged instead. */
|
|
49
71
|
maxAmount: number;
|
|
50
72
|
currency: string;
|
|
51
73
|
merchant: string | null;
|
|
52
74
|
expiresAt: string | null;
|
|
53
75
|
status: string;
|
|
76
|
+
/** What the agent can spend (cents). */
|
|
77
|
+
spendingLimit?: number;
|
|
78
|
+
/** What the user is charged (cents). */
|
|
79
|
+
totalCharged?: number;
|
|
80
|
+
/** Fee mode used. */
|
|
81
|
+
feeMode?: FeeMode;
|
|
82
|
+
/** Fee breakdown. */
|
|
83
|
+
fees?: MandateFees;
|
|
54
84
|
}
|
|
55
85
|
/**
|
|
56
86
|
* Full mandate request details when polling.
|
|
@@ -58,6 +88,9 @@ export interface ApprovedMandateDetails {
|
|
|
58
88
|
export interface MandateRequestDetails {
|
|
59
89
|
id: string;
|
|
60
90
|
status: MandateRequestStatus;
|
|
91
|
+
/** Input amount specified when creating the request. */
|
|
92
|
+
amount?: number;
|
|
93
|
+
/** @deprecated Use amount instead. */
|
|
61
94
|
maxAmount: number;
|
|
62
95
|
currency: string;
|
|
63
96
|
category: string | null;
|
|
@@ -68,6 +101,14 @@ export interface MandateRequestDetails {
|
|
|
68
101
|
approvedAt?: string;
|
|
69
102
|
rejectedAt?: string;
|
|
70
103
|
metadata: Record<string, unknown> | null;
|
|
104
|
+
/** Fee mode used. */
|
|
105
|
+
feeMode?: FeeMode;
|
|
106
|
+
/** What the agent can spend (cents). */
|
|
107
|
+
spendingLimit?: number;
|
|
108
|
+
/** What the user will be charged (cents). */
|
|
109
|
+
totalCharged?: number;
|
|
110
|
+
/** Fee breakdown. */
|
|
111
|
+
fees?: MandateFees;
|
|
71
112
|
/** Mandate details if approved */
|
|
72
113
|
mandate?: ApprovedMandateDetails;
|
|
73
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mandate-request.d.ts","sourceRoot":"","sources":["../src/mandate-request.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,
|
|
1
|
+
{"version":3,"file":"mandate-request.d.ts","sourceRoot":"","sources":["../src/mandate-request.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,cAAc,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,yDAAyD;IACzD,MAAM,CAA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