@gr4vy/sdk 2.2.0 → 2.2.1
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/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/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- 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/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/transactionsCapturesGet.ts +255 -0
- package/src/funcs/transactionsCapturesList.ts +247 -0
- package/src/lib/config.ts +2 -2
- 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/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
|
@@ -46,6 +46,8 @@ export * from "./buyercreate.js";
|
|
|
46
46
|
export * from "./buyers.js";
|
|
47
47
|
export * from "./buyerupdate.js";
|
|
48
48
|
export * from "./cancelstatus.js";
|
|
49
|
+
export * from "./capture.js";
|
|
50
|
+
export * from "./capturecollection.js";
|
|
49
51
|
export * from "./capturestatus.js";
|
|
50
52
|
export * from "./cardpaymentmethodcreate.js";
|
|
51
53
|
export * from "./cardscheme.js";
|
|
@@ -31,6 +31,14 @@ export type TransactionCaptureCreate = {
|
|
|
31
31
|
* An array of cart items that represents the line items of this capture.
|
|
32
32
|
*/
|
|
33
33
|
cartItems?: Array<CartItem> | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Whether this is marked as the final capture for the associated transaction. Must be `true` or omitted when multi-capture is not enabled; a value of `false` is only valid when multi-capture is available on the connection.
|
|
36
|
+
*/
|
|
37
|
+
final?: boolean | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* An external identifier that can be used to match the capture against your own records.
|
|
40
|
+
*/
|
|
41
|
+
externalIdentifier?: string | null | undefined;
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
/** @internal */
|
|
@@ -38,6 +46,8 @@ export type TransactionCaptureCreate$Outbound = {
|
|
|
38
46
|
amount?: number | null | undefined;
|
|
39
47
|
airline?: Airline$Outbound | null | undefined;
|
|
40
48
|
cart_items?: Array<CartItem$Outbound> | null | undefined;
|
|
49
|
+
final: boolean;
|
|
50
|
+
external_identifier?: string | null | undefined;
|
|
41
51
|
};
|
|
42
52
|
|
|
43
53
|
/** @internal */
|
|
@@ -49,9 +59,12 @@ export const TransactionCaptureCreate$outboundSchema: z.ZodType<
|
|
|
49
59
|
amount: z.nullable(z.number().int()).optional(),
|
|
50
60
|
airline: z.nullable(Airline$outboundSchema).optional(),
|
|
51
61
|
cartItems: z.nullable(z.array(CartItem$outboundSchema)).optional(),
|
|
62
|
+
final: z.boolean().default(true),
|
|
63
|
+
externalIdentifier: z.nullable(z.string()).optional(),
|
|
52
64
|
}).transform((v) => {
|
|
53
65
|
return remap$(v, {
|
|
54
66
|
cartItems: "cart_items",
|
|
67
|
+
externalIdentifier: "external_identifier",
|
|
55
68
|
});
|
|
56
69
|
});
|
|
57
70
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type GetTransactionCaptureGlobals = {
|
|
9
|
+
merchantAccountId?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type GetTransactionCaptureRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* The unique identifier of the transaction.
|
|
15
|
+
*/
|
|
16
|
+
transactionId: string;
|
|
17
|
+
/**
|
|
18
|
+
* The unique identifier of the capture.
|
|
19
|
+
*/
|
|
20
|
+
captureId: string;
|
|
21
|
+
/**
|
|
22
|
+
* The ID of the merchant account to use for this request.
|
|
23
|
+
*/
|
|
24
|
+
merchantAccountId?: string | null | undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type GetTransactionCaptureRequest$Outbound = {
|
|
29
|
+
transaction_id: string;
|
|
30
|
+
capture_id: string;
|
|
31
|
+
merchantAccountId?: string | null | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const GetTransactionCaptureRequest$outboundSchema: z.ZodType<
|
|
36
|
+
GetTransactionCaptureRequest$Outbound,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
GetTransactionCaptureRequest
|
|
39
|
+
> = z.object({
|
|
40
|
+
transactionId: z.string(),
|
|
41
|
+
captureId: z.string(),
|
|
42
|
+
merchantAccountId: z.nullable(z.string()).optional(),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
transactionId: "transaction_id",
|
|
46
|
+
captureId: "capture_id",
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export function getTransactionCaptureRequestToJSON(
|
|
51
|
+
getTransactionCaptureRequest: GetTransactionCaptureRequest,
|
|
52
|
+
): string {
|
|
53
|
+
return JSON.stringify(
|
|
54
|
+
GetTransactionCaptureRequest$outboundSchema.parse(
|
|
55
|
+
getTransactionCaptureRequest,
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -60,6 +60,7 @@ export * from "./getreport.js";
|
|
|
60
60
|
export * from "./getreportexecution.js";
|
|
61
61
|
export * from "./getthreedsscenario.js";
|
|
62
62
|
export * from "./gettransaction.js";
|
|
63
|
+
export * from "./gettransactioncapture.js";
|
|
63
64
|
export * from "./gettransactionrefund.js";
|
|
64
65
|
export * from "./gettransactionsettlement.js";
|
|
65
66
|
export * from "./listallreportexecutions.js";
|
|
@@ -85,6 +86,7 @@ export * from "./listreportexecutions.js";
|
|
|
85
86
|
export * from "./listreports.js";
|
|
86
87
|
export * from "./listthreedsconfigurations.js";
|
|
87
88
|
export * from "./listtransactionactions.js";
|
|
89
|
+
export * from "./listtransactioncaptures.js";
|
|
88
90
|
export * from "./listtransactionevents.js";
|
|
89
91
|
export * from "./listtransactionrefunds.js";
|
|
90
92
|
export * from "./listtransactions.js";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type ListTransactionCapturesGlobals = {
|
|
9
|
+
merchantAccountId?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type ListTransactionCapturesRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* The unique identifier of the transaction.
|
|
15
|
+
*/
|
|
16
|
+
transactionId: string;
|
|
17
|
+
/**
|
|
18
|
+
* The ID of the merchant account to use for this request.
|
|
19
|
+
*/
|
|
20
|
+
merchantAccountId?: string | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type ListTransactionCapturesRequest$Outbound = {
|
|
25
|
+
transaction_id: string;
|
|
26
|
+
merchantAccountId?: string | null | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const ListTransactionCapturesRequest$outboundSchema: z.ZodType<
|
|
31
|
+
ListTransactionCapturesRequest$Outbound,
|
|
32
|
+
z.ZodTypeDef,
|
|
33
|
+
ListTransactionCapturesRequest
|
|
34
|
+
> = z.object({
|
|
35
|
+
transactionId: z.string(),
|
|
36
|
+
merchantAccountId: z.nullable(z.string()).optional(),
|
|
37
|
+
}).transform((v) => {
|
|
38
|
+
return remap$(v, {
|
|
39
|
+
transactionId: "transaction_id",
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export function listTransactionCapturesRequestToJSON(
|
|
44
|
+
listTransactionCapturesRequest: ListTransactionCapturesRequest,
|
|
45
|
+
): string {
|
|
46
|
+
return JSON.stringify(
|
|
47
|
+
ListTransactionCapturesRequest$outboundSchema.parse(
|
|
48
|
+
listTransactionCapturesRequest,
|
|
49
|
+
),
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { transactionsCapturesGet } from "../funcs/transactionsCapturesGet.js";
|
|
6
|
+
import { transactionsCapturesList } from "../funcs/transactionsCapturesList.js";
|
|
7
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import * as components from "../models/components/index.js";
|
|
9
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
|
|
11
|
+
export class Captures extends ClientSDK {
|
|
12
|
+
/**
|
|
13
|
+
* List transaction captures
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* List all captures for a specific transaction.
|
|
17
|
+
*/
|
|
18
|
+
async list(
|
|
19
|
+
transactionId: string,
|
|
20
|
+
merchantAccountId?: string | null | undefined,
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<components.CaptureCollection> {
|
|
23
|
+
return unwrapAsync(transactionsCapturesList(
|
|
24
|
+
this,
|
|
25
|
+
transactionId,
|
|
26
|
+
merchantAccountId,
|
|
27
|
+
options,
|
|
28
|
+
));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get transaction capture
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* Retrieve a specific capture for a transaction by its unique identifier.
|
|
36
|
+
*/
|
|
37
|
+
async get(
|
|
38
|
+
transactionId: string,
|
|
39
|
+
captureId: string,
|
|
40
|
+
merchantAccountId?: string | null | undefined,
|
|
41
|
+
options?: RequestOptions,
|
|
42
|
+
): Promise<components.Capture> {
|
|
43
|
+
return unwrapAsync(transactionsCapturesGet(
|
|
44
|
+
this,
|
|
45
|
+
transactionId,
|
|
46
|
+
captureId,
|
|
47
|
+
merchantAccountId,
|
|
48
|
+
options,
|
|
49
|
+
));
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/sdk/transactions.ts
CHANGED
|
@@ -16,6 +16,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
16
16
|
import { unwrapAsync } from "../types/fp.js";
|
|
17
17
|
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
18
18
|
import { Actions } from "./actions.js";
|
|
19
|
+
import { Captures } from "./captures.js";
|
|
19
20
|
import { Events } from "./events.js";
|
|
20
21
|
import { Gr4vyRefunds } from "./gr4vyrefunds.js";
|
|
21
22
|
import { Settlements } from "./settlements.js";
|
|
@@ -41,6 +42,11 @@ export class Transactions extends ClientSDK {
|
|
|
41
42
|
return (this._settlements ??= new Settlements(this._options));
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
private _captures?: Captures;
|
|
46
|
+
get captures(): Captures {
|
|
47
|
+
return (this._captures ??= new Captures(this._options));
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
/**
|
|
45
51
|
* List transactions
|
|
46
52
|
*
|