@gr4vy/sdk 1.1.13 → 1.1.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.
- package/docs/sdks/transactions/README.md +3 -2
- package/funcs/transactionsCapture.d.ts +2 -1
- package/funcs/transactionsCapture.d.ts.map +1 -1
- package/funcs/transactionsCapture.js +11 -7
- package/funcs/transactionsCapture.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/capturestatus.d.ts +24 -0
- package/models/components/capturestatus.d.ts.map +1 -0
- package/models/components/capturestatus.js +60 -0
- package/models/components/capturestatus.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/transactioncapture.d.ts +25 -10
- package/models/components/transactioncapture.d.ts.map +1 -1
- package/models/components/transactioncapture.js +25 -5
- package/models/components/transactioncapture.js.map +1 -1
- package/models/components/transactioncapturecreate.d.ts +41 -0
- package/models/components/transactioncapturecreate.d.ts.map +1 -0
- package/models/components/transactioncapturecreate.js +62 -0
- package/models/components/transactioncapturecreate.js.map +1 -0
- package/models/operations/capturetransaction.d.ts +31 -2
- package/models/operations/capturetransaction.d.ts.map +1 -1
- package/models/operations/capturetransaction.js +36 -5
- package/models/operations/capturetransaction.js.map +1 -1
- package/package.json +1 -1
- package/sdk/transactions.d.ts +1 -1
- package/sdk/transactions.d.ts.map +1 -1
- package/sdk/transactions.js +2 -2
- package/sdk/transactions.js.map +1 -1
- package/src/funcs/transactionsCapture.ts +20 -9
- package/src/lib/config.ts +3 -3
- package/src/models/components/capturestatus.ts +50 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/transactioncapture.ts +58 -18
- package/src/models/components/transactioncapturecreate.ts +85 -0
- package/src/models/operations/capturetransaction.ts +89 -6
- package/src/sdk/transactions.ts +5 -3
|
@@ -10,12 +10,20 @@ export type CaptureTransactionRequest = {
|
|
|
10
10
|
* The ID of the transaction
|
|
11
11
|
*/
|
|
12
12
|
transactionId: string;
|
|
13
|
+
/**
|
|
14
|
+
* The preferred resource type in the response.
|
|
15
|
+
*/
|
|
16
|
+
prefer?: string | null | undefined;
|
|
13
17
|
/**
|
|
14
18
|
* The ID of the merchant account to use for this request.
|
|
15
19
|
*/
|
|
16
20
|
merchantAccountId?: string | null | undefined;
|
|
17
|
-
|
|
21
|
+
transactionCaptureCreate: components.TransactionCaptureCreate;
|
|
18
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Successful Response
|
|
25
|
+
*/
|
|
26
|
+
export type CaptureTransactionResponseCaptureTransaction = components.Transaction | components.TransactionCapture;
|
|
19
27
|
/** @internal */
|
|
20
28
|
export declare const CaptureTransactionGlobals$inboundSchema: z.ZodType<CaptureTransactionGlobals, z.ZodTypeDef, unknown>;
|
|
21
29
|
/** @internal */
|
|
@@ -43,8 +51,9 @@ export declare const CaptureTransactionRequest$inboundSchema: z.ZodType<CaptureT
|
|
|
43
51
|
/** @internal */
|
|
44
52
|
export type CaptureTransactionRequest$Outbound = {
|
|
45
53
|
transaction_id: string;
|
|
54
|
+
prefer?: string | null | undefined;
|
|
46
55
|
merchantAccountId?: string | null | undefined;
|
|
47
|
-
|
|
56
|
+
TransactionCaptureCreate: components.TransactionCaptureCreate$Outbound;
|
|
48
57
|
};
|
|
49
58
|
/** @internal */
|
|
50
59
|
export declare const CaptureTransactionRequest$outboundSchema: z.ZodType<CaptureTransactionRequest$Outbound, z.ZodTypeDef, CaptureTransactionRequest>;
|
|
@@ -62,4 +71,24 @@ export declare namespace CaptureTransactionRequest$ {
|
|
|
62
71
|
}
|
|
63
72
|
export declare function captureTransactionRequestToJSON(captureTransactionRequest: CaptureTransactionRequest): string;
|
|
64
73
|
export declare function captureTransactionRequestFromJSON(jsonString: string): SafeParseResult<CaptureTransactionRequest, SDKValidationError>;
|
|
74
|
+
/** @internal */
|
|
75
|
+
export declare const CaptureTransactionResponseCaptureTransaction$inboundSchema: z.ZodType<CaptureTransactionResponseCaptureTransaction, z.ZodTypeDef, unknown>;
|
|
76
|
+
/** @internal */
|
|
77
|
+
export type CaptureTransactionResponseCaptureTransaction$Outbound = components.Transaction$Outbound | components.TransactionCapture$Outbound;
|
|
78
|
+
/** @internal */
|
|
79
|
+
export declare const CaptureTransactionResponseCaptureTransaction$outboundSchema: z.ZodType<CaptureTransactionResponseCaptureTransaction$Outbound, z.ZodTypeDef, CaptureTransactionResponseCaptureTransaction>;
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
83
|
+
*/
|
|
84
|
+
export declare namespace CaptureTransactionResponseCaptureTransaction$ {
|
|
85
|
+
/** @deprecated use `CaptureTransactionResponseCaptureTransaction$inboundSchema` instead. */
|
|
86
|
+
const inboundSchema: z.ZodType<CaptureTransactionResponseCaptureTransaction, z.ZodTypeDef, unknown>;
|
|
87
|
+
/** @deprecated use `CaptureTransactionResponseCaptureTransaction$outboundSchema` instead. */
|
|
88
|
+
const outboundSchema: z.ZodType<CaptureTransactionResponseCaptureTransaction$Outbound, z.ZodTypeDef, CaptureTransactionResponseCaptureTransaction>;
|
|
89
|
+
/** @deprecated use `CaptureTransactionResponseCaptureTransaction$Outbound` instead. */
|
|
90
|
+
type Outbound = CaptureTransactionResponseCaptureTransaction$Outbound;
|
|
91
|
+
}
|
|
92
|
+
export declare function captureTransactionResponseCaptureTransactionToJSON(captureTransactionResponseCaptureTransaction: CaptureTransactionResponseCaptureTransaction): string;
|
|
93
|
+
export declare function captureTransactionResponseCaptureTransactionFromJSON(jsonString: string): SafeParseResult<CaptureTransactionResponseCaptureTransaction, SDKValidationError>;
|
|
65
94
|
//# sourceMappingURL=capturetransaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capturetransaction.d.ts","sourceRoot":"","sources":["../../src/models/operations/capturetransaction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,yBAAyB,GAAG;IACtC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,
|
|
1
|
+
{"version":3,"file":"capturetransaction.d.ts","sourceRoot":"","sources":["../../src/models/operations/capturetransaction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,yBAAyB,GAAG;IACtC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,wBAAwB,EAAE,UAAU,CAAC,wBAAwB,CAAC;CAC/D,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4CAA4C,GACpD,UAAU,CAAC,WAAW,GACtB,UAAU,CAAC,kBAAkB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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.CaptureTransactionRequest$ = exports.CaptureTransactionRequest$outboundSchema = exports.CaptureTransactionRequest$inboundSchema = exports.CaptureTransactionGlobals$ = exports.CaptureTransactionGlobals$outboundSchema = exports.CaptureTransactionGlobals$inboundSchema = void 0;
|
|
29
|
+
exports.CaptureTransactionResponseCaptureTransaction$ = exports.CaptureTransactionResponseCaptureTransaction$outboundSchema = exports.CaptureTransactionResponseCaptureTransaction$inboundSchema = exports.CaptureTransactionRequest$ = exports.CaptureTransactionRequest$outboundSchema = exports.CaptureTransactionRequest$inboundSchema = exports.CaptureTransactionGlobals$ = exports.CaptureTransactionGlobals$outboundSchema = exports.CaptureTransactionGlobals$inboundSchema = void 0;
|
|
30
30
|
exports.captureTransactionGlobalsToJSON = captureTransactionGlobalsToJSON;
|
|
31
31
|
exports.captureTransactionGlobalsFromJSON = captureTransactionGlobalsFromJSON;
|
|
32
32
|
exports.captureTransactionRequestToJSON = captureTransactionRequestToJSON;
|
|
33
33
|
exports.captureTransactionRequestFromJSON = captureTransactionRequestFromJSON;
|
|
34
|
+
exports.captureTransactionResponseCaptureTransactionToJSON = captureTransactionResponseCaptureTransactionToJSON;
|
|
35
|
+
exports.captureTransactionResponseCaptureTransactionFromJSON = captureTransactionResponseCaptureTransactionFromJSON;
|
|
34
36
|
const z = __importStar(require("zod"));
|
|
35
37
|
const primitives_js_1 = require("../../lib/primitives.js");
|
|
36
38
|
const schemas_js_1 = require("../../lib/schemas.js");
|
|
@@ -63,23 +65,25 @@ function captureTransactionGlobalsFromJSON(jsonString) {
|
|
|
63
65
|
/** @internal */
|
|
64
66
|
exports.CaptureTransactionRequest$inboundSchema = z.object({
|
|
65
67
|
transaction_id: z.string(),
|
|
68
|
+
prefer: z.nullable(z.string()).optional(),
|
|
66
69
|
merchantAccountId: z.nullable(z.string()).optional(),
|
|
67
|
-
|
|
70
|
+
TransactionCaptureCreate: components.TransactionCaptureCreate$inboundSchema,
|
|
68
71
|
}).transform((v) => {
|
|
69
72
|
return (0, primitives_js_1.remap)(v, {
|
|
70
73
|
"transaction_id": "transactionId",
|
|
71
|
-
"
|
|
74
|
+
"TransactionCaptureCreate": "transactionCaptureCreate",
|
|
72
75
|
});
|
|
73
76
|
});
|
|
74
77
|
/** @internal */
|
|
75
78
|
exports.CaptureTransactionRequest$outboundSchema = z.object({
|
|
76
79
|
transactionId: z.string(),
|
|
80
|
+
prefer: z.nullable(z.string()).optional(),
|
|
77
81
|
merchantAccountId: z.nullable(z.string()).optional(),
|
|
78
|
-
|
|
82
|
+
transactionCaptureCreate: components.TransactionCaptureCreate$outboundSchema,
|
|
79
83
|
}).transform((v) => {
|
|
80
84
|
return (0, primitives_js_1.remap)(v, {
|
|
81
85
|
transactionId: "transaction_id",
|
|
82
|
-
|
|
86
|
+
transactionCaptureCreate: "TransactionCaptureCreate",
|
|
83
87
|
});
|
|
84
88
|
});
|
|
85
89
|
/**
|
|
@@ -99,4 +103,31 @@ function captureTransactionRequestToJSON(captureTransactionRequest) {
|
|
|
99
103
|
function captureTransactionRequestFromJSON(jsonString) {
|
|
100
104
|
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CaptureTransactionRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CaptureTransactionRequest' from JSON`);
|
|
101
105
|
}
|
|
106
|
+
/** @internal */
|
|
107
|
+
exports.CaptureTransactionResponseCaptureTransaction$inboundSchema = z.union([
|
|
108
|
+
components.Transaction$inboundSchema,
|
|
109
|
+
components.TransactionCapture$inboundSchema,
|
|
110
|
+
]);
|
|
111
|
+
/** @internal */
|
|
112
|
+
exports.CaptureTransactionResponseCaptureTransaction$outboundSchema = z.union([
|
|
113
|
+
components.Transaction$outboundSchema,
|
|
114
|
+
components.TransactionCapture$outboundSchema,
|
|
115
|
+
]);
|
|
116
|
+
/**
|
|
117
|
+
* @internal
|
|
118
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
119
|
+
*/
|
|
120
|
+
var CaptureTransactionResponseCaptureTransaction$;
|
|
121
|
+
(function (CaptureTransactionResponseCaptureTransaction$) {
|
|
122
|
+
/** @deprecated use `CaptureTransactionResponseCaptureTransaction$inboundSchema` instead. */
|
|
123
|
+
CaptureTransactionResponseCaptureTransaction$.inboundSchema = exports.CaptureTransactionResponseCaptureTransaction$inboundSchema;
|
|
124
|
+
/** @deprecated use `CaptureTransactionResponseCaptureTransaction$outboundSchema` instead. */
|
|
125
|
+
CaptureTransactionResponseCaptureTransaction$.outboundSchema = exports.CaptureTransactionResponseCaptureTransaction$outboundSchema;
|
|
126
|
+
})(CaptureTransactionResponseCaptureTransaction$ || (exports.CaptureTransactionResponseCaptureTransaction$ = CaptureTransactionResponseCaptureTransaction$ = {}));
|
|
127
|
+
function captureTransactionResponseCaptureTransactionToJSON(captureTransactionResponseCaptureTransaction) {
|
|
128
|
+
return JSON.stringify(exports.CaptureTransactionResponseCaptureTransaction$outboundSchema.parse(captureTransactionResponseCaptureTransaction));
|
|
129
|
+
}
|
|
130
|
+
function captureTransactionResponseCaptureTransactionFromJSON(jsonString) {
|
|
131
|
+
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.CaptureTransactionResponseCaptureTransaction$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CaptureTransactionResponseCaptureTransaction' from JSON`);
|
|
132
|
+
}
|
|
102
133
|
//# sourceMappingURL=capturetransaction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capturetransaction.js","sourceRoot":"","sources":["../../src/models/operations/capturetransaction.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"capturetransaction.js","sourceRoot":"","sources":["../../src/models/operations/capturetransaction.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEH,0EAMC;AAED,8EAQC;AAyDD,0EAMC;AAED,8EAQC;AA4C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AuC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACnE,uDAAuD,CACxD,CAAC;AACJ,CAAC;AAED,gBAAgB;AACH,QAAA,0DAA0D,GAKjE,CAAC,CAAC,KAAK,CAAC;IACV,UAAU,CAAC,yBAAyB;IACpC,UAAU,CAAC,gCAAgC;CAC5C,CAAC,CAAC;AAOL,gBAAgB;AACH,QAAA,2DAA2D,GAKlE,CAAC,CAAC,KAAK,CAAC;IACV,UAAU,CAAC,0BAA0B;IACrC,UAAU,CAAC,iCAAiC;CAC7C,CAAC,CAAC;AAEL;;;GAGG;AACH,IAAiB,6CAA6C,CAS7D;AATD,WAAiB,6CAA6C;IAC5D,4FAA4F;IAC/E,2DAAa,GACxB,kEAA0D,CAAC;IAC7D,6FAA6F;IAChF,4DAAc,GACzB,mEAA2D,CAAC;AAGhE,CAAC,EATgB,6CAA6C,6DAA7C,6CAA6C,QAS7D;AAED,SAAgB,kDAAkD,CAChE,4CAC8C;IAE9C,OAAO,IAAI,CAAC,SAAS,CACnB,mEAA2D,CAAC,KAAK,CAC/D,4CAA4C,CAC7C,CACF,CAAC;AACJ,CAAC;AAED,SAAgB,oDAAoD,CAClE,UAAkB;IAKlB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,kEAA0D,CAAC,KAAK,CAC9D,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACd,EACH,0EAA0E,CAC3E,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/sdk/transactions.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export declare class Transactions extends ClientSDK {
|
|
|
48
48
|
* @remarks
|
|
49
49
|
* 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).
|
|
50
50
|
*/
|
|
51
|
-
capture(
|
|
51
|
+
capture(transactionCaptureCreate: components.TransactionCaptureCreate, transactionId: string, prefer?: string | null | undefined, merchantAccountId?: string | null | undefined, options?: RequestOptions): Promise<operations.CaptureTransactionResponseCaptureTransaction>;
|
|
52
52
|
/**
|
|
53
53
|
* Void transaction
|
|
54
54
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../src/sdk/transactions.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAwB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,qBAAa,YAAa,SAAQ,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,CAAe;IAChC,IAAI,OAAO,IAAI,YAAY,CAE1B;IAED,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED;;;;;OAKG;IACG,IAAI,CACR,OAAO,CAAC,EAAE,UAAU,CAAC,uBAAuB,GAAG,SAAS,EACxD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CACR,YAAY,CAAC,UAAU,CAAC,wBAAwB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CACtE;IAQD;;;;;OAKG;IACG,MAAM,CACV,iBAAiB,EAAE,UAAU,CAAC,iBAAiB,EAC/C,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC1C,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CACR,aAAa,EAAE,MAAM,EACrB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;IASlC;;;;;OAKG;IACG,IAAI,CACR,aAAa,EAAE,MAAM,EACrB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAC7C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;CAQnC"}
|
package/sdk/transactions.js
CHANGED
|
@@ -69,8 +69,8 @@ class Transactions extends sdks_js_1.ClientSDK {
|
|
|
69
69
|
* @remarks
|
|
70
70
|
* 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).
|
|
71
71
|
*/
|
|
72
|
-
async capture(
|
|
73
|
-
return (0, fp_js_1.unwrapAsync)((0, transactionsCapture_js_1.transactionsCapture)(this,
|
|
72
|
+
async capture(transactionCaptureCreate, transactionId, prefer, merchantAccountId, options) {
|
|
73
|
+
return (0, fp_js_1.unwrapAsync)((0, transactionsCapture_js_1.transactionsCapture)(this, transactionCaptureCreate, transactionId, prefer, merchantAccountId, options));
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Void transaction
|
package/sdk/transactions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../src/sdk/transactions.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,4EAAsE;AACtE,0EAAoE;AACpE,oEAA8D;AAC9D,sEAAgE;AAChE,sEAAgE;AAChE,0EAAoE;AACpE,sEAAgE;AAChE,4CAA2D;AAG3D,0CAA6C;AAC7C,0DAA4E;AAC5E,2CAAqC;AACrC,uDAAiD;AACjD,qDAA+C;AAE/C,MAAa,YAAa,SAAQ,mBAAS;IAEzC,IAAI,OAAO;QACT,OAAO,CAAC,IAA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"../types/fp.js";
|
|
|
34
34
|
*/
|
|
35
35
|
export function transactionsCapture(
|
|
36
36
|
client: Gr4vyCore,
|
|
37
|
-
|
|
37
|
+
transactionCaptureCreate: components.TransactionCaptureCreate,
|
|
38
38
|
transactionId: string,
|
|
39
|
+
prefer?: string | null | undefined,
|
|
39
40
|
merchantAccountId?: string | null | undefined,
|
|
40
41
|
options?: RequestOptions,
|
|
41
42
|
): APIPromise<
|
|
42
43
|
Result<
|
|
43
|
-
|
|
44
|
+
operations.CaptureTransactionResponseCaptureTransaction,
|
|
44
45
|
| errors.Error400
|
|
45
46
|
| errors.Error401
|
|
46
47
|
| errors.Error403
|
|
@@ -65,8 +66,9 @@ export function transactionsCapture(
|
|
|
65
66
|
> {
|
|
66
67
|
return new APIPromise($do(
|
|
67
68
|
client,
|
|
68
|
-
|
|
69
|
+
transactionCaptureCreate,
|
|
69
70
|
transactionId,
|
|
71
|
+
prefer,
|
|
70
72
|
merchantAccountId,
|
|
71
73
|
options,
|
|
72
74
|
));
|
|
@@ -74,14 +76,15 @@ export function transactionsCapture(
|
|
|
74
76
|
|
|
75
77
|
async function $do(
|
|
76
78
|
client: Gr4vyCore,
|
|
77
|
-
|
|
79
|
+
transactionCaptureCreate: components.TransactionCaptureCreate,
|
|
78
80
|
transactionId: string,
|
|
81
|
+
prefer?: string | null | undefined,
|
|
79
82
|
merchantAccountId?: string | null | undefined,
|
|
80
83
|
options?: RequestOptions,
|
|
81
84
|
): Promise<
|
|
82
85
|
[
|
|
83
86
|
Result<
|
|
84
|
-
|
|
87
|
+
operations.CaptureTransactionResponseCaptureTransaction,
|
|
85
88
|
| errors.Error400
|
|
86
89
|
| errors.Error401
|
|
87
90
|
| errors.Error403
|
|
@@ -107,8 +110,9 @@ async function $do(
|
|
|
107
110
|
]
|
|
108
111
|
> {
|
|
109
112
|
const input: operations.CaptureTransactionRequest = {
|
|
110
|
-
|
|
113
|
+
transactionCaptureCreate: transactionCaptureCreate,
|
|
111
114
|
transactionId: transactionId,
|
|
115
|
+
prefer: prefer,
|
|
112
116
|
merchantAccountId: merchantAccountId,
|
|
113
117
|
};
|
|
114
118
|
|
|
@@ -121,7 +125,7 @@ async function $do(
|
|
|
121
125
|
return [parsed, { status: "invalid" }];
|
|
122
126
|
}
|
|
123
127
|
const payload = parsed.value;
|
|
124
|
-
const body = encodeJSON("body", payload.
|
|
128
|
+
const body = encodeJSON("body", payload.TransactionCaptureCreate, {
|
|
125
129
|
explode: true,
|
|
126
130
|
});
|
|
127
131
|
|
|
@@ -142,6 +146,10 @@ async function $do(
|
|
|
142
146
|
payload.merchantAccountId ?? client._options.merchantAccountId,
|
|
143
147
|
{ explode: false, charEncoding: "none" },
|
|
144
148
|
),
|
|
149
|
+
"prefer": encodeSimple("prefer", payload.prefer, {
|
|
150
|
+
explode: false,
|
|
151
|
+
charEncoding: "none",
|
|
152
|
+
}),
|
|
145
153
|
}));
|
|
146
154
|
|
|
147
155
|
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
@@ -209,7 +217,7 @@ async function $do(
|
|
|
209
217
|
};
|
|
210
218
|
|
|
211
219
|
const [result] = await M.match<
|
|
212
|
-
|
|
220
|
+
operations.CaptureTransactionResponseCaptureTransaction,
|
|
213
221
|
| errors.Error400
|
|
214
222
|
| errors.Error401
|
|
215
223
|
| errors.Error403
|
|
@@ -231,7 +239,10 @@ async function $do(
|
|
|
231
239
|
| UnexpectedClientError
|
|
232
240
|
| SDKValidationError
|
|
233
241
|
>(
|
|
234
|
-
M.json(
|
|
242
|
+
M.json(
|
|
243
|
+
200,
|
|
244
|
+
operations.CaptureTransactionResponseCaptureTransaction$inboundSchema,
|
|
245
|
+
),
|
|
235
246
|
M.jsonErr(400, errors.Error400$inboundSchema),
|
|
236
247
|
M.jsonErr(401, errors.Error401$inboundSchema),
|
|
237
248
|
M.jsonErr(403, errors.Error403$inboundSchema),
|
package/src/lib/config.ts
CHANGED
|
@@ -77,7 +77,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
77
77
|
export const SDK_METADATA = {
|
|
78
78
|
language: "typescript",
|
|
79
79
|
openapiDocVersion: "1.0.0",
|
|
80
|
-
sdkVersion: "1.1.
|
|
81
|
-
genVersion: "2.
|
|
82
|
-
userAgent: "speakeasy-sdk/typescript 1.1.
|
|
80
|
+
sdkVersion: "1.1.14",
|
|
81
|
+
genVersion: "2.661.4",
|
|
82
|
+
userAgent: "speakeasy-sdk/typescript 1.1.14 2.661.4 1.0.0 @gr4vy/sdk",
|
|
83
83
|
} as const;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
catchUnrecognizedEnum,
|
|
8
|
+
OpenEnum,
|
|
9
|
+
Unrecognized,
|
|
10
|
+
} from "../../types/enums.js";
|
|
11
|
+
|
|
12
|
+
export const CaptureStatus = {
|
|
13
|
+
Succeeded: "succeeded",
|
|
14
|
+
Pending: "pending",
|
|
15
|
+
Declined: "declined",
|
|
16
|
+
Failed: "failed",
|
|
17
|
+
} as const;
|
|
18
|
+
export type CaptureStatus = OpenEnum<typeof CaptureStatus>;
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const CaptureStatus$inboundSchema: z.ZodType<
|
|
22
|
+
CaptureStatus,
|
|
23
|
+
z.ZodTypeDef,
|
|
24
|
+
unknown
|
|
25
|
+
> = z
|
|
26
|
+
.union([
|
|
27
|
+
z.nativeEnum(CaptureStatus),
|
|
28
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const CaptureStatus$outboundSchema: z.ZodType<
|
|
33
|
+
CaptureStatus,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
CaptureStatus
|
|
36
|
+
> = z.union([
|
|
37
|
+
z.nativeEnum(CaptureStatus),
|
|
38
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
+
*/
|
|
45
|
+
export namespace CaptureStatus$ {
|
|
46
|
+
/** @deprecated use `CaptureStatus$inboundSchema` instead. */
|
|
47
|
+
export const inboundSchema = CaptureStatus$inboundSchema;
|
|
48
|
+
/** @deprecated use `CaptureStatus$outboundSchema` instead. */
|
|
49
|
+
export const outboundSchema = CaptureStatus$outboundSchema;
|
|
50
|
+
}
|
|
@@ -36,6 +36,7 @@ export * from "./buyer.js";
|
|
|
36
36
|
export * from "./buyercreate.js";
|
|
37
37
|
export * from "./buyers.js";
|
|
38
38
|
export * from "./buyerupdate.js";
|
|
39
|
+
export * from "./capturestatus.js";
|
|
39
40
|
export * from "./cardpaymentmethodcreate.js";
|
|
40
41
|
export * from "./cardscheme.js";
|
|
41
42
|
export * from "./cardschemedefinition.js";
|
|
@@ -218,6 +219,7 @@ export * from "./tokenpaymentmethodcreate.js";
|
|
|
218
219
|
export * from "./transaction.js";
|
|
219
220
|
export * from "./transactionbuyer.js";
|
|
220
221
|
export * from "./transactioncapture.js";
|
|
222
|
+
export * from "./transactioncapturecreate.js";
|
|
221
223
|
export * from "./transactionconnectionoptions.js";
|
|
222
224
|
export * from "./transactioncreate.js";
|
|
223
225
|
export * from "./transactionevent.js";
|
|
@@ -3,28 +3,44 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
10
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
CaptureStatus,
|
|
12
|
+
CaptureStatus$inboundSchema,
|
|
13
|
+
CaptureStatus$outboundSchema,
|
|
14
|
+
} from "./capturestatus.js";
|
|
15
|
+
import {
|
|
16
|
+
Transaction,
|
|
17
|
+
Transaction$inboundSchema,
|
|
18
|
+
Transaction$Outbound,
|
|
19
|
+
Transaction$outboundSchema,
|
|
20
|
+
} from "./transaction.js";
|
|
15
21
|
|
|
16
|
-
/**
|
|
17
|
-
* Request body for capturing an authorized transaction.
|
|
18
|
-
*/
|
|
19
22
|
export type TransactionCapture = {
|
|
20
23
|
/**
|
|
21
|
-
*
|
|
24
|
+
* Always `transaction-capture`.
|
|
25
|
+
*/
|
|
26
|
+
type?: "transaction-capture" | undefined;
|
|
27
|
+
status: CaptureStatus;
|
|
28
|
+
/**
|
|
29
|
+
* The standardized error code set by Gr4vy.
|
|
30
|
+
*/
|
|
31
|
+
code: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services.
|
|
34
|
+
*/
|
|
35
|
+
rawResponseCode: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services.
|
|
22
38
|
*/
|
|
23
|
-
|
|
39
|
+
rawResponseDescription: string | null;
|
|
24
40
|
/**
|
|
25
|
-
*
|
|
41
|
+
* A full transaction resource.
|
|
26
42
|
*/
|
|
27
|
-
|
|
43
|
+
transaction: Transaction;
|
|
28
44
|
};
|
|
29
45
|
|
|
30
46
|
/** @internal */
|
|
@@ -33,14 +49,27 @@ export const TransactionCapture$inboundSchema: z.ZodType<
|
|
|
33
49
|
z.ZodTypeDef,
|
|
34
50
|
unknown
|
|
35
51
|
> = z.object({
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
type: z.literal("transaction-capture").default("transaction-capture"),
|
|
53
|
+
status: CaptureStatus$inboundSchema,
|
|
54
|
+
code: z.nullable(z.string()),
|
|
55
|
+
raw_response_code: z.nullable(z.string()),
|
|
56
|
+
raw_response_description: z.nullable(z.string()),
|
|
57
|
+
transaction: Transaction$inboundSchema,
|
|
58
|
+
}).transform((v) => {
|
|
59
|
+
return remap$(v, {
|
|
60
|
+
"raw_response_code": "rawResponseCode",
|
|
61
|
+
"raw_response_description": "rawResponseDescription",
|
|
62
|
+
});
|
|
38
63
|
});
|
|
39
64
|
|
|
40
65
|
/** @internal */
|
|
41
66
|
export type TransactionCapture$Outbound = {
|
|
42
|
-
|
|
43
|
-
|
|
67
|
+
type: "transaction-capture";
|
|
68
|
+
status: string;
|
|
69
|
+
code: string | null;
|
|
70
|
+
raw_response_code: string | null;
|
|
71
|
+
raw_response_description: string | null;
|
|
72
|
+
transaction: Transaction$Outbound;
|
|
44
73
|
};
|
|
45
74
|
|
|
46
75
|
/** @internal */
|
|
@@ -49,8 +78,19 @@ export const TransactionCapture$outboundSchema: z.ZodType<
|
|
|
49
78
|
z.ZodTypeDef,
|
|
50
79
|
TransactionCapture
|
|
51
80
|
> = z.object({
|
|
52
|
-
|
|
53
|
-
|
|
81
|
+
type: z.literal("transaction-capture").default(
|
|
82
|
+
"transaction-capture" as const,
|
|
83
|
+
),
|
|
84
|
+
status: CaptureStatus$outboundSchema,
|
|
85
|
+
code: z.nullable(z.string()),
|
|
86
|
+
rawResponseCode: z.nullable(z.string()),
|
|
87
|
+
rawResponseDescription: z.nullable(z.string()),
|
|
88
|
+
transaction: Transaction$outboundSchema,
|
|
89
|
+
}).transform((v) => {
|
|
90
|
+
return remap$(v, {
|
|
91
|
+
rawResponseCode: "raw_response_code",
|
|
92
|
+
rawResponseDescription: "raw_response_description",
|
|
93
|
+
});
|
|
54
94
|
});
|
|
55
95
|
|
|
56
96
|
/**
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
Airline,
|
|
11
|
+
Airline$inboundSchema,
|
|
12
|
+
Airline$Outbound,
|
|
13
|
+
Airline$outboundSchema,
|
|
14
|
+
} from "./airline.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Request body for capturing an authorized transaction.
|
|
18
|
+
*/
|
|
19
|
+
export type TransactionCaptureCreate = {
|
|
20
|
+
/**
|
|
21
|
+
* The amount to capture, in the smallest currency unit (e.g., cents). This must be less than or equal to the authorized amount, unless over-capture is available.
|
|
22
|
+
*/
|
|
23
|
+
amount?: number | null | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The airline data to submit to the payment service during the capture call.
|
|
26
|
+
*/
|
|
27
|
+
airline?: Airline | null | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const TransactionCaptureCreate$inboundSchema: z.ZodType<
|
|
32
|
+
TransactionCaptureCreate,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
unknown
|
|
35
|
+
> = z.object({
|
|
36
|
+
amount: z.nullable(z.number().int()).optional(),
|
|
37
|
+
airline: z.nullable(Airline$inboundSchema).optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export type TransactionCaptureCreate$Outbound = {
|
|
42
|
+
amount?: number | null | undefined;
|
|
43
|
+
airline?: Airline$Outbound | null | undefined;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const TransactionCaptureCreate$outboundSchema: z.ZodType<
|
|
48
|
+
TransactionCaptureCreate$Outbound,
|
|
49
|
+
z.ZodTypeDef,
|
|
50
|
+
TransactionCaptureCreate
|
|
51
|
+
> = z.object({
|
|
52
|
+
amount: z.nullable(z.number().int()).optional(),
|
|
53
|
+
airline: z.nullable(Airline$outboundSchema).optional(),
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @internal
|
|
58
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
59
|
+
*/
|
|
60
|
+
export namespace TransactionCaptureCreate$ {
|
|
61
|
+
/** @deprecated use `TransactionCaptureCreate$inboundSchema` instead. */
|
|
62
|
+
export const inboundSchema = TransactionCaptureCreate$inboundSchema;
|
|
63
|
+
/** @deprecated use `TransactionCaptureCreate$outboundSchema` instead. */
|
|
64
|
+
export const outboundSchema = TransactionCaptureCreate$outboundSchema;
|
|
65
|
+
/** @deprecated use `TransactionCaptureCreate$Outbound` instead. */
|
|
66
|
+
export type Outbound = TransactionCaptureCreate$Outbound;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function transactionCaptureCreateToJSON(
|
|
70
|
+
transactionCaptureCreate: TransactionCaptureCreate,
|
|
71
|
+
): string {
|
|
72
|
+
return JSON.stringify(
|
|
73
|
+
TransactionCaptureCreate$outboundSchema.parse(transactionCaptureCreate),
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function transactionCaptureCreateFromJSON(
|
|
78
|
+
jsonString: string,
|
|
79
|
+
): SafeParseResult<TransactionCaptureCreate, SDKValidationError> {
|
|
80
|
+
return safeParse(
|
|
81
|
+
jsonString,
|
|
82
|
+
(x) => TransactionCaptureCreate$inboundSchema.parse(JSON.parse(x)),
|
|
83
|
+
`Failed to parse 'TransactionCaptureCreate' from JSON`,
|
|
84
|
+
);
|
|
85
|
+
}
|