@gr4vy/sdk 0.18.12 → 0.18.14

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 (140) hide show
  1. package/README.md +11 -0
  2. package/bin/mcp-server.js +1775 -629
  3. package/bin/mcp-server.js.map +29 -9
  4. package/docs/sdks/merchantaccounts/README.md +454 -0
  5. package/funcs/merchantAccountsCreate.d.ts +17 -0
  6. package/funcs/merchantAccountsCreate.d.ts.map +1 -0
  7. package/funcs/merchantAccountsCreate.js +133 -0
  8. package/funcs/merchantAccountsCreate.js.map +1 -0
  9. package/funcs/merchantAccountsGet.d.ts +17 -0
  10. package/funcs/merchantAccountsGet.d.ts.map +1 -0
  11. package/funcs/merchantAccountsGet.js +137 -0
  12. package/funcs/merchantAccountsGet.js.map +1 -0
  13. package/funcs/merchantAccountsList.d.ts +20 -0
  14. package/funcs/merchantAccountsList.d.ts.map +1 -0
  15. package/funcs/merchantAccountsList.js +162 -0
  16. package/funcs/merchantAccountsList.js.map +1 -0
  17. package/funcs/merchantAccountsUpdate.d.ts +17 -0
  18. package/funcs/merchantAccountsUpdate.d.ts.map +1 -0
  19. package/funcs/merchantAccountsUpdate.js +137 -0
  20. package/funcs/merchantAccountsUpdate.js.map +1 -0
  21. package/jsr.json +1 -1
  22. package/lib/config.d.ts +3 -3
  23. package/lib/config.js +3 -3
  24. package/mcp-server/mcp-server.js +1 -1
  25. package/mcp-server/server.d.ts.map +1 -1
  26. package/mcp-server/server.js +9 -1
  27. package/mcp-server/server.js.map +1 -1
  28. package/mcp-server/tools/merchantAccountsCreate.d.ts +10 -0
  29. package/mcp-server/tools/merchantAccountsCreate.d.ts.map +1 -0
  30. package/mcp-server/tools/merchantAccountsCreate.js +56 -0
  31. package/mcp-server/tools/merchantAccountsCreate.js.map +1 -0
  32. package/mcp-server/tools/merchantAccountsGet.d.ts +8 -0
  33. package/mcp-server/tools/merchantAccountsGet.d.ts.map +1 -0
  34. package/mcp-server/tools/merchantAccountsGet.js +54 -0
  35. package/mcp-server/tools/merchantAccountsGet.js.map +1 -0
  36. package/mcp-server/tools/merchantAccountsList.d.ts +10 -0
  37. package/mcp-server/tools/merchantAccountsList.d.ts.map +1 -0
  38. package/mcp-server/tools/merchantAccountsList.js +56 -0
  39. package/mcp-server/tools/merchantAccountsList.js.map +1 -0
  40. package/mcp-server/tools/merchantAccountsUpdate.d.ts +11 -0
  41. package/mcp-server/tools/merchantAccountsUpdate.d.ts.map +1 -0
  42. package/mcp-server/tools/merchantAccountsUpdate.js +57 -0
  43. package/mcp-server/tools/merchantAccountsUpdate.js.map +1 -0
  44. package/models/components/collectionmerchantaccount.d.ts +48 -0
  45. package/models/components/collectionmerchantaccount.d.ts.map +1 -0
  46. package/models/components/collectionmerchantaccount.js +77 -0
  47. package/models/components/collectionmerchantaccount.js.map +1 -0
  48. package/models/components/index.d.ts +4 -0
  49. package/models/components/index.d.ts.map +1 -1
  50. package/models/components/index.js +4 -0
  51. package/models/components/index.js.map +1 -1
  52. package/models/components/merchantaccount.d.ts +148 -0
  53. package/models/components/merchantaccount.d.ts.map +1 -0
  54. package/models/components/merchantaccount.js +159 -0
  55. package/models/components/merchantaccount.js.map +1 -0
  56. package/models/components/merchantaccountcreate.d.ts +133 -0
  57. package/models/components/merchantaccountcreate.d.ts.map +1 -0
  58. package/models/components/merchantaccountcreate.js +149 -0
  59. package/models/components/merchantaccountcreate.js.map +1 -0
  60. package/models/components/merchantaccountupdate.d.ts +128 -0
  61. package/models/components/merchantaccountupdate.d.ts.map +1 -0
  62. package/models/components/merchantaccountupdate.js +147 -0
  63. package/models/components/merchantaccountupdate.js.map +1 -0
  64. package/models/errors/createmerchantaccount.d.ts +31 -0
  65. package/models/errors/createmerchantaccount.d.ts.map +1 -0
  66. package/models/errors/createmerchantaccount.js +66 -0
  67. package/models/errors/createmerchantaccount.js.map +1 -0
  68. package/models/errors/getmerchantaccount.d.ts +31 -0
  69. package/models/errors/getmerchantaccount.d.ts.map +1 -0
  70. package/models/errors/getmerchantaccount.js +66 -0
  71. package/models/errors/getmerchantaccount.js.map +1 -0
  72. package/models/errors/index.d.ts +4 -0
  73. package/models/errors/index.d.ts.map +1 -1
  74. package/models/errors/index.js +4 -0
  75. package/models/errors/index.js.map +1 -1
  76. package/models/errors/listmerchantaccounts.d.ts +31 -0
  77. package/models/errors/listmerchantaccounts.d.ts.map +1 -0
  78. package/models/errors/listmerchantaccounts.js +66 -0
  79. package/models/errors/listmerchantaccounts.js.map +1 -0
  80. package/models/errors/updatemerchantaccount.d.ts +31 -0
  81. package/models/errors/updatemerchantaccount.d.ts.map +1 -0
  82. package/models/errors/updatemerchantaccount.js +66 -0
  83. package/models/errors/updatemerchantaccount.js.map +1 -0
  84. package/models/operations/createmerchantaccount.d.ts +32 -0
  85. package/models/operations/createmerchantaccount.d.ts.map +1 -0
  86. package/models/operations/createmerchantaccount.js +73 -0
  87. package/models/operations/createmerchantaccount.js.map +1 -0
  88. package/models/operations/getmerchantaccount.d.ts +29 -0
  89. package/models/operations/getmerchantaccount.d.ts.map +1 -0
  90. package/models/operations/getmerchantaccount.js +68 -0
  91. package/models/operations/getmerchantaccount.js.map +1 -0
  92. package/models/operations/index.d.ts +4 -0
  93. package/models/operations/index.d.ts.map +1 -1
  94. package/models/operations/index.js +4 -0
  95. package/models/operations/index.js.map +1 -1
  96. package/models/operations/listmerchantaccounts.d.ts +59 -0
  97. package/models/operations/listmerchantaccounts.d.ts.map +1 -0
  98. package/models/operations/listmerchantaccounts.js +100 -0
  99. package/models/operations/listmerchantaccounts.js.map +1 -0
  100. package/models/operations/updatemerchantaccount.d.ts +34 -0
  101. package/models/operations/updatemerchantaccount.d.ts.map +1 -0
  102. package/models/operations/updatemerchantaccount.js +77 -0
  103. package/models/operations/updatemerchantaccount.js.map +1 -0
  104. package/package.json +1 -1
  105. package/sdk/merchantaccounts.d.ts +37 -0
  106. package/sdk/merchantaccounts.d.ts.map +1 -0
  107. package/sdk/merchantaccounts.js +53 -0
  108. package/sdk/merchantaccounts.js.map +1 -0
  109. package/sdk/sdk.d.ts +3 -0
  110. package/sdk/sdk.d.ts.map +1 -1
  111. package/sdk/sdk.js +4 -0
  112. package/sdk/sdk.js.map +1 -1
  113. package/src/funcs/merchantAccountsCreate.ts +243 -0
  114. package/src/funcs/merchantAccountsGet.ts +249 -0
  115. package/src/funcs/merchantAccountsList.ts +326 -0
  116. package/src/funcs/merchantAccountsUpdate.ts +257 -0
  117. package/src/lib/config.ts +3 -3
  118. package/src/mcp-server/mcp-server.ts +1 -1
  119. package/src/mcp-server/server.ts +9 -1
  120. package/src/mcp-server/tools/merchantAccountsCreate.ts +40 -0
  121. package/src/mcp-server/tools/merchantAccountsGet.ts +37 -0
  122. package/src/mcp-server/tools/merchantAccountsList.ts +41 -0
  123. package/src/mcp-server/tools/merchantAccountsUpdate.ts +42 -0
  124. package/src/models/components/collectionmerchantaccount.ts +107 -0
  125. package/src/models/components/index.ts +4 -0
  126. package/src/models/components/merchantaccount.ts +296 -0
  127. package/src/models/components/merchantaccountcreate.ts +273 -0
  128. package/src/models/components/merchantaccountupdate.ts +266 -0
  129. package/src/models/errors/createmerchantaccount.ts +107 -0
  130. package/src/models/errors/getmerchantaccount.ts +107 -0
  131. package/src/models/errors/index.ts +4 -0
  132. package/src/models/errors/listmerchantaccounts.ts +107 -0
  133. package/src/models/errors/updatemerchantaccount.ts +107 -0
  134. package/src/models/operations/createmerchantaccount.ts +84 -0
  135. package/src/models/operations/getmerchantaccount.ts +75 -0
  136. package/src/models/operations/index.ts +4 -0
  137. package/src/models/operations/listmerchantaccounts.ts +146 -0
  138. package/src/models/operations/updatemerchantaccount.ts +90 -0
  139. package/src/sdk/merchantaccounts.ts +95 -0
  140. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,296 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ CardScheme,
12
+ CardScheme$inboundSchema,
13
+ CardScheme$outboundSchema,
14
+ } from "./cardscheme.js";
15
+
16
+ export type MerchantAccount = {
17
+ /**
18
+ * Always `merchant-account`.
19
+ */
20
+ type?: "merchant-account" | undefined;
21
+ /**
22
+ * The ID for the merchant account.
23
+ */
24
+ id: string;
25
+ /**
26
+ * The display name for the buyer.
27
+ */
28
+ displayName: string;
29
+ /**
30
+ * An optional endpoint URL to deliver webhook notifications to.
31
+ */
32
+ outboundWebhookUrl?: string | null | undefined;
33
+ /**
34
+ * The optional username to use when `outbound_webhook_url` is configured and requires basic authentication.
35
+ */
36
+ outboundWebhookUsername?: string | null | undefined;
37
+ /**
38
+ * The optional password to use when `outbound_webhook_url` is configured and requires basic authentication
39
+ */
40
+ outboundWebhookPassword?: string | null | undefined;
41
+ /**
42
+ * Client key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well.
43
+ */
44
+ loonClientKey?: string | null | undefined;
45
+ /**
46
+ * Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well.
47
+ */
48
+ loonSecretKey?: string | null | undefined;
49
+ /**
50
+ * Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well.
51
+ */
52
+ loonAcceptedSchemes?: Array<CardScheme> | null | undefined;
53
+ /**
54
+ * The public key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well.
55
+ */
56
+ accountUpdaterRequestEncryptionKey?: string | null | undefined;
57
+ /**
58
+ * The ID of the key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well.
59
+ */
60
+ accountUpdaterRequestEncryptionKeyId?: string | null | undefined;
61
+ /**
62
+ * The key used to decrypt the response from the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well.
63
+ */
64
+ accountUpdaterResponseDecryptionKey?: string | null | undefined;
65
+ /**
66
+ * The ID of the key used to decrypt the request from the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well.
67
+ */
68
+ accountUpdaterResponseDecryptionKeyId?: string | null | undefined;
69
+ /**
70
+ * Whether the Real-Time Account Updater service is enabled for this merchant account. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `false`, the Account Updater service doesn't get called if a payment fails with expired or invalid card details. If the field is set to `true`, the service is called. Please note that for this to work the other `account_updater_* fields` must be set as well.
71
+ */
72
+ accountUpdaterEnabled: boolean;
73
+ /**
74
+ * The maximum monetary amount allowed for over-capture, in the smallest currency unit, for example `1299` cents to allow for an over-capture of `$12.99`.
75
+ */
76
+ overCaptureAmount?: number | null | undefined;
77
+ /**
78
+ * The maximum percentage allowed for over-capture, for example `25` to allow for an over-capture of `25%` of the original transaction amount.
79
+ */
80
+ overCapturePercentage?: number | null | undefined;
81
+ /**
82
+ * Requestor ID provided for Visa after onboarding to use Network Tokens.
83
+ */
84
+ visaNetworkTokensRequestorId?: string | null | undefined;
85
+ /**
86
+ * Application ID provided for Visa after onboarding to use Network Tokens.
87
+ */
88
+ visaNetworkTokensAppId?: string | null | undefined;
89
+ /**
90
+ * Requestor ID provided for American Express after onboarding to use Network Tokens.
91
+ */
92
+ amexNetworkTokensRequestorId?: string | null | undefined;
93
+ /**
94
+ * Application ID provided for American Express after onboarding to use Network Tokens.
95
+ */
96
+ amexNetworkTokensAppId?: string | null | undefined;
97
+ /**
98
+ * Requestor ID provided for Mastercard after onboarding to use Network Tokens.
99
+ */
100
+ mastercardNetworkTokensRequestorId?: string | null | undefined;
101
+ /**
102
+ * Application ID provided for Mastercard after onboarding to use Network Tokens.
103
+ */
104
+ mastercardNetworkTokensAppId?: string | null | undefined;
105
+ /**
106
+ * The date this merchant account was created at.
107
+ */
108
+ createdAt: Date;
109
+ /**
110
+ * The date this merchant account was last updated at.
111
+ */
112
+ updatedAt: Date;
113
+ };
114
+
115
+ /** @internal */
116
+ export const MerchantAccount$inboundSchema: z.ZodType<
117
+ MerchantAccount,
118
+ z.ZodTypeDef,
119
+ unknown
120
+ > = z.object({
121
+ type: z.literal("merchant-account").default("merchant-account"),
122
+ id: z.string(),
123
+ display_name: z.string(),
124
+ outbound_webhook_url: z.nullable(z.string()).optional(),
125
+ outbound_webhook_username: z.nullable(z.string()).optional(),
126
+ outbound_webhook_password: z.nullable(z.string()).optional(),
127
+ loon_client_key: z.nullable(z.string()).optional(),
128
+ loon_secret_key: z.nullable(z.string()).optional(),
129
+ loon_accepted_schemes: z.nullable(z.array(CardScheme$inboundSchema))
130
+ .optional(),
131
+ account_updater_request_encryption_key: z.nullable(z.string()).optional(),
132
+ account_updater_request_encryption_key_id: z.nullable(z.string()).optional(),
133
+ account_updater_response_decryption_key: z.nullable(z.string()).optional(),
134
+ account_updater_response_decryption_key_id: z.nullable(z.string()).optional(),
135
+ account_updater_enabled: z.boolean(),
136
+ over_capture_amount: z.nullable(z.number().int()).optional(),
137
+ over_capture_percentage: z.nullable(z.number().int()).optional(),
138
+ visa_network_tokens_requestor_id: z.nullable(z.string()).optional(),
139
+ visa_network_tokens_app_id: z.nullable(z.string()).optional(),
140
+ amex_network_tokens_requestor_id: z.nullable(z.string()).optional(),
141
+ amex_network_tokens_app_id: z.nullable(z.string()).optional(),
142
+ mastercard_network_tokens_requestor_id: z.nullable(z.string()).optional(),
143
+ mastercard_network_tokens_app_id: z.nullable(z.string()).optional(),
144
+ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
145
+ updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
146
+ }).transform((v) => {
147
+ return remap$(v, {
148
+ "display_name": "displayName",
149
+ "outbound_webhook_url": "outboundWebhookUrl",
150
+ "outbound_webhook_username": "outboundWebhookUsername",
151
+ "outbound_webhook_password": "outboundWebhookPassword",
152
+ "loon_client_key": "loonClientKey",
153
+ "loon_secret_key": "loonSecretKey",
154
+ "loon_accepted_schemes": "loonAcceptedSchemes",
155
+ "account_updater_request_encryption_key":
156
+ "accountUpdaterRequestEncryptionKey",
157
+ "account_updater_request_encryption_key_id":
158
+ "accountUpdaterRequestEncryptionKeyId",
159
+ "account_updater_response_decryption_key":
160
+ "accountUpdaterResponseDecryptionKey",
161
+ "account_updater_response_decryption_key_id":
162
+ "accountUpdaterResponseDecryptionKeyId",
163
+ "account_updater_enabled": "accountUpdaterEnabled",
164
+ "over_capture_amount": "overCaptureAmount",
165
+ "over_capture_percentage": "overCapturePercentage",
166
+ "visa_network_tokens_requestor_id": "visaNetworkTokensRequestorId",
167
+ "visa_network_tokens_app_id": "visaNetworkTokensAppId",
168
+ "amex_network_tokens_requestor_id": "amexNetworkTokensRequestorId",
169
+ "amex_network_tokens_app_id": "amexNetworkTokensAppId",
170
+ "mastercard_network_tokens_requestor_id":
171
+ "mastercardNetworkTokensRequestorId",
172
+ "mastercard_network_tokens_app_id": "mastercardNetworkTokensAppId",
173
+ "created_at": "createdAt",
174
+ "updated_at": "updatedAt",
175
+ });
176
+ });
177
+
178
+ /** @internal */
179
+ export type MerchantAccount$Outbound = {
180
+ type: "merchant-account";
181
+ id: string;
182
+ display_name: string;
183
+ outbound_webhook_url?: string | null | undefined;
184
+ outbound_webhook_username?: string | null | undefined;
185
+ outbound_webhook_password?: string | null | undefined;
186
+ loon_client_key?: string | null | undefined;
187
+ loon_secret_key?: string | null | undefined;
188
+ loon_accepted_schemes?: Array<string> | null | undefined;
189
+ account_updater_request_encryption_key?: string | null | undefined;
190
+ account_updater_request_encryption_key_id?: string | null | undefined;
191
+ account_updater_response_decryption_key?: string | null | undefined;
192
+ account_updater_response_decryption_key_id?: string | null | undefined;
193
+ account_updater_enabled: boolean;
194
+ over_capture_amount?: number | null | undefined;
195
+ over_capture_percentage?: number | null | undefined;
196
+ visa_network_tokens_requestor_id?: string | null | undefined;
197
+ visa_network_tokens_app_id?: string | null | undefined;
198
+ amex_network_tokens_requestor_id?: string | null | undefined;
199
+ amex_network_tokens_app_id?: string | null | undefined;
200
+ mastercard_network_tokens_requestor_id?: string | null | undefined;
201
+ mastercard_network_tokens_app_id?: string | null | undefined;
202
+ created_at: string;
203
+ updated_at: string;
204
+ };
205
+
206
+ /** @internal */
207
+ export const MerchantAccount$outboundSchema: z.ZodType<
208
+ MerchantAccount$Outbound,
209
+ z.ZodTypeDef,
210
+ MerchantAccount
211
+ > = z.object({
212
+ type: z.literal("merchant-account").default("merchant-account" as const),
213
+ id: z.string(),
214
+ displayName: z.string(),
215
+ outboundWebhookUrl: z.nullable(z.string()).optional(),
216
+ outboundWebhookUsername: z.nullable(z.string()).optional(),
217
+ outboundWebhookPassword: z.nullable(z.string()).optional(),
218
+ loonClientKey: z.nullable(z.string()).optional(),
219
+ loonSecretKey: z.nullable(z.string()).optional(),
220
+ loonAcceptedSchemes: z.nullable(z.array(CardScheme$outboundSchema))
221
+ .optional(),
222
+ accountUpdaterRequestEncryptionKey: z.nullable(z.string()).optional(),
223
+ accountUpdaterRequestEncryptionKeyId: z.nullable(z.string()).optional(),
224
+ accountUpdaterResponseDecryptionKey: z.nullable(z.string()).optional(),
225
+ accountUpdaterResponseDecryptionKeyId: z.nullable(z.string()).optional(),
226
+ accountUpdaterEnabled: z.boolean(),
227
+ overCaptureAmount: z.nullable(z.number().int()).optional(),
228
+ overCapturePercentage: z.nullable(z.number().int()).optional(),
229
+ visaNetworkTokensRequestorId: z.nullable(z.string()).optional(),
230
+ visaNetworkTokensAppId: z.nullable(z.string()).optional(),
231
+ amexNetworkTokensRequestorId: z.nullable(z.string()).optional(),
232
+ amexNetworkTokensAppId: z.nullable(z.string()).optional(),
233
+ mastercardNetworkTokensRequestorId: z.nullable(z.string()).optional(),
234
+ mastercardNetworkTokensAppId: z.nullable(z.string()).optional(),
235
+ createdAt: z.date().transform(v => v.toISOString()),
236
+ updatedAt: z.date().transform(v => v.toISOString()),
237
+ }).transform((v) => {
238
+ return remap$(v, {
239
+ displayName: "display_name",
240
+ outboundWebhookUrl: "outbound_webhook_url",
241
+ outboundWebhookUsername: "outbound_webhook_username",
242
+ outboundWebhookPassword: "outbound_webhook_password",
243
+ loonClientKey: "loon_client_key",
244
+ loonSecretKey: "loon_secret_key",
245
+ loonAcceptedSchemes: "loon_accepted_schemes",
246
+ accountUpdaterRequestEncryptionKey:
247
+ "account_updater_request_encryption_key",
248
+ accountUpdaterRequestEncryptionKeyId:
249
+ "account_updater_request_encryption_key_id",
250
+ accountUpdaterResponseDecryptionKey:
251
+ "account_updater_response_decryption_key",
252
+ accountUpdaterResponseDecryptionKeyId:
253
+ "account_updater_response_decryption_key_id",
254
+ accountUpdaterEnabled: "account_updater_enabled",
255
+ overCaptureAmount: "over_capture_amount",
256
+ overCapturePercentage: "over_capture_percentage",
257
+ visaNetworkTokensRequestorId: "visa_network_tokens_requestor_id",
258
+ visaNetworkTokensAppId: "visa_network_tokens_app_id",
259
+ amexNetworkTokensRequestorId: "amex_network_tokens_requestor_id",
260
+ amexNetworkTokensAppId: "amex_network_tokens_app_id",
261
+ mastercardNetworkTokensRequestorId:
262
+ "mastercard_network_tokens_requestor_id",
263
+ mastercardNetworkTokensAppId: "mastercard_network_tokens_app_id",
264
+ createdAt: "created_at",
265
+ updatedAt: "updated_at",
266
+ });
267
+ });
268
+
269
+ /**
270
+ * @internal
271
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
272
+ */
273
+ export namespace MerchantAccount$ {
274
+ /** @deprecated use `MerchantAccount$inboundSchema` instead. */
275
+ export const inboundSchema = MerchantAccount$inboundSchema;
276
+ /** @deprecated use `MerchantAccount$outboundSchema` instead. */
277
+ export const outboundSchema = MerchantAccount$outboundSchema;
278
+ /** @deprecated use `MerchantAccount$Outbound` instead. */
279
+ export type Outbound = MerchantAccount$Outbound;
280
+ }
281
+
282
+ export function merchantAccountToJSON(
283
+ merchantAccount: MerchantAccount,
284
+ ): string {
285
+ return JSON.stringify(MerchantAccount$outboundSchema.parse(merchantAccount));
286
+ }
287
+
288
+ export function merchantAccountFromJSON(
289
+ jsonString: string,
290
+ ): SafeParseResult<MerchantAccount, SDKValidationError> {
291
+ return safeParse(
292
+ jsonString,
293
+ (x) => MerchantAccount$inboundSchema.parse(JSON.parse(x)),
294
+ `Failed to parse 'MerchantAccount' from JSON`,
295
+ );
296
+ }
@@ -0,0 +1,273 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ CardScheme,
12
+ CardScheme$inboundSchema,
13
+ CardScheme$outboundSchema,
14
+ } from "./cardscheme.js";
15
+
16
+ export type MerchantAccountCreate = {
17
+ /**
18
+ * Whether the Real-Time Account Updater service is enabled for this merchant account. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `false`, the Account Updater service doesn't get called if a payment fails with expired or invalid card details. If the field is set to `true`, the service is called. Please note that for this to work the other `account_updater_* fields` must be set as well.
19
+ */
20
+ accountUpdaterEnabled?: boolean | undefined;
21
+ /**
22
+ * The public key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well.
23
+ */
24
+ accountUpdaterRequestEncryptionKey?: string | null | undefined;
25
+ /**
26
+ * The ID of the key used to encrypt the request to the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well.
27
+ */
28
+ accountUpdaterRequestEncryptionKeyId?: string | null | undefined;
29
+ /**
30
+ * The key used to decrypt the response from the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well.
31
+ */
32
+ accountUpdaterResponseDecryptionKey?: string | null | undefined;
33
+ /**
34
+ * The ID of the key used to decrypt the request from the Real-Time Account Updater service. The Account Updater service is used to update card details when cards are lost, stolen or expired. If the field is not set or if it's set to `null`, the Account Updater service doesn't get called. If the field is set, the other `account_updater_*` fields must be set as well.
35
+ */
36
+ accountUpdaterResponseDecryptionKeyId?: string | null | undefined;
37
+ /**
38
+ * The maximum monetary amount allowed for over-capture, in the smallest currency unit, for example `1299` cents to allow for an over-capture of `$12.99`.
39
+ */
40
+ overCaptureAmount?: number | null | undefined;
41
+ /**
42
+ * The maximum percentage allowed for over-capture, for example `25` to allow for an over-capture of `25%` of the original transaction amount.
43
+ */
44
+ overCapturePercentage?: number | null | undefined;
45
+ /**
46
+ * Client key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well.
47
+ */
48
+ loonClientKey?: string | null | undefined;
49
+ /**
50
+ * Secret key provided by Pagos to authenticate to the Loon API. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well.
51
+ */
52
+ loonSecretKey?: string | null | undefined;
53
+ /**
54
+ * Card schemes accepted when creating jobs using this set of Loon API keys. Loon is the Account Updater service we use and if the field is not set or if it's set to null, the Account Updater service doesn't get configured. If the field is set to `null`, the other `loon_*` fields must be set to null as well.
55
+ */
56
+ loonAcceptedSchemes?: Array<CardScheme> | null | undefined;
57
+ /**
58
+ * Requestor ID provided for Visa after onboarding to use Network Tokens.
59
+ */
60
+ visaNetworkTokensRequestorId?: string | null | undefined;
61
+ /**
62
+ * Application ID provided for Visa after onboarding to use Network Tokens.
63
+ */
64
+ visaNetworkTokensAppId?: string | null | undefined;
65
+ /**
66
+ * Requestor ID provided for American Express after onboarding to use Network Tokens.
67
+ */
68
+ amexNetworkTokensRequestorId?: string | null | undefined;
69
+ /**
70
+ * Application ID provided for American Express after onboarding to use Network Tokens.
71
+ */
72
+ amexNetworkTokensAppId?: string | null | undefined;
73
+ /**
74
+ * Requestor ID provided for Mastercard after onboarding to use Network Tokens.
75
+ */
76
+ mastercardNetworkTokensRequestorId?: string | null | undefined;
77
+ /**
78
+ * Application ID provided for Mastercard after onboarding to use Network Tokens.
79
+ */
80
+ mastercardNetworkTokensAppId?: string | null | undefined;
81
+ /**
82
+ * An optional endpoint URL to deliver webhook notifications to.
83
+ */
84
+ outboundWebhookUrl?: string | null | undefined;
85
+ /**
86
+ * The optional username to use when `outbound_webhook_url` is configured and requires basic authentication.
87
+ */
88
+ outboundWebhookUsername?: string | null | undefined;
89
+ /**
90
+ * The optional password to use when `outbound_webhook_url` is configured and requires basic authentication
91
+ */
92
+ outboundWebhookPassword?: string | null | undefined;
93
+ /**
94
+ * The ID for the merchant account.
95
+ */
96
+ id: string;
97
+ /**
98
+ * The display name for the merchant account.
99
+ */
100
+ displayName: string;
101
+ };
102
+
103
+ /** @internal */
104
+ export const MerchantAccountCreate$inboundSchema: z.ZodType<
105
+ MerchantAccountCreate,
106
+ z.ZodTypeDef,
107
+ unknown
108
+ > = z.object({
109
+ account_updater_enabled: z.boolean().default(false),
110
+ account_updater_request_encryption_key: z.nullable(z.string()).optional(),
111
+ account_updater_request_encryption_key_id: z.nullable(z.string()).optional(),
112
+ account_updater_response_decryption_key: z.nullable(z.string()).optional(),
113
+ account_updater_response_decryption_key_id: z.nullable(z.string()).optional(),
114
+ over_capture_amount: z.nullable(z.number().int()).optional(),
115
+ over_capture_percentage: z.nullable(z.number().int()).optional(),
116
+ loon_client_key: z.nullable(z.string()).optional(),
117
+ loon_secret_key: z.nullable(z.string()).optional(),
118
+ loon_accepted_schemes: z.nullable(z.array(CardScheme$inboundSchema))
119
+ .optional(),
120
+ visa_network_tokens_requestor_id: z.nullable(z.string()).optional(),
121
+ visa_network_tokens_app_id: z.nullable(z.string()).optional(),
122
+ amex_network_tokens_requestor_id: z.nullable(z.string()).optional(),
123
+ amex_network_tokens_app_id: z.nullable(z.string()).optional(),
124
+ mastercard_network_tokens_requestor_id: z.nullable(z.string()).optional(),
125
+ mastercard_network_tokens_app_id: z.nullable(z.string()).optional(),
126
+ outbound_webhook_url: z.nullable(z.string()).optional(),
127
+ outbound_webhook_username: z.nullable(z.string()).optional(),
128
+ outbound_webhook_password: z.nullable(z.string()).optional(),
129
+ id: z.string(),
130
+ display_name: z.string(),
131
+ }).transform((v) => {
132
+ return remap$(v, {
133
+ "account_updater_enabled": "accountUpdaterEnabled",
134
+ "account_updater_request_encryption_key":
135
+ "accountUpdaterRequestEncryptionKey",
136
+ "account_updater_request_encryption_key_id":
137
+ "accountUpdaterRequestEncryptionKeyId",
138
+ "account_updater_response_decryption_key":
139
+ "accountUpdaterResponseDecryptionKey",
140
+ "account_updater_response_decryption_key_id":
141
+ "accountUpdaterResponseDecryptionKeyId",
142
+ "over_capture_amount": "overCaptureAmount",
143
+ "over_capture_percentage": "overCapturePercentage",
144
+ "loon_client_key": "loonClientKey",
145
+ "loon_secret_key": "loonSecretKey",
146
+ "loon_accepted_schemes": "loonAcceptedSchemes",
147
+ "visa_network_tokens_requestor_id": "visaNetworkTokensRequestorId",
148
+ "visa_network_tokens_app_id": "visaNetworkTokensAppId",
149
+ "amex_network_tokens_requestor_id": "amexNetworkTokensRequestorId",
150
+ "amex_network_tokens_app_id": "amexNetworkTokensAppId",
151
+ "mastercard_network_tokens_requestor_id":
152
+ "mastercardNetworkTokensRequestorId",
153
+ "mastercard_network_tokens_app_id": "mastercardNetworkTokensAppId",
154
+ "outbound_webhook_url": "outboundWebhookUrl",
155
+ "outbound_webhook_username": "outboundWebhookUsername",
156
+ "outbound_webhook_password": "outboundWebhookPassword",
157
+ "display_name": "displayName",
158
+ });
159
+ });
160
+
161
+ /** @internal */
162
+ export type MerchantAccountCreate$Outbound = {
163
+ account_updater_enabled: boolean;
164
+ account_updater_request_encryption_key?: string | null | undefined;
165
+ account_updater_request_encryption_key_id?: string | null | undefined;
166
+ account_updater_response_decryption_key?: string | null | undefined;
167
+ account_updater_response_decryption_key_id?: string | null | undefined;
168
+ over_capture_amount?: number | null | undefined;
169
+ over_capture_percentage?: number | null | undefined;
170
+ loon_client_key?: string | null | undefined;
171
+ loon_secret_key?: string | null | undefined;
172
+ loon_accepted_schemes?: Array<string> | null | undefined;
173
+ visa_network_tokens_requestor_id?: string | null | undefined;
174
+ visa_network_tokens_app_id?: string | null | undefined;
175
+ amex_network_tokens_requestor_id?: string | null | undefined;
176
+ amex_network_tokens_app_id?: string | null | undefined;
177
+ mastercard_network_tokens_requestor_id?: string | null | undefined;
178
+ mastercard_network_tokens_app_id?: string | null | undefined;
179
+ outbound_webhook_url?: string | null | undefined;
180
+ outbound_webhook_username?: string | null | undefined;
181
+ outbound_webhook_password?: string | null | undefined;
182
+ id: string;
183
+ display_name: string;
184
+ };
185
+
186
+ /** @internal */
187
+ export const MerchantAccountCreate$outboundSchema: z.ZodType<
188
+ MerchantAccountCreate$Outbound,
189
+ z.ZodTypeDef,
190
+ MerchantAccountCreate
191
+ > = z.object({
192
+ accountUpdaterEnabled: z.boolean().default(false),
193
+ accountUpdaterRequestEncryptionKey: z.nullable(z.string()).optional(),
194
+ accountUpdaterRequestEncryptionKeyId: z.nullable(z.string()).optional(),
195
+ accountUpdaterResponseDecryptionKey: z.nullable(z.string()).optional(),
196
+ accountUpdaterResponseDecryptionKeyId: z.nullable(z.string()).optional(),
197
+ overCaptureAmount: z.nullable(z.number().int()).optional(),
198
+ overCapturePercentage: z.nullable(z.number().int()).optional(),
199
+ loonClientKey: z.nullable(z.string()).optional(),
200
+ loonSecretKey: z.nullable(z.string()).optional(),
201
+ loonAcceptedSchemes: z.nullable(z.array(CardScheme$outboundSchema))
202
+ .optional(),
203
+ visaNetworkTokensRequestorId: z.nullable(z.string()).optional(),
204
+ visaNetworkTokensAppId: z.nullable(z.string()).optional(),
205
+ amexNetworkTokensRequestorId: z.nullable(z.string()).optional(),
206
+ amexNetworkTokensAppId: z.nullable(z.string()).optional(),
207
+ mastercardNetworkTokensRequestorId: z.nullable(z.string()).optional(),
208
+ mastercardNetworkTokensAppId: z.nullable(z.string()).optional(),
209
+ outboundWebhookUrl: z.nullable(z.string()).optional(),
210
+ outboundWebhookUsername: z.nullable(z.string()).optional(),
211
+ outboundWebhookPassword: z.nullable(z.string()).optional(),
212
+ id: z.string(),
213
+ displayName: z.string(),
214
+ }).transform((v) => {
215
+ return remap$(v, {
216
+ accountUpdaterEnabled: "account_updater_enabled",
217
+ accountUpdaterRequestEncryptionKey:
218
+ "account_updater_request_encryption_key",
219
+ accountUpdaterRequestEncryptionKeyId:
220
+ "account_updater_request_encryption_key_id",
221
+ accountUpdaterResponseDecryptionKey:
222
+ "account_updater_response_decryption_key",
223
+ accountUpdaterResponseDecryptionKeyId:
224
+ "account_updater_response_decryption_key_id",
225
+ overCaptureAmount: "over_capture_amount",
226
+ overCapturePercentage: "over_capture_percentage",
227
+ loonClientKey: "loon_client_key",
228
+ loonSecretKey: "loon_secret_key",
229
+ loonAcceptedSchemes: "loon_accepted_schemes",
230
+ visaNetworkTokensRequestorId: "visa_network_tokens_requestor_id",
231
+ visaNetworkTokensAppId: "visa_network_tokens_app_id",
232
+ amexNetworkTokensRequestorId: "amex_network_tokens_requestor_id",
233
+ amexNetworkTokensAppId: "amex_network_tokens_app_id",
234
+ mastercardNetworkTokensRequestorId:
235
+ "mastercard_network_tokens_requestor_id",
236
+ mastercardNetworkTokensAppId: "mastercard_network_tokens_app_id",
237
+ outboundWebhookUrl: "outbound_webhook_url",
238
+ outboundWebhookUsername: "outbound_webhook_username",
239
+ outboundWebhookPassword: "outbound_webhook_password",
240
+ displayName: "display_name",
241
+ });
242
+ });
243
+
244
+ /**
245
+ * @internal
246
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
247
+ */
248
+ export namespace MerchantAccountCreate$ {
249
+ /** @deprecated use `MerchantAccountCreate$inboundSchema` instead. */
250
+ export const inboundSchema = MerchantAccountCreate$inboundSchema;
251
+ /** @deprecated use `MerchantAccountCreate$outboundSchema` instead. */
252
+ export const outboundSchema = MerchantAccountCreate$outboundSchema;
253
+ /** @deprecated use `MerchantAccountCreate$Outbound` instead. */
254
+ export type Outbound = MerchantAccountCreate$Outbound;
255
+ }
256
+
257
+ export function merchantAccountCreateToJSON(
258
+ merchantAccountCreate: MerchantAccountCreate,
259
+ ): string {
260
+ return JSON.stringify(
261
+ MerchantAccountCreate$outboundSchema.parse(merchantAccountCreate),
262
+ );
263
+ }
264
+
265
+ export function merchantAccountCreateFromJSON(
266
+ jsonString: string,
267
+ ): SafeParseResult<MerchantAccountCreate, SDKValidationError> {
268
+ return safeParse(
269
+ jsonString,
270
+ (x) => MerchantAccountCreate$inboundSchema.parse(JSON.parse(x)),
271
+ `Failed to parse 'MerchantAccountCreate' from JSON`,
272
+ );
273
+ }