@gr4vy/sdk 1.9.19 → 1.10.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 +11 -0
- package/examples/package-lock.json +1 -1
- package/funcs/merchantAccountsThreeDsConfigurationCreate.d.ts +18 -0
- package/funcs/merchantAccountsThreeDsConfigurationCreate.d.ts.map +1 -0
- package/funcs/merchantAccountsThreeDsConfigurationCreate.js +141 -0
- package/funcs/merchantAccountsThreeDsConfigurationCreate.js.map +1 -0
- package/funcs/merchantAccountsThreeDsConfigurationDelete.d.ts +17 -0
- package/funcs/merchantAccountsThreeDsConfigurationDelete.d.ts.map +1 -0
- package/funcs/merchantAccountsThreeDsConfigurationDelete.js +141 -0
- package/funcs/merchantAccountsThreeDsConfigurationDelete.js.map +1 -0
- package/funcs/merchantAccountsThreeDsConfigurationList.d.ts +18 -0
- package/funcs/merchantAccountsThreeDsConfigurationList.d.ts.map +1 -0
- package/funcs/merchantAccountsThreeDsConfigurationList.js +154 -0
- package/funcs/merchantAccountsThreeDsConfigurationList.js.map +1 -0
- package/funcs/merchantAccountsThreeDsConfigurationUpdate.d.ts +18 -0
- package/funcs/merchantAccountsThreeDsConfigurationUpdate.d.ts.map +1 -0
- package/funcs/merchantAccountsThreeDsConfigurationUpdate.js +143 -0
- package/funcs/merchantAccountsThreeDsConfigurationUpdate.js.map +1 -0
- package/funcs/transactionsCapture.d.ts +1 -2
- package/funcs/transactionsCapture.d.ts.map +1 -1
- package/funcs/transactionsCapture.js +6 -11
- package/funcs/transactionsCapture.js.map +1 -1
- package/funcs/transactionsVoid.d.ts +1 -1
- package/funcs/transactionsVoid.d.ts.map +1 -1
- package/funcs/transactionsVoid.js +6 -4
- package/funcs/transactionsVoid.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/index.d.ts +4 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +4 -0
- package/models/components/index.js.map +1 -1
- package/models/components/merchantaccountthreedsconfiguration.d.ts +62 -0
- package/models/components/merchantaccountthreedsconfiguration.d.ts.map +1 -0
- package/models/components/merchantaccountthreedsconfiguration.js +77 -0
- package/models/components/merchantaccountthreedsconfiguration.js.map +1 -0
- package/models/components/merchantaccountthreedsconfigurationcreate.d.ts +54 -0
- package/models/components/merchantaccountthreedsconfigurationcreate.d.ts.map +1 -0
- package/models/components/merchantaccountthreedsconfigurationcreate.js +68 -0
- package/models/components/merchantaccountthreedsconfigurationcreate.js.map +1 -0
- package/models/components/merchantaccountthreedsconfigurations.d.ts +14 -0
- package/models/components/merchantaccountthreedsconfigurations.d.ts.map +1 -0
- package/models/components/merchantaccountthreedsconfigurations.js +51 -0
- package/models/components/merchantaccountthreedsconfigurations.js.map +1 -0
- package/models/components/merchantaccountthreedsconfigurationupdate.d.ts +57 -0
- package/models/components/merchantaccountthreedsconfigurationupdate.d.ts.map +1 -0
- package/models/components/merchantaccountthreedsconfigurationupdate.js +68 -0
- package/models/components/merchantaccountthreedsconfigurationupdate.js.map +1 -0
- package/models/operations/capturetransaction.d.ts +8 -3
- package/models/operations/capturetransaction.d.ts.map +1 -1
- package/models/operations/capturetransaction.js +7 -5
- package/models/operations/capturetransaction.js.map +1 -1
- package/models/operations/createthreedsconfiguration.d.ts +18 -0
- package/models/operations/createthreedsconfiguration.d.ts.map +1 -0
- package/models/operations/createthreedsconfiguration.js +57 -0
- package/models/operations/createthreedsconfiguration.js.map +1 -0
- package/models/operations/deletethreedsconfiguration.d.ts +20 -0
- package/models/operations/deletethreedsconfiguration.d.ts.map +1 -0
- package/models/operations/deletethreedsconfiguration.js +56 -0
- package/models/operations/deletethreedsconfiguration.js.map +1 -0
- package/models/operations/editthreedsconfiguration.d.ts +23 -0
- package/models/operations/editthreedsconfiguration.d.ts.map +1 -0
- package/models/operations/editthreedsconfiguration.js +59 -0
- package/models/operations/editthreedsconfiguration.js.map +1 -0
- package/models/operations/getmerchantaccount.d.ts +1 -1
- package/models/operations/index.d.ts +4 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +4 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listthreedsconfigurations.d.ts +20 -0
- package/models/operations/listthreedsconfigurations.d.ts.map +1 -0
- package/models/operations/listthreedsconfigurations.js +55 -0
- package/models/operations/listthreedsconfigurations.js.map +1 -0
- package/models/operations/updatemerchantaccount.d.ts +1 -1
- package/models/operations/voidtransaction.d.ts +8 -3
- package/models/operations/voidtransaction.d.ts.map +1 -1
- package/models/operations/voidtransaction.js +7 -5
- package/models/operations/voidtransaction.js.map +1 -1
- package/package.json +1 -1
- package/sdk/merchantaccounts.d.ts +3 -0
- package/sdk/merchantaccounts.d.ts.map +1 -1
- package/sdk/merchantaccounts.js +4 -0
- package/sdk/merchantaccounts.js.map +1 -1
- package/sdk/threedsconfiguration.d.ts +33 -0
- package/sdk/threedsconfiguration.d.ts.map +1 -0
- package/sdk/threedsconfiguration.js +52 -0
- package/sdk/threedsconfiguration.js.map +1 -0
- package/sdk/transactions.d.ts +2 -2
- package/sdk/transactions.d.ts.map +1 -1
- package/sdk/transactions.js +4 -4
- package/sdk/transactions.js.map +1 -1
- package/src/funcs/merchantAccountsThreeDsConfigurationCreate.ts +255 -0
- package/src/funcs/merchantAccountsThreeDsConfigurationDelete.ts +252 -0
- package/src/funcs/merchantAccountsThreeDsConfigurationList.ts +262 -0
- package/src/funcs/merchantAccountsThreeDsConfigurationUpdate.ts +264 -0
- package/src/funcs/transactionsCapture.ts +13 -25
- package/src/funcs/transactionsVoid.ts +13 -4
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +4 -0
- package/src/models/components/merchantaccountthreedsconfiguration.ts +110 -0
- package/src/models/components/merchantaccountthreedsconfigurationcreate.ts +91 -0
- package/src/models/components/merchantaccountthreedsconfigurations.ts +39 -0
- package/src/models/components/merchantaccountthreedsconfigurationupdate.ts +94 -0
- package/src/models/operations/capturetransaction.ts +14 -7
- package/src/models/operations/createthreedsconfiguration.ts +50 -0
- package/src/models/operations/deletethreedsconfiguration.ts +48 -0
- package/src/models/operations/editthreedsconfiguration.ts +57 -0
- package/src/models/operations/getmerchantaccount.ts +1 -1
- package/src/models/operations/index.ts +4 -0
- package/src/models/operations/listthreedsconfigurations.ts +47 -0
- package/src/models/operations/updatemerchantaccount.ts +1 -1
- package/src/models/operations/voidtransaction.ts +19 -7
- package/src/sdk/merchantaccounts.ts +8 -0
- package/src/sdk/threedsconfiguration.ts +93 -0
- package/src/sdk/transactions.ts +6 -10
|
@@ -26,12 +26,16 @@ export type VoidTransactionRequest = {
|
|
|
26
26
|
* The ID of the merchant account to use for this request.
|
|
27
27
|
*/
|
|
28
28
|
merchantAccountId?: string | null | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* A unique key that identifies this request. Providing this header will make this an idempotent request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions.
|
|
31
|
+
*/
|
|
32
|
+
idempotencyKey?: string | null | undefined;
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
/**
|
|
32
36
|
* Successful Response
|
|
33
37
|
*/
|
|
34
|
-
export type
|
|
38
|
+
export type VoidTransactionResponse200VoidTransaction =
|
|
35
39
|
| components.Transaction
|
|
36
40
|
| components.TransactionVoid;
|
|
37
41
|
|
|
@@ -40,6 +44,7 @@ export type VoidTransactionRequest$Outbound = {
|
|
|
40
44
|
transaction_id: string;
|
|
41
45
|
prefer?: Array<string> | null | undefined;
|
|
42
46
|
merchantAccountId?: string | null | undefined;
|
|
47
|
+
"idempotency-key"?: string | null | undefined;
|
|
43
48
|
};
|
|
44
49
|
|
|
45
50
|
/** @internal */
|
|
@@ -51,9 +56,11 @@ export const VoidTransactionRequest$outboundSchema: z.ZodType<
|
|
|
51
56
|
transactionId: z.string(),
|
|
52
57
|
prefer: z.nullable(z.array(z.string())).optional(),
|
|
53
58
|
merchantAccountId: z.nullable(z.string()).optional(),
|
|
59
|
+
idempotencyKey: z.nullable(z.string()).optional(),
|
|
54
60
|
}).transform((v) => {
|
|
55
61
|
return remap$(v, {
|
|
56
62
|
transactionId: "transaction_id",
|
|
63
|
+
idempotencyKey: "idempotency-key",
|
|
57
64
|
});
|
|
58
65
|
});
|
|
59
66
|
|
|
@@ -66,8 +73,8 @@ export function voidTransactionRequestToJSON(
|
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
/** @internal */
|
|
69
|
-
export const
|
|
70
|
-
|
|
76
|
+
export const VoidTransactionResponse200VoidTransaction$inboundSchema: z.ZodType<
|
|
77
|
+
VoidTransactionResponse200VoidTransaction,
|
|
71
78
|
z.ZodTypeDef,
|
|
72
79
|
unknown
|
|
73
80
|
> = z.union([
|
|
@@ -75,13 +82,18 @@ export const VoidTransactionResponseVoidTransaction$inboundSchema: z.ZodType<
|
|
|
75
82
|
components.TransactionVoid$inboundSchema,
|
|
76
83
|
]);
|
|
77
84
|
|
|
78
|
-
export function
|
|
85
|
+
export function voidTransactionResponse200VoidTransactionFromJSON(
|
|
79
86
|
jsonString: string,
|
|
80
|
-
): SafeParseResult<
|
|
87
|
+
): SafeParseResult<
|
|
88
|
+
VoidTransactionResponse200VoidTransaction,
|
|
89
|
+
SDKValidationError
|
|
90
|
+
> {
|
|
81
91
|
return safeParse(
|
|
82
92
|
jsonString,
|
|
83
93
|
(x) =>
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
VoidTransactionResponse200VoidTransaction$inboundSchema.parse(
|
|
95
|
+
JSON.parse(x),
|
|
96
|
+
),
|
|
97
|
+
`Failed to parse 'VoidTransactionResponse200VoidTransaction' from JSON`,
|
|
86
98
|
);
|
|
87
99
|
}
|
|
@@ -11,8 +11,16 @@ import * as components from "../models/components/index.js";
|
|
|
11
11
|
import * as operations from "../models/operations/index.js";
|
|
12
12
|
import { unwrapAsync } from "../types/fp.js";
|
|
13
13
|
import { PageIterator, unwrapResultIterator } from "../types/operations.js";
|
|
14
|
+
import { ThreeDsConfiguration } from "./threedsconfiguration.js";
|
|
14
15
|
|
|
15
16
|
export class MerchantAccounts extends ClientSDK {
|
|
17
|
+
private _threeDsConfiguration?: ThreeDsConfiguration;
|
|
18
|
+
get threeDsConfiguration(): ThreeDsConfiguration {
|
|
19
|
+
return (this._threeDsConfiguration ??= new ThreeDsConfiguration(
|
|
20
|
+
this._options,
|
|
21
|
+
));
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
* List all merchant accounts
|
|
18
26
|
*
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { merchantAccountsThreeDsConfigurationCreate } from "../funcs/merchantAccountsThreeDsConfigurationCreate.js";
|
|
6
|
+
import { merchantAccountsThreeDsConfigurationDelete } from "../funcs/merchantAccountsThreeDsConfigurationDelete.js";
|
|
7
|
+
import { merchantAccountsThreeDsConfigurationList } from "../funcs/merchantAccountsThreeDsConfigurationList.js";
|
|
8
|
+
import { merchantAccountsThreeDsConfigurationUpdate } from "../funcs/merchantAccountsThreeDsConfigurationUpdate.js";
|
|
9
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import * as components from "../models/components/index.js";
|
|
11
|
+
import { unwrapAsync } from "../types/fp.js";
|
|
12
|
+
|
|
13
|
+
export class ThreeDsConfiguration extends ClientSDK {
|
|
14
|
+
/**
|
|
15
|
+
* Create 3DS configuration for merchant
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Create a new 3DS configuration for a merchant account.
|
|
19
|
+
*/
|
|
20
|
+
async create(
|
|
21
|
+
merchantAccountThreeDSConfigurationCreate:
|
|
22
|
+
components.MerchantAccountThreeDSConfigurationCreate,
|
|
23
|
+
merchantAccountId: string,
|
|
24
|
+
options?: RequestOptions,
|
|
25
|
+
): Promise<components.MerchantAccountThreeDSConfiguration> {
|
|
26
|
+
return unwrapAsync(merchantAccountsThreeDsConfigurationCreate(
|
|
27
|
+
this,
|
|
28
|
+
merchantAccountThreeDSConfigurationCreate,
|
|
29
|
+
merchantAccountId,
|
|
30
|
+
options,
|
|
31
|
+
));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* List 3DS configurations for merchant
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* List all 3DS configurations for a merchant account.
|
|
39
|
+
*/
|
|
40
|
+
async list(
|
|
41
|
+
merchantAccountId: string,
|
|
42
|
+
currency?: string | null | undefined,
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): Promise<components.MerchantAccountThreeDSConfigurations> {
|
|
45
|
+
return unwrapAsync(merchantAccountsThreeDsConfigurationList(
|
|
46
|
+
this,
|
|
47
|
+
merchantAccountId,
|
|
48
|
+
currency,
|
|
49
|
+
options,
|
|
50
|
+
));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Edit 3DS configuration
|
|
55
|
+
*
|
|
56
|
+
* @remarks
|
|
57
|
+
* Update the 3DS configuration for a merchant account.
|
|
58
|
+
*/
|
|
59
|
+
async update(
|
|
60
|
+
merchantAccountThreeDSConfigurationUpdate:
|
|
61
|
+
components.MerchantAccountThreeDSConfigurationUpdate,
|
|
62
|
+
merchantAccountId: string,
|
|
63
|
+
threeDsConfigurationId: string,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<components.MerchantAccountThreeDSConfiguration> {
|
|
66
|
+
return unwrapAsync(merchantAccountsThreeDsConfigurationUpdate(
|
|
67
|
+
this,
|
|
68
|
+
merchantAccountThreeDSConfigurationUpdate,
|
|
69
|
+
merchantAccountId,
|
|
70
|
+
threeDsConfigurationId,
|
|
71
|
+
options,
|
|
72
|
+
));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Delete 3DS configuration for a merchant
|
|
77
|
+
*
|
|
78
|
+
* @remarks
|
|
79
|
+
* Delete a 3DS configuration for a merchant account.
|
|
80
|
+
*/
|
|
81
|
+
async delete(
|
|
82
|
+
merchantAccountId: string,
|
|
83
|
+
threeDsConfigurationId: string,
|
|
84
|
+
options?: RequestOptions,
|
|
85
|
+
): Promise<void> {
|
|
86
|
+
return unwrapAsync(merchantAccountsThreeDsConfigurationDelete(
|
|
87
|
+
this,
|
|
88
|
+
merchantAccountId,
|
|
89
|
+
threeDsConfigurationId,
|
|
90
|
+
options,
|
|
91
|
+
));
|
|
92
|
+
}
|
|
93
|
+
}
|
package/src/sdk/transactions.ts
CHANGED
|
@@ -130,18 +130,12 @@ export class Transactions extends ClientSDK {
|
|
|
130
130
|
* Captures a previously authorized transaction. You can capture the full or a partial amount, as long as it does not exceed the authorized amount (unless over-capture is enabled).
|
|
131
131
|
*/
|
|
132
132
|
async capture(
|
|
133
|
-
|
|
134
|
-
transactionId: string,
|
|
135
|
-
prefer?: Array<string> | null | undefined,
|
|
136
|
-
merchantAccountId?: string | null | undefined,
|
|
133
|
+
request: operations.CaptureTransactionRequest,
|
|
137
134
|
options?: RequestOptions,
|
|
138
|
-
): Promise<operations.
|
|
135
|
+
): Promise<operations.CaptureTransactionResponse200CaptureTransaction> {
|
|
139
136
|
return unwrapAsync(transactionsCapture(
|
|
140
137
|
this,
|
|
141
|
-
|
|
142
|
-
transactionId,
|
|
143
|
-
prefer,
|
|
144
|
-
merchantAccountId,
|
|
138
|
+
request,
|
|
145
139
|
options,
|
|
146
140
|
));
|
|
147
141
|
}
|
|
@@ -156,13 +150,15 @@ export class Transactions extends ClientSDK {
|
|
|
156
150
|
transactionId: string,
|
|
157
151
|
prefer?: Array<string> | null | undefined,
|
|
158
152
|
merchantAccountId?: string | null | undefined,
|
|
153
|
+
idempotencyKey?: string | null | undefined,
|
|
159
154
|
options?: RequestOptions,
|
|
160
|
-
): Promise<operations.
|
|
155
|
+
): Promise<operations.VoidTransactionResponse200VoidTransaction> {
|
|
161
156
|
return unwrapAsync(transactionsVoid(
|
|
162
157
|
this,
|
|
163
158
|
transactionId,
|
|
164
159
|
prefer,
|
|
165
160
|
merchantAccountId,
|
|
161
|
+
idempotencyKey,
|
|
166
162
|
options,
|
|
167
163
|
));
|
|
168
164
|
}
|