@gr4vy/sdk 2.4.3 → 2.4.5
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 +2 -0
- package/funcs/transactionsIncrementAuthorization.d.ts +18 -0
- package/funcs/transactionsIncrementAuthorization.d.ts.map +1 -0
- package/funcs/transactionsIncrementAuthorization.js +134 -0
- package/funcs/transactionsIncrementAuthorization.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/incrementalauthorizationstatus.d.ts +10 -0
- package/models/components/incrementalauthorizationstatus.d.ts.map +1 -0
- package/models/components/incrementalauthorizationstatus.js +47 -0
- package/models/components/incrementalauthorizationstatus.js.map +1 -0
- package/models/components/index.d.ts +3 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +3 -0
- package/models/components/index.js.map +1 -1
- package/models/components/transactionauthorizationincrement.d.ts +32 -0
- package/models/components/transactionauthorizationincrement.d.ts.map +1 -0
- package/models/components/transactionauthorizationincrement.js +63 -0
- package/models/components/transactionauthorizationincrement.js.map +1 -0
- package/models/components/transactionauthorizationincrementcreate.d.ts +15 -0
- package/models/components/transactionauthorizationincrementcreate.d.ts.map +1 -0
- package/models/components/transactionauthorizationincrementcreate.js +49 -0
- package/models/components/transactionauthorizationincrementcreate.js.map +1 -0
- package/models/components/worldpayvapoptions.d.ts +5 -0
- package/models/components/worldpayvapoptions.d.ts.map +1 -1
- package/models/components/worldpayvapoptions.js +1 -0
- package/models/components/worldpayvapoptions.js.map +1 -1
- package/models/operations/incrementtransactionauthorization.d.ts +31 -0
- package/models/operations/incrementtransactionauthorization.d.ts.map +1 -0
- package/models/operations/incrementtransactionauthorization.js +60 -0
- package/models/operations/incrementtransactionauthorization.js.map +1 -0
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/transactions.d.ts +7 -0
- package/sdk/transactions.d.ts.map +1 -1
- package/sdk/transactions.js +10 -0
- package/sdk/transactions.js.map +1 -1
- package/src/funcs/transactionsIncrementAuthorization.ts +260 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/incrementalauthorizationstatus.ts +22 -0
- package/src/models/components/index.ts +3 -0
- package/src/models/components/transactionauthorizationincrement.ts +69 -0
- package/src/models/components/transactionauthorizationincrementcreate.ts +37 -0
- package/src/models/components/worldpayvapoptions.ts +6 -0
- package/src/models/operations/incrementtransactionauthorization.ts +68 -0
- package/src/models/operations/index.ts +1 -0
- package/src/sdk/transactions.ts +25 -0
|
@@ -9,11 +9,16 @@ export type WorldpayVapOptions = {
|
|
|
9
9
|
* Overrides the default report group to pass to the Worldpay VAP API.
|
|
10
10
|
*/
|
|
11
11
|
reportGroup?: string | null | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Overrides the `orderId` passed to the Worldpay VAP API, which defaults to the Gr4vy transaction ID.
|
|
14
|
+
*/
|
|
15
|
+
orderId?: string | null | undefined;
|
|
12
16
|
};
|
|
13
17
|
|
|
14
18
|
/** @internal */
|
|
15
19
|
export type WorldpayVapOptions$Outbound = {
|
|
16
20
|
reportGroup?: string | null | undefined;
|
|
21
|
+
orderId?: string | null | undefined;
|
|
17
22
|
};
|
|
18
23
|
|
|
19
24
|
/** @internal */
|
|
@@ -23,6 +28,7 @@ export const WorldpayVapOptions$outboundSchema: z.ZodType<
|
|
|
23
28
|
WorldpayVapOptions
|
|
24
29
|
> = z.object({
|
|
25
30
|
reportGroup: z.nullable(z.string()).optional(),
|
|
31
|
+
orderId: z.nullable(z.string()).optional(),
|
|
26
32
|
});
|
|
27
33
|
|
|
28
34
|
export function worldpayVapOptionsToJSON(
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
import * as components from "../components/index.js";
|
|
8
|
+
|
|
9
|
+
export type IncrementTransactionAuthorizationGlobals = {
|
|
10
|
+
merchantAccountId?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type IncrementTransactionAuthorizationRequest = {
|
|
14
|
+
/**
|
|
15
|
+
* The unique identifier of the transaction.
|
|
16
|
+
*/
|
|
17
|
+
transactionId: string;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the merchant account to use for this request.
|
|
20
|
+
*/
|
|
21
|
+
merchantAccountId?: string | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* 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.
|
|
24
|
+
*/
|
|
25
|
+
idempotencyKey?: string | null | undefined;
|
|
26
|
+
transactionAuthorizationIncrementCreate:
|
|
27
|
+
components.TransactionAuthorizationIncrementCreate;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type IncrementTransactionAuthorizationRequest$Outbound = {
|
|
32
|
+
transaction_id: string;
|
|
33
|
+
merchantAccountId?: string | null | undefined;
|
|
34
|
+
"idempotency-key"?: string | null | undefined;
|
|
35
|
+
TransactionAuthorizationIncrementCreate:
|
|
36
|
+
components.TransactionAuthorizationIncrementCreate$Outbound;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const IncrementTransactionAuthorizationRequest$outboundSchema: z.ZodType<
|
|
41
|
+
IncrementTransactionAuthorizationRequest$Outbound,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
IncrementTransactionAuthorizationRequest
|
|
44
|
+
> = z.object({
|
|
45
|
+
transactionId: z.string(),
|
|
46
|
+
merchantAccountId: z.nullable(z.string()).optional(),
|
|
47
|
+
idempotencyKey: z.nullable(z.string()).optional(),
|
|
48
|
+
transactionAuthorizationIncrementCreate:
|
|
49
|
+
components.TransactionAuthorizationIncrementCreate$outboundSchema,
|
|
50
|
+
}).transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
transactionId: "transaction_id",
|
|
53
|
+
idempotencyKey: "idempotency-key",
|
|
54
|
+
transactionAuthorizationIncrementCreate:
|
|
55
|
+
"TransactionAuthorizationIncrementCreate",
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export function incrementTransactionAuthorizationRequestToJSON(
|
|
60
|
+
incrementTransactionAuthorizationRequest:
|
|
61
|
+
IncrementTransactionAuthorizationRequest,
|
|
62
|
+
): string {
|
|
63
|
+
return JSON.stringify(
|
|
64
|
+
IncrementTransactionAuthorizationRequest$outboundSchema.parse(
|
|
65
|
+
incrementTransactionAuthorizationRequest,
|
|
66
|
+
),
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -67,6 +67,7 @@ export * from "./gettransactioncapture.js";
|
|
|
67
67
|
export * from "./gettransactionrefund.js";
|
|
68
68
|
export * from "./gettransactionrefundsettlement.js";
|
|
69
69
|
export * from "./gettransactionsettlement.js";
|
|
70
|
+
export * from "./incrementtransactionauthorization.js";
|
|
70
71
|
export * from "./issuegiftcard.js";
|
|
71
72
|
export * from "./listallreportexecutions.js";
|
|
72
73
|
export * from "./listapikeypairs.js";
|
package/src/sdk/transactions.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { transactionsCancel } from "../funcs/transactionsCancel.js";
|
|
|
6
6
|
import { transactionsCapture } from "../funcs/transactionsCapture.js";
|
|
7
7
|
import { transactionsCreate } from "../funcs/transactionsCreate.js";
|
|
8
8
|
import { transactionsGet } from "../funcs/transactionsGet.js";
|
|
9
|
+
import { transactionsIncrementAuthorization } from "../funcs/transactionsIncrementAuthorization.js";
|
|
9
10
|
import { transactionsList } from "../funcs/transactionsList.js";
|
|
10
11
|
import { transactionsSync } from "../funcs/transactionsSync.js";
|
|
11
12
|
import { transactionsUpdate } from "../funcs/transactionsUpdate.js";
|
|
@@ -212,4 +213,28 @@ export class Transactions extends ClientSDK {
|
|
|
212
213
|
options,
|
|
213
214
|
));
|
|
214
215
|
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Increment transaction authorization
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* Increment the transaction authorization amount of a given transaction_id.
|
|
222
|
+
*/
|
|
223
|
+
async incrementAuthorization(
|
|
224
|
+
transactionAuthorizationIncrementCreate:
|
|
225
|
+
components.TransactionAuthorizationIncrementCreate,
|
|
226
|
+
transactionId: string,
|
|
227
|
+
merchantAccountId?: string | null | undefined,
|
|
228
|
+
idempotencyKey?: string | null | undefined,
|
|
229
|
+
options?: RequestOptions,
|
|
230
|
+
): Promise<components.TransactionAuthorizationIncrement> {
|
|
231
|
+
return unwrapAsync(transactionsIncrementAuthorization(
|
|
232
|
+
this,
|
|
233
|
+
transactionAuthorizationIncrementCreate,
|
|
234
|
+
transactionId,
|
|
235
|
+
merchantAccountId,
|
|
236
|
+
idempotencyKey,
|
|
237
|
+
options,
|
|
238
|
+
));
|
|
239
|
+
}
|
|
215
240
|
}
|