@gr4vy/sdk 2.2.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/funcs/auditLogsList.d.ts.map +1 -1
- package/funcs/auditLogsList.js +1 -2
- package/funcs/auditLogsList.js.map +1 -1
- package/funcs/buyersList.d.ts.map +1 -1
- package/funcs/buyersList.js +1 -2
- package/funcs/buyersList.js.map +1 -1
- package/funcs/giftCardsList.d.ts.map +1 -1
- package/funcs/giftCardsList.js +1 -2
- package/funcs/giftCardsList.js.map +1 -1
- package/funcs/merchantAccountsList.d.ts.map +1 -1
- package/funcs/merchantAccountsList.js +1 -2
- package/funcs/merchantAccountsList.js.map +1 -1
- package/funcs/paymentLinksList.d.ts.map +1 -1
- package/funcs/paymentLinksList.js +1 -2
- package/funcs/paymentLinksList.js.map +1 -1
- package/funcs/paymentMethodsList.d.ts.map +1 -1
- package/funcs/paymentMethodsList.js +1 -2
- package/funcs/paymentMethodsList.js.map +1 -1
- package/funcs/paymentServiceDefinitionsList.d.ts.map +1 -1
- package/funcs/paymentServiceDefinitionsList.js +1 -2
- package/funcs/paymentServiceDefinitionsList.js.map +1 -1
- package/funcs/paymentServicesList.d.ts.map +1 -1
- package/funcs/paymentServicesList.js +1 -2
- package/funcs/paymentServicesList.js.map +1 -1
- package/funcs/payoutsList.d.ts.map +1 -1
- package/funcs/payoutsList.js +1 -2
- package/funcs/payoutsList.js.map +1 -1
- package/funcs/reportExecutionsList.d.ts.map +1 -1
- package/funcs/reportExecutionsList.js +1 -2
- package/funcs/reportExecutionsList.js.map +1 -1
- package/funcs/reportsExecutionsList.d.ts.map +1 -1
- package/funcs/reportsExecutionsList.js +1 -2
- package/funcs/reportsExecutionsList.js.map +1 -1
- package/funcs/reportsList.d.ts.map +1 -1
- package/funcs/reportsList.js +1 -2
- package/funcs/reportsList.js.map +1 -1
- package/funcs/threeDsScenariosList.d.ts.map +1 -1
- package/funcs/threeDsScenariosList.js +1 -2
- package/funcs/threeDsScenariosList.js.map +1 -1
- package/funcs/transactionsCapturesGet.d.ts +18 -0
- package/funcs/transactionsCapturesGet.d.ts.map +1 -0
- package/funcs/transactionsCapturesGet.js +145 -0
- package/funcs/transactionsCapturesGet.js.map +1 -0
- package/funcs/transactionsCapturesList.d.ts +18 -0
- package/funcs/transactionsCapturesList.d.ts.map +1 -0
- package/funcs/transactionsCapturesList.js +140 -0
- package/funcs/transactionsCapturesList.js.map +1 -0
- package/funcs/transactionsEventsList.d.ts.map +1 -1
- package/funcs/transactionsEventsList.js +1 -2
- package/funcs/transactionsEventsList.js.map +1 -1
- package/funcs/transactionsList.d.ts.map +1 -1
- package/funcs/transactionsList.js +1 -2
- package/funcs/transactionsList.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/encodings.js +12 -12
- package/lib/encodings.js.map +1 -1
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +3 -3
- package/lib/env.js.map +1 -1
- package/lib/matchers.js +3 -3
- package/lib/matchers.js.map +1 -1
- package/lib/primitives.d.ts +1 -0
- package/lib/primitives.d.ts.map +1 -1
- package/lib/primitives.js +18 -0
- package/lib/primitives.js.map +1 -1
- package/models/components/capture.d.ts +84 -0
- package/models/components/capture.d.ts.map +1 -0
- package/models/components/capture.js +86 -0
- package/models/components/capture.js.map +1 -0
- package/models/components/capturecollection.d.ts +26 -0
- package/models/components/capturecollection.d.ts.map +1 -0
- package/models/components/capturecollection.js +60 -0
- package/models/components/capturecollection.js.map +1 -0
- package/models/components/index.d.ts +2 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -0
- package/models/components/index.js.map +1 -1
- package/models/components/nuveipseoptions.d.ts +2 -2
- package/models/components/transactioncapturecreate.d.ts +10 -0
- package/models/components/transactioncapturecreate.d.ts.map +1 -1
- package/models/components/transactioncapturecreate.js +3 -0
- package/models/components/transactioncapturecreate.js.map +1 -1
- package/models/operations/gettransactioncapture.d.ts +28 -0
- package/models/operations/gettransactioncapture.d.ts.map +1 -0
- package/models/operations/gettransactioncapture.js +57 -0
- package/models/operations/gettransactioncapture.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listtransactioncaptures.d.ts +23 -0
- package/models/operations/listtransactioncaptures.d.ts.map +1 -0
- package/models/operations/listtransactioncaptures.js +55 -0
- package/models/operations/listtransactioncaptures.js.map +1 -0
- package/package.json +1 -1
- package/sdk/captures.d.ts +19 -0
- package/sdk/captures.d.ts.map +1 -0
- package/sdk/captures.js +32 -0
- package/sdk/captures.js.map +1 -0
- package/sdk/transactions.d.ts +3 -0
- package/sdk/transactions.d.ts.map +1 -1
- package/sdk/transactions.js +4 -0
- package/sdk/transactions.js.map +1 -1
- package/src/funcs/auditLogsList.ts +2 -2
- package/src/funcs/buyersList.ts +2 -2
- package/src/funcs/giftCardsList.ts +2 -2
- package/src/funcs/merchantAccountsList.ts +2 -2
- package/src/funcs/paymentLinksList.ts +2 -2
- package/src/funcs/paymentMethodsList.ts +2 -2
- package/src/funcs/paymentServiceDefinitionsList.ts +2 -2
- package/src/funcs/paymentServicesList.ts +2 -2
- package/src/funcs/payoutsList.ts +2 -2
- package/src/funcs/reportExecutionsList.ts +2 -2
- package/src/funcs/reportsExecutionsList.ts +2 -2
- package/src/funcs/reportsList.ts +2 -2
- package/src/funcs/threeDsScenariosList.ts +2 -2
- package/src/funcs/transactionsCapturesGet.ts +255 -0
- package/src/funcs/transactionsCapturesList.ts +247 -0
- package/src/funcs/transactionsEventsList.ts +2 -2
- package/src/funcs/transactionsList.ts +2 -2
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +1 -1
- package/src/lib/env.ts +7 -3
- package/src/lib/matchers.ts +1 -1
- package/src/lib/primitives.ts +16 -0
- package/src/models/components/capture.ts +142 -0
- package/src/models/components/capturecollection.ts +56 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/nuveipseoptions.ts +2 -2
- package/src/models/components/transactioncapturecreate.ts +13 -0
- package/src/models/operations/gettransactioncapture.ts +58 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listtransactioncaptures.ts +51 -0
- package/src/sdk/captures.ts +51 -0
- package/src/sdk/transactions.ts +6 -0
- package/lib/dlv.d.ts +0 -14
- package/lib/dlv.d.ts.map +0 -1
- package/lib/dlv.js +0 -49
- package/lib/dlv.js.map +0 -1
- package/lib/is-plain-object.d.ts +0 -2
- package/lib/is-plain-object.d.ts.map +0 -1
- package/lib/is-plain-object.js +0 -41
- package/lib/is-plain-object.js.map +0 -1
- package/src/lib/dlv.ts +0 -53
- package/src/lib/is-plain-object.ts +0 -43
package/src/funcs/buyersList.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -281,7 +280,8 @@ async function $do(
|
|
|
281
280
|
>;
|
|
282
281
|
"~next"?: { cursor: string };
|
|
283
282
|
} => {
|
|
284
|
-
const nextCursor =
|
|
283
|
+
const nextCursor =
|
|
284
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
285
285
|
if (typeof nextCursor !== "string") {
|
|
286
286
|
return { next: () => null };
|
|
287
287
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -283,7 +282,8 @@ async function $do(
|
|
|
283
282
|
>;
|
|
284
283
|
"~next"?: { cursor: string };
|
|
285
284
|
} => {
|
|
286
|
-
const nextCursor =
|
|
285
|
+
const nextCursor =
|
|
286
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
287
287
|
if (typeof nextCursor !== "string") {
|
|
288
288
|
return { next: () => null };
|
|
289
289
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -291,7 +290,8 @@ async function $do(
|
|
|
291
290
|
>;
|
|
292
291
|
"~next"?: { cursor: string };
|
|
293
292
|
} => {
|
|
294
|
-
const nextCursor =
|
|
293
|
+
const nextCursor =
|
|
294
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
295
295
|
if (typeof nextCursor !== "string") {
|
|
296
296
|
return { next: () => null };
|
|
297
297
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -298,7 +297,8 @@ async function $do(
|
|
|
298
297
|
>;
|
|
299
298
|
"~next"?: { cursor: string };
|
|
300
299
|
} => {
|
|
301
|
-
const nextCursor =
|
|
300
|
+
const nextCursor =
|
|
301
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
302
302
|
if (typeof nextCursor !== "string") {
|
|
303
303
|
return { next: () => null };
|
|
304
304
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -287,7 +286,8 @@ async function $do(
|
|
|
287
286
|
>;
|
|
288
287
|
"~next"?: { cursor: string };
|
|
289
288
|
} => {
|
|
290
|
-
const nextCursor =
|
|
289
|
+
const nextCursor =
|
|
290
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
291
291
|
if (typeof nextCursor !== "string") {
|
|
292
292
|
return { next: () => null };
|
|
293
293
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -287,7 +286,8 @@ async function $do(
|
|
|
287
286
|
>;
|
|
288
287
|
"~next"?: { cursor: string };
|
|
289
288
|
} => {
|
|
290
|
-
const nextCursor =
|
|
289
|
+
const nextCursor =
|
|
290
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
291
291
|
if (typeof nextCursor !== "string") {
|
|
292
292
|
return { next: () => null };
|
|
293
293
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -285,7 +284,8 @@ async function $do(
|
|
|
285
284
|
>;
|
|
286
285
|
"~next"?: { cursor: string };
|
|
287
286
|
} => {
|
|
288
|
-
const nextCursor =
|
|
287
|
+
const nextCursor =
|
|
288
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
289
289
|
if (typeof nextCursor !== "string") {
|
|
290
290
|
return { next: () => null };
|
|
291
291
|
}
|
package/src/funcs/payoutsList.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -293,7 +292,8 @@ async function $do(
|
|
|
293
292
|
>;
|
|
294
293
|
"~next"?: { cursor: string };
|
|
295
294
|
} => {
|
|
296
|
-
const nextCursor =
|
|
295
|
+
const nextCursor =
|
|
296
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
297
297
|
if (typeof nextCursor !== "string") {
|
|
298
298
|
return { next: () => null };
|
|
299
299
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -288,7 +287,8 @@ async function $do(
|
|
|
288
287
|
>;
|
|
289
288
|
"~next"?: { cursor: string };
|
|
290
289
|
} => {
|
|
291
|
-
const nextCursor =
|
|
290
|
+
const nextCursor =
|
|
291
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
292
292
|
if (typeof nextCursor !== "string") {
|
|
293
293
|
return { next: () => null };
|
|
294
294
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -303,7 +302,8 @@ async function $do(
|
|
|
303
302
|
>;
|
|
304
303
|
"~next"?: { cursor: string };
|
|
305
304
|
} => {
|
|
306
|
-
const nextCursor =
|
|
305
|
+
const nextCursor =
|
|
306
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
307
307
|
if (typeof nextCursor !== "string") {
|
|
308
308
|
return { next: () => null };
|
|
309
309
|
}
|
package/src/funcs/reportsList.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -284,7 +283,8 @@ async function $do(
|
|
|
284
283
|
>;
|
|
285
284
|
"~next"?: { cursor: string };
|
|
286
285
|
} => {
|
|
287
|
-
const nextCursor =
|
|
286
|
+
const nextCursor =
|
|
287
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
288
288
|
if (typeof nextCursor !== "string") {
|
|
289
289
|
return { next: () => null };
|
|
290
290
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { Gr4vyCore } from "../core.js";
|
|
6
|
-
import { dlv } from "../lib/dlv.js";
|
|
7
6
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
7
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
8
|
import * as M from "../lib/matchers.js";
|
|
@@ -295,7 +294,8 @@ async function $do(
|
|
|
295
294
|
>;
|
|
296
295
|
"~next"?: { cursor: string };
|
|
297
296
|
} => {
|
|
298
|
-
const nextCursor =
|
|
297
|
+
const nextCursor =
|
|
298
|
+
(responseData as { next_cursor?: unknown | null }).next_cursor;
|
|
299
299
|
if (typeof nextCursor !== "string") {
|
|
300
300
|
return { next: () => null };
|
|
301
301
|
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Gr4vyCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import { Gr4vyError } from "../models/errors/gr4vyerror.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/httpclienterrors.js";
|
|
23
|
+
import * as errors from "../models/errors/index.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get transaction capture
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Retrieve a specific capture for a transaction by its unique identifier.
|
|
35
|
+
*/
|
|
36
|
+
export function transactionsCapturesGet(
|
|
37
|
+
client: Gr4vyCore,
|
|
38
|
+
transactionId: string,
|
|
39
|
+
captureId: string,
|
|
40
|
+
merchantAccountId?: string | null | undefined,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): APIPromise<
|
|
43
|
+
Result<
|
|
44
|
+
components.Capture,
|
|
45
|
+
| errors.Error400
|
|
46
|
+
| errors.Error401
|
|
47
|
+
| errors.Error403
|
|
48
|
+
| errors.Error404
|
|
49
|
+
| errors.Error405
|
|
50
|
+
| errors.Error409
|
|
51
|
+
| errors.HTTPValidationError
|
|
52
|
+
| errors.Error425
|
|
53
|
+
| errors.Error429
|
|
54
|
+
| errors.Error500
|
|
55
|
+
| errors.Error502
|
|
56
|
+
| errors.Error504
|
|
57
|
+
| Gr4vyError
|
|
58
|
+
| ResponseValidationError
|
|
59
|
+
| ConnectionError
|
|
60
|
+
| RequestAbortedError
|
|
61
|
+
| RequestTimeoutError
|
|
62
|
+
| InvalidRequestError
|
|
63
|
+
| UnexpectedClientError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
>
|
|
66
|
+
> {
|
|
67
|
+
return new APIPromise($do(
|
|
68
|
+
client,
|
|
69
|
+
transactionId,
|
|
70
|
+
captureId,
|
|
71
|
+
merchantAccountId,
|
|
72
|
+
options,
|
|
73
|
+
));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function $do(
|
|
77
|
+
client: Gr4vyCore,
|
|
78
|
+
transactionId: string,
|
|
79
|
+
captureId: string,
|
|
80
|
+
merchantAccountId?: string | null | undefined,
|
|
81
|
+
options?: RequestOptions,
|
|
82
|
+
): Promise<
|
|
83
|
+
[
|
|
84
|
+
Result<
|
|
85
|
+
components.Capture,
|
|
86
|
+
| errors.Error400
|
|
87
|
+
| errors.Error401
|
|
88
|
+
| errors.Error403
|
|
89
|
+
| errors.Error404
|
|
90
|
+
| errors.Error405
|
|
91
|
+
| errors.Error409
|
|
92
|
+
| errors.HTTPValidationError
|
|
93
|
+
| errors.Error425
|
|
94
|
+
| errors.Error429
|
|
95
|
+
| errors.Error500
|
|
96
|
+
| errors.Error502
|
|
97
|
+
| errors.Error504
|
|
98
|
+
| Gr4vyError
|
|
99
|
+
| ResponseValidationError
|
|
100
|
+
| ConnectionError
|
|
101
|
+
| RequestAbortedError
|
|
102
|
+
| RequestTimeoutError
|
|
103
|
+
| InvalidRequestError
|
|
104
|
+
| UnexpectedClientError
|
|
105
|
+
| SDKValidationError
|
|
106
|
+
>,
|
|
107
|
+
APICall,
|
|
108
|
+
]
|
|
109
|
+
> {
|
|
110
|
+
const input: operations.GetTransactionCaptureRequest = {
|
|
111
|
+
transactionId: transactionId,
|
|
112
|
+
captureId: captureId,
|
|
113
|
+
merchantAccountId: merchantAccountId,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const parsed = safeParse(
|
|
117
|
+
input,
|
|
118
|
+
(value) =>
|
|
119
|
+
operations.GetTransactionCaptureRequest$outboundSchema.parse(value),
|
|
120
|
+
"Input validation failed",
|
|
121
|
+
);
|
|
122
|
+
if (!parsed.ok) {
|
|
123
|
+
return [parsed, { status: "invalid" }];
|
|
124
|
+
}
|
|
125
|
+
const payload = parsed.value;
|
|
126
|
+
const body = null;
|
|
127
|
+
|
|
128
|
+
const pathParams = {
|
|
129
|
+
capture_id: encodeSimple("capture_id", payload.capture_id, {
|
|
130
|
+
explode: false,
|
|
131
|
+
charEncoding: "percent",
|
|
132
|
+
}),
|
|
133
|
+
transaction_id: encodeSimple("transaction_id", payload.transaction_id, {
|
|
134
|
+
explode: false,
|
|
135
|
+
charEncoding: "percent",
|
|
136
|
+
}),
|
|
137
|
+
};
|
|
138
|
+
const path = pathToFunc(
|
|
139
|
+
"/transactions/{transaction_id}/captures/{capture_id}",
|
|
140
|
+
)(pathParams);
|
|
141
|
+
|
|
142
|
+
const headers = new Headers(compactMap({
|
|
143
|
+
Accept: "application/json",
|
|
144
|
+
"x-gr4vy-merchant-account-id": encodeSimple(
|
|
145
|
+
"x-gr4vy-merchant-account-id",
|
|
146
|
+
payload.merchantAccountId ?? client._options.merchantAccountId,
|
|
147
|
+
{ explode: false, charEncoding: "none" },
|
|
148
|
+
),
|
|
149
|
+
}));
|
|
150
|
+
|
|
151
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
152
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
153
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
154
|
+
|
|
155
|
+
const context = {
|
|
156
|
+
options: client._options,
|
|
157
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
158
|
+
operationID: "get_transaction_capture",
|
|
159
|
+
oAuth2Scopes: null,
|
|
160
|
+
|
|
161
|
+
resolvedSecurity: requestSecurity,
|
|
162
|
+
|
|
163
|
+
securitySource: client._options.bearerAuth,
|
|
164
|
+
retryConfig: options?.retries
|
|
165
|
+
|| client._options.retryConfig
|
|
166
|
+
|| {
|
|
167
|
+
strategy: "backoff",
|
|
168
|
+
backoff: {
|
|
169
|
+
initialInterval: 200,
|
|
170
|
+
maxInterval: 200,
|
|
171
|
+
exponent: 1,
|
|
172
|
+
maxElapsedTime: 1000,
|
|
173
|
+
},
|
|
174
|
+
retryConnectionErrors: true,
|
|
175
|
+
}
|
|
176
|
+
|| { strategy: "none" },
|
|
177
|
+
retryCodes: options?.retryCodes || ["5XX"],
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const requestRes = client._createRequest(context, {
|
|
181
|
+
security: requestSecurity,
|
|
182
|
+
method: "GET",
|
|
183
|
+
baseURL: options?.serverURL,
|
|
184
|
+
path: path,
|
|
185
|
+
headers: headers,
|
|
186
|
+
body: body,
|
|
187
|
+
userAgent: client._options.userAgent,
|
|
188
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
189
|
+
}, options);
|
|
190
|
+
if (!requestRes.ok) {
|
|
191
|
+
return [requestRes, { status: "invalid" }];
|
|
192
|
+
}
|
|
193
|
+
const req = requestRes.value;
|
|
194
|
+
|
|
195
|
+
const doResult = await client._do(req, {
|
|
196
|
+
context,
|
|
197
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
198
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
199
|
+
retryConfig: context.retryConfig,
|
|
200
|
+
retryCodes: context.retryCodes,
|
|
201
|
+
});
|
|
202
|
+
if (!doResult.ok) {
|
|
203
|
+
return [doResult, { status: "request-error", request: req }];
|
|
204
|
+
}
|
|
205
|
+
const response = doResult.value;
|
|
206
|
+
|
|
207
|
+
const responseFields = {
|
|
208
|
+
HttpMeta: { Response: response, Request: req },
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const [result] = await M.match<
|
|
212
|
+
components.Capture,
|
|
213
|
+
| errors.Error400
|
|
214
|
+
| errors.Error401
|
|
215
|
+
| errors.Error403
|
|
216
|
+
| errors.Error404
|
|
217
|
+
| errors.Error405
|
|
218
|
+
| errors.Error409
|
|
219
|
+
| errors.HTTPValidationError
|
|
220
|
+
| errors.Error425
|
|
221
|
+
| errors.Error429
|
|
222
|
+
| errors.Error500
|
|
223
|
+
| errors.Error502
|
|
224
|
+
| errors.Error504
|
|
225
|
+
| Gr4vyError
|
|
226
|
+
| ResponseValidationError
|
|
227
|
+
| ConnectionError
|
|
228
|
+
| RequestAbortedError
|
|
229
|
+
| RequestTimeoutError
|
|
230
|
+
| InvalidRequestError
|
|
231
|
+
| UnexpectedClientError
|
|
232
|
+
| SDKValidationError
|
|
233
|
+
>(
|
|
234
|
+
M.json(200, components.Capture$inboundSchema),
|
|
235
|
+
M.jsonErr(400, errors.Error400$inboundSchema),
|
|
236
|
+
M.jsonErr(401, errors.Error401$inboundSchema),
|
|
237
|
+
M.jsonErr(403, errors.Error403$inboundSchema),
|
|
238
|
+
M.jsonErr(404, errors.Error404$inboundSchema),
|
|
239
|
+
M.jsonErr(405, errors.Error405$inboundSchema),
|
|
240
|
+
M.jsonErr(409, errors.Error409$inboundSchema),
|
|
241
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
242
|
+
M.jsonErr(425, errors.Error425$inboundSchema),
|
|
243
|
+
M.jsonErr(429, errors.Error429$inboundSchema),
|
|
244
|
+
M.jsonErr(500, errors.Error500$inboundSchema),
|
|
245
|
+
M.jsonErr(502, errors.Error502$inboundSchema),
|
|
246
|
+
M.jsonErr(504, errors.Error504$inboundSchema),
|
|
247
|
+
M.fail("4XX"),
|
|
248
|
+
M.fail("5XX"),
|
|
249
|
+
)(response, req, { extraFields: responseFields });
|
|
250
|
+
if (!result.ok) {
|
|
251
|
+
return [result, { status: "complete", request: req, response }];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return [result, { status: "complete", request: req, response }];
|
|
255
|
+
}
|