@naturalpay/sdk 1.6.50 → 1.6.51

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.
Files changed (70) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/cardSessions/client/Client.d.ts +2 -1
  3. package/dist/cjs/api/resources/cardSessions/client/Client.js +2 -1
  4. package/dist/cjs/api/resources/cardSessions/client/requests/CreateCardSessionsRequest.d.ts +4 -3
  5. package/dist/cjs/api/resources/cardSessions/types/CreateCardSessionsRequestPurchase.d.ts +5 -3
  6. package/dist/cjs/api/resources/cardSessions/types/CreateCardSessionsResponse.d.ts +2 -0
  7. package/dist/cjs/api/resources/cardSessions/types/CreateCardSessionsResponsePurchase.d.ts +8 -0
  8. package/dist/cjs/api/resources/cardSessions/types/CreateCardSessionsResponsePurchase.js +3 -0
  9. package/dist/cjs/api/resources/cardSessions/types/GetCardSessionsResponse.d.ts +2 -0
  10. package/dist/cjs/api/resources/cardSessions/types/GetCardSessionsResponsePurchase.d.ts +8 -0
  11. package/dist/cjs/api/resources/cardSessions/types/GetCardSessionsResponsePurchase.js +3 -0
  12. package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.ts +2 -0
  13. package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItemPurchase.d.ts +8 -0
  14. package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItemPurchase.js +3 -0
  15. package/dist/cjs/api/resources/cardSessions/types/index.d.ts +3 -0
  16. package/dist/cjs/api/resources/cardSessions/types/index.js +3 -0
  17. package/dist/cjs/serialization/resources/cardSessions/types/CreateCardSessionsRequestPurchase.d.ts +1 -0
  18. package/dist/cjs/serialization/resources/cardSessions/types/CreateCardSessionsRequestPurchase.js +1 -0
  19. package/dist/cjs/serialization/resources/cardSessions/types/CreateCardSessionsResponse.d.ts +2 -0
  20. package/dist/cjs/serialization/resources/cardSessions/types/CreateCardSessionsResponse.js +2 -0
  21. package/dist/cjs/serialization/resources/cardSessions/types/CreateCardSessionsResponsePurchase.d.ts +12 -0
  22. package/dist/cjs/serialization/resources/cardSessions/types/CreateCardSessionsResponsePurchase.js +44 -0
  23. package/dist/cjs/serialization/resources/cardSessions/types/GetCardSessionsResponse.d.ts +2 -0
  24. package/dist/cjs/serialization/resources/cardSessions/types/GetCardSessionsResponse.js +2 -0
  25. package/dist/cjs/serialization/resources/cardSessions/types/GetCardSessionsResponsePurchase.d.ts +12 -0
  26. package/dist/cjs/serialization/resources/cardSessions/types/GetCardSessionsResponsePurchase.js +44 -0
  27. package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.ts +2 -0
  28. package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.js +2 -0
  29. package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemPurchase.d.ts +12 -0
  30. package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemPurchase.js +44 -0
  31. package/dist/cjs/serialization/resources/cardSessions/types/index.d.ts +3 -0
  32. package/dist/cjs/serialization/resources/cardSessions/types/index.js +3 -0
  33. package/dist/cjs/version.d.ts +1 -1
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/esm/BaseClient.mjs +2 -2
  36. package/dist/esm/api/resources/cardSessions/client/Client.d.mts +2 -1
  37. package/dist/esm/api/resources/cardSessions/client/Client.mjs +2 -1
  38. package/dist/esm/api/resources/cardSessions/client/requests/CreateCardSessionsRequest.d.mts +4 -3
  39. package/dist/esm/api/resources/cardSessions/types/CreateCardSessionsRequestPurchase.d.mts +5 -3
  40. package/dist/esm/api/resources/cardSessions/types/CreateCardSessionsResponse.d.mts +2 -0
  41. package/dist/esm/api/resources/cardSessions/types/CreateCardSessionsResponsePurchase.d.mts +8 -0
  42. package/dist/esm/api/resources/cardSessions/types/CreateCardSessionsResponsePurchase.mjs +2 -0
  43. package/dist/esm/api/resources/cardSessions/types/GetCardSessionsResponse.d.mts +2 -0
  44. package/dist/esm/api/resources/cardSessions/types/GetCardSessionsResponsePurchase.d.mts +8 -0
  45. package/dist/esm/api/resources/cardSessions/types/GetCardSessionsResponsePurchase.mjs +2 -0
  46. package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.mts +2 -0
  47. package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemPurchase.d.mts +8 -0
  48. package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemPurchase.mjs +2 -0
  49. package/dist/esm/api/resources/cardSessions/types/index.d.mts +3 -0
  50. package/dist/esm/api/resources/cardSessions/types/index.mjs +3 -0
  51. package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsRequestPurchase.d.mts +1 -0
  52. package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsRequestPurchase.mjs +1 -0
  53. package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsResponse.d.mts +2 -0
  54. package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsResponse.mjs +2 -0
  55. package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsResponsePurchase.d.mts +12 -0
  56. package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsResponsePurchase.mjs +8 -0
  57. package/dist/esm/serialization/resources/cardSessions/types/GetCardSessionsResponse.d.mts +2 -0
  58. package/dist/esm/serialization/resources/cardSessions/types/GetCardSessionsResponse.mjs +2 -0
  59. package/dist/esm/serialization/resources/cardSessions/types/GetCardSessionsResponsePurchase.d.mts +12 -0
  60. package/dist/esm/serialization/resources/cardSessions/types/GetCardSessionsResponsePurchase.mjs +8 -0
  61. package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.mts +2 -0
  62. package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.mjs +2 -0
  63. package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemPurchase.d.mts +12 -0
  64. package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemPurchase.mjs +8 -0
  65. package/dist/esm/serialization/resources/cardSessions/types/index.d.mts +3 -0
  66. package/dist/esm/serialization/resources/cardSessions/types/index.mjs +3 -0
  67. package/dist/esm/version.d.mts +1 -1
  68. package/dist/esm/version.mjs +1 -1
  69. package/package.json +1 -1
  70. package/reference.md +2 -1
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@naturalpay/sdk",
46
- "X-Fern-SDK-Version": "1.6.50",
47
- "User-Agent": "@naturalpay/sdk/1.6.50",
46
+ "X-Fern-SDK-Version": "1.6.51",
47
+ "User-Agent": "@naturalpay/sdk/1.6.51",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  "X-Instance-ID": options === null || options === void 0 ? void 0 : options.instanceId,
@@ -69,7 +69,8 @@ export declare class CardSessionsClient {
69
69
  * purchase: {
70
70
  * merchantName: "Blue Bottle Coffee",
71
71
  * amount: 2450,
72
- * currency: "USD"
72
+ * currency: "USD",
73
+ * description: "Two bags of whole bean coffee"
73
74
  * },
74
75
  * reference: "checkout_7f3a",
75
76
  * returnUrl: "sms:+15551234567",
@@ -210,7 +210,8 @@ class CardSessionsClient {
210
210
  * purchase: {
211
211
  * merchantName: "Blue Bottle Coffee",
212
212
  * amount: 2450,
213
- * currency: "USD"
213
+ * currency: "USD",
214
+ * description: "Two bags of whole bean coffee"
214
215
  * },
215
216
  * reference: "checkout_7f3a",
216
217
  * returnUrl: "sms:+15551234567",
@@ -9,7 +9,8 @@ import type * as Natural from "../../../../index.js";
9
9
  * purchase: {
10
10
  * merchantName: "Blue Bottle Coffee",
11
11
  * amount: 2450,
12
- * currency: "USD"
12
+ * currency: "USD",
13
+ * description: "Two bags of whole bean coffee"
13
14
  * },
14
15
  * reference: "checkout_7f3a",
15
16
  * returnUrl: "sms:+15551234567",
@@ -28,12 +29,12 @@ export interface CreateCardSessionsRequest {
28
29
  ttlSeconds?: number;
29
30
  /** How long after creation you can claim the session, from 600 (10 minutes) to 86400 (24 hours). Defaults to 600. The user still has to approve within 10 minutes; a longer window only gives you more time to claim and pay after they do. Sets claimExpiresAt. */
30
31
  claimWindowSeconds?: number;
31
- /** What the agent is buying. Required for a card the user added (eac_): the user approves this exact purchase. */
32
+ /** What the agent will do with the card, shown to the user on the approval page. Required for a card the user added (eac_). The user approves what you describe here; merchantName, amount and description aren't enforced, while allowedHosts is. */
32
33
  purchase?: Natural.CreateCardSessionsRequestPurchase;
33
34
  /** Your own reference for the session, such as your checkout or task ID. Not unique: filter GET /card-sessions by it to find the session again. */
34
35
  reference?: string;
35
36
  /** Where to send the user once they approve or decline: an https page in your product, or sms:+15551234567 to reopen your Messages thread. It's added to approvalUrl as returnTo. The approval page opens https pages on its own after the user answers, and offers a button for sms: links. */
36
37
  returnUrl?: string;
37
- /** Cards the user added only, for a USD purchase of at most $999,999.99. A backup for checkouts that don't send the raw card number in the HTTP request, for example ones that encrypt it in the browser, so the proxy can't swap it in. Paying through the proxy stays the default. On approval, Natural also tries to set up agent payments on the card. Most cards don't support them yet, so agentToken.mandateId is often null: then claim this session and try the proxy. Defaults to false. */
38
+ /** Cards the user added only, for a USD purchase from $0.01 to $999,999.99. A backup for checkouts that don't send the raw card number in the HTTP request, for example ones that encrypt it in the browser, so the proxy can't swap it in. Paying through the proxy stays the default. On approval, Natural also tries to set up agent payments on the card. Most cards don't support them yet, so agentToken.mandateId is often null: then claim this session and try the proxy. Defaults to false. */
38
39
  requestAgentToken?: boolean;
39
40
  }
@@ -1,11 +1,13 @@
1
1
  /**
2
- * What the agent is buying. Required for a card the user added (eac_): the user approves this exact purchase.
2
+ * What the agent will do with the card, shown to the user on the approval page. Required for a card the user added (eac_). The user approves what you describe here; merchantName, amount and description aren't enforced, while allowedHosts is.
3
3
  */
4
4
  export interface CreateCardSessionsRequestPurchase {
5
- /** Merchant name as the user will recognize it. */
5
+ /** Merchant name as the user will recognize it. Shown to the user, not enforced: the proxy doesn't check which merchant the card goes to. */
6
6
  merchantName: string;
7
- /** Total in minor units (cents) of `currency`. */
7
+ /** Total in minor units (cents) of `currency`. Use 0 for a card action with no purchase, such as saving the card on file at the merchant. Shown to the user, not enforced as a cap. */
8
8
  amount: number;
9
9
  /** ISO 4217 currency code, e.g. USD. */
10
10
  currency: string;
11
+ /** A short plain-text line for the user saying what the agent will do or buy, such as `Save this card on file at Amazon` or `Flowers for tomorrow morning, up to $200`. The approval page shows it prominently. Shown, not enforced. */
12
+ description?: string;
11
13
  }
@@ -9,6 +9,8 @@ export interface CreateCardSessionsResponse {
9
9
  allowedHosts: string[];
10
10
  /** The reference you created the session with. Null when you didn't set one. */
11
11
  reference: string | null;
12
+ /** The purchase you created the session with, as the user saw it. Null for an agent card session opened without one. */
13
+ purchase: Natural.CreateCardSessionsResponsePurchase | null;
12
14
  /** A pending session must be approved before this, 10 minutes after creation. After it, an unapproved session is expired. */
13
15
  approvalExpiresAt: string;
14
16
  /** An approved session must be claimed before this: creation plus claimWindowSeconds. After it, an unclaimed session is expired. */
@@ -0,0 +1,8 @@
1
+ export interface CreateCardSessionsResponsePurchase {
2
+ merchantName: string;
3
+ /** Minor units (cents) of `currency`. 0 means no purchase. */
4
+ amount: number;
5
+ currency: string;
6
+ /** The description you set. Null when you didn't. */
7
+ description: string | null;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,6 +9,8 @@ export interface GetCardSessionsResponse {
9
9
  allowedHosts: string[];
10
10
  /** The reference you created the session with. Null when you didn't set one. */
11
11
  reference: string | null;
12
+ /** The purchase you created the session with, as the user saw it. Null for an agent card session opened without one. */
13
+ purchase: Natural.GetCardSessionsResponsePurchase | null;
12
14
  /** A pending session must be approved before this, 10 minutes after creation. After it, an unapproved session is expired. */
13
15
  approvalExpiresAt: string;
14
16
  /** An approved session must be claimed before this: creation plus claimWindowSeconds. After it, an unclaimed session is expired. */
@@ -0,0 +1,8 @@
1
+ export interface GetCardSessionsResponsePurchase {
2
+ merchantName: string;
3
+ /** Minor units (cents) of `currency`. 0 means no purchase. */
4
+ amount: number;
5
+ currency: string;
6
+ /** The description you set. Null when you didn't. */
7
+ description: string | null;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,6 +9,8 @@ export interface ListCardSessionsResponseDataItem {
9
9
  allowedHosts: string[];
10
10
  /** The reference you created the session with. Null when you didn't set one. */
11
11
  reference: string | null;
12
+ /** The purchase you created the session with, as the user saw it. Null for an agent card session opened without one. */
13
+ purchase: Natural.ListCardSessionsResponseDataItemPurchase | null;
12
14
  /** A pending session must be approved before this, 10 minutes after creation. After it, an unapproved session is expired. */
13
15
  approvalExpiresAt: string;
14
16
  /** An approved session must be claimed before this: creation plus claimWindowSeconds. After it, an unclaimed session is expired. */
@@ -0,0 +1,8 @@
1
+ export interface ListCardSessionsResponseDataItemPurchase {
2
+ merchantName: string;
3
+ /** Minor units (cents) of `currency`. 0 means no purchase. */
4
+ amount: number;
5
+ currency: string;
6
+ /** The description you set. Null when you didn't. */
7
+ description: string | null;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,11 +8,13 @@ export * from "./CreateCardSessionsResponse.js";
8
8
  export * from "./CreateCardSessionsResponseAgentToken.js";
9
9
  export * from "./CreateCardSessionsResponseCardSource.js";
10
10
  export * from "./CreateCardSessionsResponseNote.js";
11
+ export * from "./CreateCardSessionsResponsePurchase.js";
11
12
  export * from "./CreateCardSessionsResponseStatus.js";
12
13
  export * from "./GetCardSessionsResponse.js";
13
14
  export * from "./GetCardSessionsResponseAgentToken.js";
14
15
  export * from "./GetCardSessionsResponseCardSource.js";
15
16
  export * from "./GetCardSessionsResponseNote.js";
17
+ export * from "./GetCardSessionsResponsePurchase.js";
16
18
  export * from "./GetCardSessionsResponseStatus.js";
17
19
  export * from "./ListCardSessionsRequestStatus.js";
18
20
  export * from "./ListCardSessionsResponse.js";
@@ -20,6 +22,7 @@ export * from "./ListCardSessionsResponseDataItem.js";
20
22
  export * from "./ListCardSessionsResponseDataItemAgentToken.js";
21
23
  export * from "./ListCardSessionsResponseDataItemCardSource.js";
22
24
  export * from "./ListCardSessionsResponseDataItemNote.js";
25
+ export * from "./ListCardSessionsResponseDataItemPurchase.js";
23
26
  export * from "./ListCardSessionsResponseDataItemStatus.js";
24
27
  export * from "./ListCardSessionsResponseMeta.js";
25
28
  export * from "./ListCardSessionsResponseMetaPagination.js";
@@ -24,11 +24,13 @@ __exportStar(require("./CreateCardSessionsResponse.js"), exports);
24
24
  __exportStar(require("./CreateCardSessionsResponseAgentToken.js"), exports);
25
25
  __exportStar(require("./CreateCardSessionsResponseCardSource.js"), exports);
26
26
  __exportStar(require("./CreateCardSessionsResponseNote.js"), exports);
27
+ __exportStar(require("./CreateCardSessionsResponsePurchase.js"), exports);
27
28
  __exportStar(require("./CreateCardSessionsResponseStatus.js"), exports);
28
29
  __exportStar(require("./GetCardSessionsResponse.js"), exports);
29
30
  __exportStar(require("./GetCardSessionsResponseAgentToken.js"), exports);
30
31
  __exportStar(require("./GetCardSessionsResponseCardSource.js"), exports);
31
32
  __exportStar(require("./GetCardSessionsResponseNote.js"), exports);
33
+ __exportStar(require("./GetCardSessionsResponsePurchase.js"), exports);
32
34
  __exportStar(require("./GetCardSessionsResponseStatus.js"), exports);
33
35
  __exportStar(require("./ListCardSessionsRequestStatus.js"), exports);
34
36
  __exportStar(require("./ListCardSessionsResponse.js"), exports);
@@ -36,6 +38,7 @@ __exportStar(require("./ListCardSessionsResponseDataItem.js"), exports);
36
38
  __exportStar(require("./ListCardSessionsResponseDataItemAgentToken.js"), exports);
37
39
  __exportStar(require("./ListCardSessionsResponseDataItemCardSource.js"), exports);
38
40
  __exportStar(require("./ListCardSessionsResponseDataItemNote.js"), exports);
41
+ __exportStar(require("./ListCardSessionsResponseDataItemPurchase.js"), exports);
39
42
  __exportStar(require("./ListCardSessionsResponseDataItemStatus.js"), exports);
40
43
  __exportStar(require("./ListCardSessionsResponseMeta.js"), exports);
41
44
  __exportStar(require("./ListCardSessionsResponseMetaPagination.js"), exports);
@@ -7,5 +7,6 @@ export declare namespace CreateCardSessionsRequestPurchase {
7
7
  merchantName: string;
8
8
  amount: number;
9
9
  currency: string;
10
+ description?: string | null;
10
11
  }
11
12
  }
@@ -40,4 +40,5 @@ exports.CreateCardSessionsRequestPurchase = core.serialization.object({
40
40
  merchantName: core.serialization.string(),
41
41
  amount: core.serialization.number(),
42
42
  currency: core.serialization.string(),
43
+ description: core.serialization.string().optional(),
43
44
  });
@@ -4,6 +4,7 @@ import type * as serializers from "../../../index.js";
4
4
  import { CreateCardSessionsResponseAgentToken } from "./CreateCardSessionsResponseAgentToken.js";
5
5
  import { CreateCardSessionsResponseCardSource } from "./CreateCardSessionsResponseCardSource.js";
6
6
  import { CreateCardSessionsResponseNote } from "./CreateCardSessionsResponseNote.js";
7
+ import { CreateCardSessionsResponsePurchase } from "./CreateCardSessionsResponsePurchase.js";
7
8
  import { CreateCardSessionsResponseStatus } from "./CreateCardSessionsResponseStatus.js";
8
9
  export declare const CreateCardSessionsResponse: core.serialization.ObjectSchema<serializers.CreateCardSessionsResponse.Raw, Natural.CreateCardSessionsResponse>;
9
10
  export declare namespace CreateCardSessionsResponse {
@@ -14,6 +15,7 @@ export declare namespace CreateCardSessionsResponse {
14
15
  status: CreateCardSessionsResponseStatus.Raw;
15
16
  allowedHosts: string[];
16
17
  reference?: string | null;
18
+ purchase?: CreateCardSessionsResponsePurchase.Raw | null;
17
19
  approvalExpiresAt: string;
18
20
  claimExpiresAt: string;
19
21
  claimedAt?: string | null;
@@ -39,6 +39,7 @@ const core = __importStar(require("../../../../core/index.js"));
39
39
  const CreateCardSessionsResponseAgentToken_js_1 = require("./CreateCardSessionsResponseAgentToken.js");
40
40
  const CreateCardSessionsResponseCardSource_js_1 = require("./CreateCardSessionsResponseCardSource.js");
41
41
  const CreateCardSessionsResponseNote_js_1 = require("./CreateCardSessionsResponseNote.js");
42
+ const CreateCardSessionsResponsePurchase_js_1 = require("./CreateCardSessionsResponsePurchase.js");
42
43
  const CreateCardSessionsResponseStatus_js_1 = require("./CreateCardSessionsResponseStatus.js");
43
44
  exports.CreateCardSessionsResponse = core.serialization.object({
44
45
  sessionId: core.serialization.string(),
@@ -47,6 +48,7 @@ exports.CreateCardSessionsResponse = core.serialization.object({
47
48
  status: CreateCardSessionsResponseStatus_js_1.CreateCardSessionsResponseStatus,
48
49
  allowedHosts: core.serialization.list(core.serialization.string()),
49
50
  reference: core.serialization.string().nullable(),
51
+ purchase: CreateCardSessionsResponsePurchase_js_1.CreateCardSessionsResponsePurchase.nullable(),
50
52
  approvalExpiresAt: core.serialization.string(),
51
53
  claimExpiresAt: core.serialization.string(),
52
54
  claimedAt: core.serialization.string().nullable(),
@@ -0,0 +1,12 @@
1
+ import type * as Natural from "../../../../api/index.js";
2
+ import * as core from "../../../../core/index.js";
3
+ import type * as serializers from "../../../index.js";
4
+ export declare const CreateCardSessionsResponsePurchase: core.serialization.ObjectSchema<serializers.CreateCardSessionsResponsePurchase.Raw, Natural.CreateCardSessionsResponsePurchase>;
5
+ export declare namespace CreateCardSessionsResponsePurchase {
6
+ interface Raw {
7
+ merchantName: string;
8
+ amount: number;
9
+ currency: string;
10
+ description?: string | null;
11
+ }
12
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.CreateCardSessionsResponsePurchase = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.CreateCardSessionsResponsePurchase = core.serialization.object({
40
+ merchantName: core.serialization.string(),
41
+ amount: core.serialization.number(),
42
+ currency: core.serialization.string(),
43
+ description: core.serialization.string().nullable(),
44
+ });
@@ -4,6 +4,7 @@ import type * as serializers from "../../../index.js";
4
4
  import { GetCardSessionsResponseAgentToken } from "./GetCardSessionsResponseAgentToken.js";
5
5
  import { GetCardSessionsResponseCardSource } from "./GetCardSessionsResponseCardSource.js";
6
6
  import { GetCardSessionsResponseNote } from "./GetCardSessionsResponseNote.js";
7
+ import { GetCardSessionsResponsePurchase } from "./GetCardSessionsResponsePurchase.js";
7
8
  import { GetCardSessionsResponseStatus } from "./GetCardSessionsResponseStatus.js";
8
9
  export declare const GetCardSessionsResponse: core.serialization.ObjectSchema<serializers.GetCardSessionsResponse.Raw, Natural.GetCardSessionsResponse>;
9
10
  export declare namespace GetCardSessionsResponse {
@@ -14,6 +15,7 @@ export declare namespace GetCardSessionsResponse {
14
15
  status: GetCardSessionsResponseStatus.Raw;
15
16
  allowedHosts: string[];
16
17
  reference?: string | null;
18
+ purchase?: GetCardSessionsResponsePurchase.Raw | null;
17
19
  approvalExpiresAt: string;
18
20
  claimExpiresAt: string;
19
21
  claimedAt?: string | null;
@@ -39,6 +39,7 @@ const core = __importStar(require("../../../../core/index.js"));
39
39
  const GetCardSessionsResponseAgentToken_js_1 = require("./GetCardSessionsResponseAgentToken.js");
40
40
  const GetCardSessionsResponseCardSource_js_1 = require("./GetCardSessionsResponseCardSource.js");
41
41
  const GetCardSessionsResponseNote_js_1 = require("./GetCardSessionsResponseNote.js");
42
+ const GetCardSessionsResponsePurchase_js_1 = require("./GetCardSessionsResponsePurchase.js");
42
43
  const GetCardSessionsResponseStatus_js_1 = require("./GetCardSessionsResponseStatus.js");
43
44
  exports.GetCardSessionsResponse = core.serialization.object({
44
45
  sessionId: core.serialization.string(),
@@ -47,6 +48,7 @@ exports.GetCardSessionsResponse = core.serialization.object({
47
48
  status: GetCardSessionsResponseStatus_js_1.GetCardSessionsResponseStatus,
48
49
  allowedHosts: core.serialization.list(core.serialization.string()),
49
50
  reference: core.serialization.string().nullable(),
51
+ purchase: GetCardSessionsResponsePurchase_js_1.GetCardSessionsResponsePurchase.nullable(),
50
52
  approvalExpiresAt: core.serialization.string(),
51
53
  claimExpiresAt: core.serialization.string(),
52
54
  claimedAt: core.serialization.string().nullable(),
@@ -0,0 +1,12 @@
1
+ import type * as Natural from "../../../../api/index.js";
2
+ import * as core from "../../../../core/index.js";
3
+ import type * as serializers from "../../../index.js";
4
+ export declare const GetCardSessionsResponsePurchase: core.serialization.ObjectSchema<serializers.GetCardSessionsResponsePurchase.Raw, Natural.GetCardSessionsResponsePurchase>;
5
+ export declare namespace GetCardSessionsResponsePurchase {
6
+ interface Raw {
7
+ merchantName: string;
8
+ amount: number;
9
+ currency: string;
10
+ description?: string | null;
11
+ }
12
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.GetCardSessionsResponsePurchase = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.GetCardSessionsResponsePurchase = core.serialization.object({
40
+ merchantName: core.serialization.string(),
41
+ amount: core.serialization.number(),
42
+ currency: core.serialization.string(),
43
+ description: core.serialization.string().nullable(),
44
+ });
@@ -4,6 +4,7 @@ import type * as serializers from "../../../index.js";
4
4
  import { ListCardSessionsResponseDataItemAgentToken } from "./ListCardSessionsResponseDataItemAgentToken.js";
5
5
  import { ListCardSessionsResponseDataItemCardSource } from "./ListCardSessionsResponseDataItemCardSource.js";
6
6
  import { ListCardSessionsResponseDataItemNote } from "./ListCardSessionsResponseDataItemNote.js";
7
+ import { ListCardSessionsResponseDataItemPurchase } from "./ListCardSessionsResponseDataItemPurchase.js";
7
8
  import { ListCardSessionsResponseDataItemStatus } from "./ListCardSessionsResponseDataItemStatus.js";
8
9
  export declare const ListCardSessionsResponseDataItem: core.serialization.ObjectSchema<serializers.ListCardSessionsResponseDataItem.Raw, Natural.ListCardSessionsResponseDataItem>;
9
10
  export declare namespace ListCardSessionsResponseDataItem {
@@ -14,6 +15,7 @@ export declare namespace ListCardSessionsResponseDataItem {
14
15
  status: ListCardSessionsResponseDataItemStatus.Raw;
15
16
  allowedHosts: string[];
16
17
  reference?: string | null;
18
+ purchase?: ListCardSessionsResponseDataItemPurchase.Raw | null;
17
19
  approvalExpiresAt: string;
18
20
  claimExpiresAt: string;
19
21
  claimedAt?: string | null;
@@ -39,6 +39,7 @@ const core = __importStar(require("../../../../core/index.js"));
39
39
  const ListCardSessionsResponseDataItemAgentToken_js_1 = require("./ListCardSessionsResponseDataItemAgentToken.js");
40
40
  const ListCardSessionsResponseDataItemCardSource_js_1 = require("./ListCardSessionsResponseDataItemCardSource.js");
41
41
  const ListCardSessionsResponseDataItemNote_js_1 = require("./ListCardSessionsResponseDataItemNote.js");
42
+ const ListCardSessionsResponseDataItemPurchase_js_1 = require("./ListCardSessionsResponseDataItemPurchase.js");
42
43
  const ListCardSessionsResponseDataItemStatus_js_1 = require("./ListCardSessionsResponseDataItemStatus.js");
43
44
  exports.ListCardSessionsResponseDataItem = core.serialization.object({
44
45
  sessionId: core.serialization.string(),
@@ -47,6 +48,7 @@ exports.ListCardSessionsResponseDataItem = core.serialization.object({
47
48
  status: ListCardSessionsResponseDataItemStatus_js_1.ListCardSessionsResponseDataItemStatus,
48
49
  allowedHosts: core.serialization.list(core.serialization.string()),
49
50
  reference: core.serialization.string().nullable(),
51
+ purchase: ListCardSessionsResponseDataItemPurchase_js_1.ListCardSessionsResponseDataItemPurchase.nullable(),
50
52
  approvalExpiresAt: core.serialization.string(),
51
53
  claimExpiresAt: core.serialization.string(),
52
54
  claimedAt: core.serialization.string().nullable(),
@@ -0,0 +1,12 @@
1
+ import type * as Natural from "../../../../api/index.js";
2
+ import * as core from "../../../../core/index.js";
3
+ import type * as serializers from "../../../index.js";
4
+ export declare const ListCardSessionsResponseDataItemPurchase: core.serialization.ObjectSchema<serializers.ListCardSessionsResponseDataItemPurchase.Raw, Natural.ListCardSessionsResponseDataItemPurchase>;
5
+ export declare namespace ListCardSessionsResponseDataItemPurchase {
6
+ interface Raw {
7
+ merchantName: string;
8
+ amount: number;
9
+ currency: string;
10
+ description?: string | null;
11
+ }
12
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.ListCardSessionsResponseDataItemPurchase = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.ListCardSessionsResponseDataItemPurchase = core.serialization.object({
40
+ merchantName: core.serialization.string(),
41
+ amount: core.serialization.number(),
42
+ currency: core.serialization.string(),
43
+ description: core.serialization.string().nullable(),
44
+ });
@@ -8,11 +8,13 @@ export * from "./CreateCardSessionsResponse.js";
8
8
  export * from "./CreateCardSessionsResponseAgentToken.js";
9
9
  export * from "./CreateCardSessionsResponseCardSource.js";
10
10
  export * from "./CreateCardSessionsResponseNote.js";
11
+ export * from "./CreateCardSessionsResponsePurchase.js";
11
12
  export * from "./CreateCardSessionsResponseStatus.js";
12
13
  export * from "./GetCardSessionsResponse.js";
13
14
  export * from "./GetCardSessionsResponseAgentToken.js";
14
15
  export * from "./GetCardSessionsResponseCardSource.js";
15
16
  export * from "./GetCardSessionsResponseNote.js";
17
+ export * from "./GetCardSessionsResponsePurchase.js";
16
18
  export * from "./GetCardSessionsResponseStatus.js";
17
19
  export * from "./ListCardSessionsRequestStatus.js";
18
20
  export * from "./ListCardSessionsResponse.js";
@@ -20,6 +22,7 @@ export * from "./ListCardSessionsResponseDataItem.js";
20
22
  export * from "./ListCardSessionsResponseDataItemAgentToken.js";
21
23
  export * from "./ListCardSessionsResponseDataItemCardSource.js";
22
24
  export * from "./ListCardSessionsResponseDataItemNote.js";
25
+ export * from "./ListCardSessionsResponseDataItemPurchase.js";
23
26
  export * from "./ListCardSessionsResponseDataItemStatus.js";
24
27
  export * from "./ListCardSessionsResponseMeta.js";
25
28
  export * from "./ListCardSessionsResponseMetaPagination.js";
@@ -24,11 +24,13 @@ __exportStar(require("./CreateCardSessionsResponse.js"), exports);
24
24
  __exportStar(require("./CreateCardSessionsResponseAgentToken.js"), exports);
25
25
  __exportStar(require("./CreateCardSessionsResponseCardSource.js"), exports);
26
26
  __exportStar(require("./CreateCardSessionsResponseNote.js"), exports);
27
+ __exportStar(require("./CreateCardSessionsResponsePurchase.js"), exports);
27
28
  __exportStar(require("./CreateCardSessionsResponseStatus.js"), exports);
28
29
  __exportStar(require("./GetCardSessionsResponse.js"), exports);
29
30
  __exportStar(require("./GetCardSessionsResponseAgentToken.js"), exports);
30
31
  __exportStar(require("./GetCardSessionsResponseCardSource.js"), exports);
31
32
  __exportStar(require("./GetCardSessionsResponseNote.js"), exports);
33
+ __exportStar(require("./GetCardSessionsResponsePurchase.js"), exports);
32
34
  __exportStar(require("./GetCardSessionsResponseStatus.js"), exports);
33
35
  __exportStar(require("./ListCardSessionsRequestStatus.js"), exports);
34
36
  __exportStar(require("./ListCardSessionsResponse.js"), exports);
@@ -36,6 +38,7 @@ __exportStar(require("./ListCardSessionsResponseDataItem.js"), exports);
36
38
  __exportStar(require("./ListCardSessionsResponseDataItemAgentToken.js"), exports);
37
39
  __exportStar(require("./ListCardSessionsResponseDataItemCardSource.js"), exports);
38
40
  __exportStar(require("./ListCardSessionsResponseDataItemNote.js"), exports);
41
+ __exportStar(require("./ListCardSessionsResponseDataItemPurchase.js"), exports);
39
42
  __exportStar(require("./ListCardSessionsResponseDataItemStatus.js"), exports);
40
43
  __exportStar(require("./ListCardSessionsResponseMeta.js"), exports);
41
44
  __exportStar(require("./ListCardSessionsResponseMetaPagination.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.6.50";
1
+ export declare const SDK_VERSION = "1.6.51";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.6.50";
4
+ exports.SDK_VERSION = "1.6.51";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@naturalpay/sdk",
9
- "X-Fern-SDK-Version": "1.6.50",
10
- "User-Agent": "@naturalpay/sdk/1.6.50",
9
+ "X-Fern-SDK-Version": "1.6.51",
10
+ "User-Agent": "@naturalpay/sdk/1.6.51",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  "X-Instance-ID": options === null || options === void 0 ? void 0 : options.instanceId,
@@ -69,7 +69,8 @@ export declare class CardSessionsClient {
69
69
  * purchase: {
70
70
  * merchantName: "Blue Bottle Coffee",
71
71
  * amount: 2450,
72
- * currency: "USD"
72
+ * currency: "USD",
73
+ * description: "Two bags of whole bean coffee"
73
74
  * },
74
75
  * reference: "checkout_7f3a",
75
76
  * returnUrl: "sms:+15551234567",
@@ -174,7 +174,8 @@ export class CardSessionsClient {
174
174
  * purchase: {
175
175
  * merchantName: "Blue Bottle Coffee",
176
176
  * amount: 2450,
177
- * currency: "USD"
177
+ * currency: "USD",
178
+ * description: "Two bags of whole bean coffee"
178
179
  * },
179
180
  * reference: "checkout_7f3a",
180
181
  * returnUrl: "sms:+15551234567",
@@ -9,7 +9,8 @@ import type * as Natural from "../../../../index.mjs";
9
9
  * purchase: {
10
10
  * merchantName: "Blue Bottle Coffee",
11
11
  * amount: 2450,
12
- * currency: "USD"
12
+ * currency: "USD",
13
+ * description: "Two bags of whole bean coffee"
13
14
  * },
14
15
  * reference: "checkout_7f3a",
15
16
  * returnUrl: "sms:+15551234567",
@@ -28,12 +29,12 @@ export interface CreateCardSessionsRequest {
28
29
  ttlSeconds?: number;
29
30
  /** How long after creation you can claim the session, from 600 (10 minutes) to 86400 (24 hours). Defaults to 600. The user still has to approve within 10 minutes; a longer window only gives you more time to claim and pay after they do. Sets claimExpiresAt. */
30
31
  claimWindowSeconds?: number;
31
- /** What the agent is buying. Required for a card the user added (eac_): the user approves this exact purchase. */
32
+ /** What the agent will do with the card, shown to the user on the approval page. Required for a card the user added (eac_). The user approves what you describe here; merchantName, amount and description aren't enforced, while allowedHosts is. */
32
33
  purchase?: Natural.CreateCardSessionsRequestPurchase;
33
34
  /** Your own reference for the session, such as your checkout or task ID. Not unique: filter GET /card-sessions by it to find the session again. */
34
35
  reference?: string;
35
36
  /** Where to send the user once they approve or decline: an https page in your product, or sms:+15551234567 to reopen your Messages thread. It's added to approvalUrl as returnTo. The approval page opens https pages on its own after the user answers, and offers a button for sms: links. */
36
37
  returnUrl?: string;
37
- /** Cards the user added only, for a USD purchase of at most $999,999.99. A backup for checkouts that don't send the raw card number in the HTTP request, for example ones that encrypt it in the browser, so the proxy can't swap it in. Paying through the proxy stays the default. On approval, Natural also tries to set up agent payments on the card. Most cards don't support them yet, so agentToken.mandateId is often null: then claim this session and try the proxy. Defaults to false. */
38
+ /** Cards the user added only, for a USD purchase from $0.01 to $999,999.99. A backup for checkouts that don't send the raw card number in the HTTP request, for example ones that encrypt it in the browser, so the proxy can't swap it in. Paying through the proxy stays the default. On approval, Natural also tries to set up agent payments on the card. Most cards don't support them yet, so agentToken.mandateId is often null: then claim this session and try the proxy. Defaults to false. */
38
39
  requestAgentToken?: boolean;
39
40
  }
@@ -1,11 +1,13 @@
1
1
  /**
2
- * What the agent is buying. Required for a card the user added (eac_): the user approves this exact purchase.
2
+ * What the agent will do with the card, shown to the user on the approval page. Required for a card the user added (eac_). The user approves what you describe here; merchantName, amount and description aren't enforced, while allowedHosts is.
3
3
  */
4
4
  export interface CreateCardSessionsRequestPurchase {
5
- /** Merchant name as the user will recognize it. */
5
+ /** Merchant name as the user will recognize it. Shown to the user, not enforced: the proxy doesn't check which merchant the card goes to. */
6
6
  merchantName: string;
7
- /** Total in minor units (cents) of `currency`. */
7
+ /** Total in minor units (cents) of `currency`. Use 0 for a card action with no purchase, such as saving the card on file at the merchant. Shown to the user, not enforced as a cap. */
8
8
  amount: number;
9
9
  /** ISO 4217 currency code, e.g. USD. */
10
10
  currency: string;
11
+ /** A short plain-text line for the user saying what the agent will do or buy, such as `Save this card on file at Amazon` or `Flowers for tomorrow morning, up to $200`. The approval page shows it prominently. Shown, not enforced. */
12
+ description?: string;
11
13
  }
@@ -9,6 +9,8 @@ export interface CreateCardSessionsResponse {
9
9
  allowedHosts: string[];
10
10
  /** The reference you created the session with. Null when you didn't set one. */
11
11
  reference: string | null;
12
+ /** The purchase you created the session with, as the user saw it. Null for an agent card session opened without one. */
13
+ purchase: Natural.CreateCardSessionsResponsePurchase | null;
12
14
  /** A pending session must be approved before this, 10 minutes after creation. After it, an unapproved session is expired. */
13
15
  approvalExpiresAt: string;
14
16
  /** An approved session must be claimed before this: creation plus claimWindowSeconds. After it, an unclaimed session is expired. */
@@ -0,0 +1,8 @@
1
+ export interface CreateCardSessionsResponsePurchase {
2
+ merchantName: string;
3
+ /** Minor units (cents) of `currency`. 0 means no purchase. */
4
+ amount: number;
5
+ currency: string;
6
+ /** The description you set. Null when you didn't. */
7
+ description: string | null;
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -9,6 +9,8 @@ export interface GetCardSessionsResponse {
9
9
  allowedHosts: string[];
10
10
  /** The reference you created the session with. Null when you didn't set one. */
11
11
  reference: string | null;
12
+ /** The purchase you created the session with, as the user saw it. Null for an agent card session opened without one. */
13
+ purchase: Natural.GetCardSessionsResponsePurchase | null;
12
14
  /** A pending session must be approved before this, 10 minutes after creation. After it, an unapproved session is expired. */
13
15
  approvalExpiresAt: string;
14
16
  /** An approved session must be claimed before this: creation plus claimWindowSeconds. After it, an unclaimed session is expired. */
@@ -0,0 +1,8 @@
1
+ export interface GetCardSessionsResponsePurchase {
2
+ merchantName: string;
3
+ /** Minor units (cents) of `currency`. 0 means no purchase. */
4
+ amount: number;
5
+ currency: string;
6
+ /** The description you set. Null when you didn't. */
7
+ description: string | null;
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -9,6 +9,8 @@ export interface ListCardSessionsResponseDataItem {
9
9
  allowedHosts: string[];
10
10
  /** The reference you created the session with. Null when you didn't set one. */
11
11
  reference: string | null;
12
+ /** The purchase you created the session with, as the user saw it. Null for an agent card session opened without one. */
13
+ purchase: Natural.ListCardSessionsResponseDataItemPurchase | null;
12
14
  /** A pending session must be approved before this, 10 minutes after creation. After it, an unapproved session is expired. */
13
15
  approvalExpiresAt: string;
14
16
  /** An approved session must be claimed before this: creation plus claimWindowSeconds. After it, an unclaimed session is expired. */
@@ -0,0 +1,8 @@
1
+ export interface ListCardSessionsResponseDataItemPurchase {
2
+ merchantName: string;
3
+ /** Minor units (cents) of `currency`. 0 means no purchase. */
4
+ amount: number;
5
+ currency: string;
6
+ /** The description you set. Null when you didn't. */
7
+ description: string | null;
8
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -8,11 +8,13 @@ export * from "./CreateCardSessionsResponse.mjs";
8
8
  export * from "./CreateCardSessionsResponseAgentToken.mjs";
9
9
  export * from "./CreateCardSessionsResponseCardSource.mjs";
10
10
  export * from "./CreateCardSessionsResponseNote.mjs";
11
+ export * from "./CreateCardSessionsResponsePurchase.mjs";
11
12
  export * from "./CreateCardSessionsResponseStatus.mjs";
12
13
  export * from "./GetCardSessionsResponse.mjs";
13
14
  export * from "./GetCardSessionsResponseAgentToken.mjs";
14
15
  export * from "./GetCardSessionsResponseCardSource.mjs";
15
16
  export * from "./GetCardSessionsResponseNote.mjs";
17
+ export * from "./GetCardSessionsResponsePurchase.mjs";
16
18
  export * from "./GetCardSessionsResponseStatus.mjs";
17
19
  export * from "./ListCardSessionsRequestStatus.mjs";
18
20
  export * from "./ListCardSessionsResponse.mjs";
@@ -20,6 +22,7 @@ export * from "./ListCardSessionsResponseDataItem.mjs";
20
22
  export * from "./ListCardSessionsResponseDataItemAgentToken.mjs";
21
23
  export * from "./ListCardSessionsResponseDataItemCardSource.mjs";
22
24
  export * from "./ListCardSessionsResponseDataItemNote.mjs";
25
+ export * from "./ListCardSessionsResponseDataItemPurchase.mjs";
23
26
  export * from "./ListCardSessionsResponseDataItemStatus.mjs";
24
27
  export * from "./ListCardSessionsResponseMeta.mjs";
25
28
  export * from "./ListCardSessionsResponseMetaPagination.mjs";
@@ -8,11 +8,13 @@ export * from "./CreateCardSessionsResponse.mjs";
8
8
  export * from "./CreateCardSessionsResponseAgentToken.mjs";
9
9
  export * from "./CreateCardSessionsResponseCardSource.mjs";
10
10
  export * from "./CreateCardSessionsResponseNote.mjs";
11
+ export * from "./CreateCardSessionsResponsePurchase.mjs";
11
12
  export * from "./CreateCardSessionsResponseStatus.mjs";
12
13
  export * from "./GetCardSessionsResponse.mjs";
13
14
  export * from "./GetCardSessionsResponseAgentToken.mjs";
14
15
  export * from "./GetCardSessionsResponseCardSource.mjs";
15
16
  export * from "./GetCardSessionsResponseNote.mjs";
17
+ export * from "./GetCardSessionsResponsePurchase.mjs";
16
18
  export * from "./GetCardSessionsResponseStatus.mjs";
17
19
  export * from "./ListCardSessionsRequestStatus.mjs";
18
20
  export * from "./ListCardSessionsResponse.mjs";
@@ -20,6 +22,7 @@ export * from "./ListCardSessionsResponseDataItem.mjs";
20
22
  export * from "./ListCardSessionsResponseDataItemAgentToken.mjs";
21
23
  export * from "./ListCardSessionsResponseDataItemCardSource.mjs";
22
24
  export * from "./ListCardSessionsResponseDataItemNote.mjs";
25
+ export * from "./ListCardSessionsResponseDataItemPurchase.mjs";
23
26
  export * from "./ListCardSessionsResponseDataItemStatus.mjs";
24
27
  export * from "./ListCardSessionsResponseMeta.mjs";
25
28
  export * from "./ListCardSessionsResponseMetaPagination.mjs";
@@ -7,5 +7,6 @@ export declare namespace CreateCardSessionsRequestPurchase {
7
7
  merchantName: string;
8
8
  amount: number;
9
9
  currency: string;
10
+ description?: string | null;
10
11
  }
11
12
  }
@@ -4,4 +4,5 @@ export const CreateCardSessionsRequestPurchase = core.serialization.object({
4
4
  merchantName: core.serialization.string(),
5
5
  amount: core.serialization.number(),
6
6
  currency: core.serialization.string(),
7
+ description: core.serialization.string().optional(),
7
8
  });
@@ -4,6 +4,7 @@ import type * as serializers from "../../../index.mjs";
4
4
  import { CreateCardSessionsResponseAgentToken } from "./CreateCardSessionsResponseAgentToken.mjs";
5
5
  import { CreateCardSessionsResponseCardSource } from "./CreateCardSessionsResponseCardSource.mjs";
6
6
  import { CreateCardSessionsResponseNote } from "./CreateCardSessionsResponseNote.mjs";
7
+ import { CreateCardSessionsResponsePurchase } from "./CreateCardSessionsResponsePurchase.mjs";
7
8
  import { CreateCardSessionsResponseStatus } from "./CreateCardSessionsResponseStatus.mjs";
8
9
  export declare const CreateCardSessionsResponse: core.serialization.ObjectSchema<serializers.CreateCardSessionsResponse.Raw, Natural.CreateCardSessionsResponse>;
9
10
  export declare namespace CreateCardSessionsResponse {
@@ -14,6 +15,7 @@ export declare namespace CreateCardSessionsResponse {
14
15
  status: CreateCardSessionsResponseStatus.Raw;
15
16
  allowedHosts: string[];
16
17
  reference?: string | null;
18
+ purchase?: CreateCardSessionsResponsePurchase.Raw | null;
17
19
  approvalExpiresAt: string;
18
20
  claimExpiresAt: string;
19
21
  claimedAt?: string | null;
@@ -3,6 +3,7 @@ import * as core from "../../../../core/index.mjs";
3
3
  import { CreateCardSessionsResponseAgentToken } from "./CreateCardSessionsResponseAgentToken.mjs";
4
4
  import { CreateCardSessionsResponseCardSource } from "./CreateCardSessionsResponseCardSource.mjs";
5
5
  import { CreateCardSessionsResponseNote } from "./CreateCardSessionsResponseNote.mjs";
6
+ import { CreateCardSessionsResponsePurchase } from "./CreateCardSessionsResponsePurchase.mjs";
6
7
  import { CreateCardSessionsResponseStatus } from "./CreateCardSessionsResponseStatus.mjs";
7
8
  export const CreateCardSessionsResponse = core.serialization.object({
8
9
  sessionId: core.serialization.string(),
@@ -11,6 +12,7 @@ export const CreateCardSessionsResponse = core.serialization.object({
11
12
  status: CreateCardSessionsResponseStatus,
12
13
  allowedHosts: core.serialization.list(core.serialization.string()),
13
14
  reference: core.serialization.string().nullable(),
15
+ purchase: CreateCardSessionsResponsePurchase.nullable(),
14
16
  approvalExpiresAt: core.serialization.string(),
15
17
  claimExpiresAt: core.serialization.string(),
16
18
  claimedAt: core.serialization.string().nullable(),
@@ -0,0 +1,12 @@
1
+ import type * as Natural from "../../../../api/index.mjs";
2
+ import * as core from "../../../../core/index.mjs";
3
+ import type * as serializers from "../../../index.mjs";
4
+ export declare const CreateCardSessionsResponsePurchase: core.serialization.ObjectSchema<serializers.CreateCardSessionsResponsePurchase.Raw, Natural.CreateCardSessionsResponsePurchase>;
5
+ export declare namespace CreateCardSessionsResponsePurchase {
6
+ interface Raw {
7
+ merchantName: string;
8
+ amount: number;
9
+ currency: string;
10
+ description?: string | null;
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../../../core/index.mjs";
3
+ export const CreateCardSessionsResponsePurchase = core.serialization.object({
4
+ merchantName: core.serialization.string(),
5
+ amount: core.serialization.number(),
6
+ currency: core.serialization.string(),
7
+ description: core.serialization.string().nullable(),
8
+ });
@@ -4,6 +4,7 @@ import type * as serializers from "../../../index.mjs";
4
4
  import { GetCardSessionsResponseAgentToken } from "./GetCardSessionsResponseAgentToken.mjs";
5
5
  import { GetCardSessionsResponseCardSource } from "./GetCardSessionsResponseCardSource.mjs";
6
6
  import { GetCardSessionsResponseNote } from "./GetCardSessionsResponseNote.mjs";
7
+ import { GetCardSessionsResponsePurchase } from "./GetCardSessionsResponsePurchase.mjs";
7
8
  import { GetCardSessionsResponseStatus } from "./GetCardSessionsResponseStatus.mjs";
8
9
  export declare const GetCardSessionsResponse: core.serialization.ObjectSchema<serializers.GetCardSessionsResponse.Raw, Natural.GetCardSessionsResponse>;
9
10
  export declare namespace GetCardSessionsResponse {
@@ -14,6 +15,7 @@ export declare namespace GetCardSessionsResponse {
14
15
  status: GetCardSessionsResponseStatus.Raw;
15
16
  allowedHosts: string[];
16
17
  reference?: string | null;
18
+ purchase?: GetCardSessionsResponsePurchase.Raw | null;
17
19
  approvalExpiresAt: string;
18
20
  claimExpiresAt: string;
19
21
  claimedAt?: string | null;
@@ -3,6 +3,7 @@ import * as core from "../../../../core/index.mjs";
3
3
  import { GetCardSessionsResponseAgentToken } from "./GetCardSessionsResponseAgentToken.mjs";
4
4
  import { GetCardSessionsResponseCardSource } from "./GetCardSessionsResponseCardSource.mjs";
5
5
  import { GetCardSessionsResponseNote } from "./GetCardSessionsResponseNote.mjs";
6
+ import { GetCardSessionsResponsePurchase } from "./GetCardSessionsResponsePurchase.mjs";
6
7
  import { GetCardSessionsResponseStatus } from "./GetCardSessionsResponseStatus.mjs";
7
8
  export const GetCardSessionsResponse = core.serialization.object({
8
9
  sessionId: core.serialization.string(),
@@ -11,6 +12,7 @@ export const GetCardSessionsResponse = core.serialization.object({
11
12
  status: GetCardSessionsResponseStatus,
12
13
  allowedHosts: core.serialization.list(core.serialization.string()),
13
14
  reference: core.serialization.string().nullable(),
15
+ purchase: GetCardSessionsResponsePurchase.nullable(),
14
16
  approvalExpiresAt: core.serialization.string(),
15
17
  claimExpiresAt: core.serialization.string(),
16
18
  claimedAt: core.serialization.string().nullable(),
@@ -0,0 +1,12 @@
1
+ import type * as Natural from "../../../../api/index.mjs";
2
+ import * as core from "../../../../core/index.mjs";
3
+ import type * as serializers from "../../../index.mjs";
4
+ export declare const GetCardSessionsResponsePurchase: core.serialization.ObjectSchema<serializers.GetCardSessionsResponsePurchase.Raw, Natural.GetCardSessionsResponsePurchase>;
5
+ export declare namespace GetCardSessionsResponsePurchase {
6
+ interface Raw {
7
+ merchantName: string;
8
+ amount: number;
9
+ currency: string;
10
+ description?: string | null;
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../../../core/index.mjs";
3
+ export const GetCardSessionsResponsePurchase = core.serialization.object({
4
+ merchantName: core.serialization.string(),
5
+ amount: core.serialization.number(),
6
+ currency: core.serialization.string(),
7
+ description: core.serialization.string().nullable(),
8
+ });
@@ -4,6 +4,7 @@ import type * as serializers from "../../../index.mjs";
4
4
  import { ListCardSessionsResponseDataItemAgentToken } from "./ListCardSessionsResponseDataItemAgentToken.mjs";
5
5
  import { ListCardSessionsResponseDataItemCardSource } from "./ListCardSessionsResponseDataItemCardSource.mjs";
6
6
  import { ListCardSessionsResponseDataItemNote } from "./ListCardSessionsResponseDataItemNote.mjs";
7
+ import { ListCardSessionsResponseDataItemPurchase } from "./ListCardSessionsResponseDataItemPurchase.mjs";
7
8
  import { ListCardSessionsResponseDataItemStatus } from "./ListCardSessionsResponseDataItemStatus.mjs";
8
9
  export declare const ListCardSessionsResponseDataItem: core.serialization.ObjectSchema<serializers.ListCardSessionsResponseDataItem.Raw, Natural.ListCardSessionsResponseDataItem>;
9
10
  export declare namespace ListCardSessionsResponseDataItem {
@@ -14,6 +15,7 @@ export declare namespace ListCardSessionsResponseDataItem {
14
15
  status: ListCardSessionsResponseDataItemStatus.Raw;
15
16
  allowedHosts: string[];
16
17
  reference?: string | null;
18
+ purchase?: ListCardSessionsResponseDataItemPurchase.Raw | null;
17
19
  approvalExpiresAt: string;
18
20
  claimExpiresAt: string;
19
21
  claimedAt?: string | null;
@@ -3,6 +3,7 @@ import * as core from "../../../../core/index.mjs";
3
3
  import { ListCardSessionsResponseDataItemAgentToken } from "./ListCardSessionsResponseDataItemAgentToken.mjs";
4
4
  import { ListCardSessionsResponseDataItemCardSource } from "./ListCardSessionsResponseDataItemCardSource.mjs";
5
5
  import { ListCardSessionsResponseDataItemNote } from "./ListCardSessionsResponseDataItemNote.mjs";
6
+ import { ListCardSessionsResponseDataItemPurchase } from "./ListCardSessionsResponseDataItemPurchase.mjs";
6
7
  import { ListCardSessionsResponseDataItemStatus } from "./ListCardSessionsResponseDataItemStatus.mjs";
7
8
  export const ListCardSessionsResponseDataItem = core.serialization.object({
8
9
  sessionId: core.serialization.string(),
@@ -11,6 +12,7 @@ export const ListCardSessionsResponseDataItem = core.serialization.object({
11
12
  status: ListCardSessionsResponseDataItemStatus,
12
13
  allowedHosts: core.serialization.list(core.serialization.string()),
13
14
  reference: core.serialization.string().nullable(),
15
+ purchase: ListCardSessionsResponseDataItemPurchase.nullable(),
14
16
  approvalExpiresAt: core.serialization.string(),
15
17
  claimExpiresAt: core.serialization.string(),
16
18
  claimedAt: core.serialization.string().nullable(),
@@ -0,0 +1,12 @@
1
+ import type * as Natural from "../../../../api/index.mjs";
2
+ import * as core from "../../../../core/index.mjs";
3
+ import type * as serializers from "../../../index.mjs";
4
+ export declare const ListCardSessionsResponseDataItemPurchase: core.serialization.ObjectSchema<serializers.ListCardSessionsResponseDataItemPurchase.Raw, Natural.ListCardSessionsResponseDataItemPurchase>;
5
+ export declare namespace ListCardSessionsResponseDataItemPurchase {
6
+ interface Raw {
7
+ merchantName: string;
8
+ amount: number;
9
+ currency: string;
10
+ description?: string | null;
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ import * as core from "../../../../core/index.mjs";
3
+ export const ListCardSessionsResponseDataItemPurchase = core.serialization.object({
4
+ merchantName: core.serialization.string(),
5
+ amount: core.serialization.number(),
6
+ currency: core.serialization.string(),
7
+ description: core.serialization.string().nullable(),
8
+ });
@@ -8,11 +8,13 @@ export * from "./CreateCardSessionsResponse.mjs";
8
8
  export * from "./CreateCardSessionsResponseAgentToken.mjs";
9
9
  export * from "./CreateCardSessionsResponseCardSource.mjs";
10
10
  export * from "./CreateCardSessionsResponseNote.mjs";
11
+ export * from "./CreateCardSessionsResponsePurchase.mjs";
11
12
  export * from "./CreateCardSessionsResponseStatus.mjs";
12
13
  export * from "./GetCardSessionsResponse.mjs";
13
14
  export * from "./GetCardSessionsResponseAgentToken.mjs";
14
15
  export * from "./GetCardSessionsResponseCardSource.mjs";
15
16
  export * from "./GetCardSessionsResponseNote.mjs";
17
+ export * from "./GetCardSessionsResponsePurchase.mjs";
16
18
  export * from "./GetCardSessionsResponseStatus.mjs";
17
19
  export * from "./ListCardSessionsRequestStatus.mjs";
18
20
  export * from "./ListCardSessionsResponse.mjs";
@@ -20,6 +22,7 @@ export * from "./ListCardSessionsResponseDataItem.mjs";
20
22
  export * from "./ListCardSessionsResponseDataItemAgentToken.mjs";
21
23
  export * from "./ListCardSessionsResponseDataItemCardSource.mjs";
22
24
  export * from "./ListCardSessionsResponseDataItemNote.mjs";
25
+ export * from "./ListCardSessionsResponseDataItemPurchase.mjs";
23
26
  export * from "./ListCardSessionsResponseDataItemStatus.mjs";
24
27
  export * from "./ListCardSessionsResponseMeta.mjs";
25
28
  export * from "./ListCardSessionsResponseMetaPagination.mjs";
@@ -8,11 +8,13 @@ export * from "./CreateCardSessionsResponse.mjs";
8
8
  export * from "./CreateCardSessionsResponseAgentToken.mjs";
9
9
  export * from "./CreateCardSessionsResponseCardSource.mjs";
10
10
  export * from "./CreateCardSessionsResponseNote.mjs";
11
+ export * from "./CreateCardSessionsResponsePurchase.mjs";
11
12
  export * from "./CreateCardSessionsResponseStatus.mjs";
12
13
  export * from "./GetCardSessionsResponse.mjs";
13
14
  export * from "./GetCardSessionsResponseAgentToken.mjs";
14
15
  export * from "./GetCardSessionsResponseCardSource.mjs";
15
16
  export * from "./GetCardSessionsResponseNote.mjs";
17
+ export * from "./GetCardSessionsResponsePurchase.mjs";
16
18
  export * from "./GetCardSessionsResponseStatus.mjs";
17
19
  export * from "./ListCardSessionsRequestStatus.mjs";
18
20
  export * from "./ListCardSessionsResponse.mjs";
@@ -20,6 +22,7 @@ export * from "./ListCardSessionsResponseDataItem.mjs";
20
22
  export * from "./ListCardSessionsResponseDataItemAgentToken.mjs";
21
23
  export * from "./ListCardSessionsResponseDataItemCardSource.mjs";
22
24
  export * from "./ListCardSessionsResponseDataItemNote.mjs";
25
+ export * from "./ListCardSessionsResponseDataItemPurchase.mjs";
23
26
  export * from "./ListCardSessionsResponseDataItemStatus.mjs";
24
27
  export * from "./ListCardSessionsResponseMeta.mjs";
25
28
  export * from "./ListCardSessionsResponseMetaPagination.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.6.50";
1
+ export declare const SDK_VERSION = "1.6.51";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.6.50";
1
+ export const SDK_VERSION = "1.6.51";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalpay/sdk",
3
- "version": "1.6.50",
3
+ "version": "1.6.51",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -8884,7 +8884,8 @@ await client.cardSessions.create({
8884
8884
  purchase: {
8885
8885
  merchantName: "Blue Bottle Coffee",
8886
8886
  amount: 2450,
8887
- currency: "USD"
8887
+ currency: "USD",
8888
+ description: "Two bags of whole bean coffee"
8888
8889
  },
8889
8890
  reference: "checkout_7f3a",
8890
8891
  returnUrl: "sms:+15551234567",