@gr4vy/sdk 1.5.8 → 1.6.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/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/checkoutsession.d.ts +15 -0
- package/models/components/checkoutsession.d.ts.map +1 -1
- package/models/components/checkoutsession.js +8 -0
- package/models/components/checkoutsession.js.map +1 -1
- package/models/components/checkoutsessioncreate.d.ts +15 -0
- package/models/components/checkoutsessioncreate.d.ts.map +1 -1
- package/models/components/checkoutsessioncreate.js +8 -0
- package/models/components/checkoutsessioncreate.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/checkoutsession.ts +23 -0
- package/src/models/components/checkoutsessioncreate.ts +23 -0
- package/docs/sdks/all/README.md +0 -98
- package/docs/sdks/auditlogs/README.md +0 -100
- package/docs/sdks/balances/README.md +0 -123
- package/docs/sdks/buyers/README.md +0 -461
- package/docs/sdks/cardschemedefinitions/README.md +0 -96
- package/docs/sdks/checkoutsessions/README.md +0 -367
- package/docs/sdks/cryptogram/README.md +0 -103
- package/docs/sdks/digitalwallets/README.md +0 -465
- package/docs/sdks/domains/README.md +0 -197
- package/docs/sdks/events/README.md +0 -99
- package/docs/sdks/executions/README.md +0 -285
- package/docs/sdks/giftcards/README.md +0 -376
- package/docs/sdks/gr4vygiftcards/README.md +0 -98
- package/docs/sdks/gr4vypaymentmethods/README.md +0 -96
- package/docs/sdks/gr4vyrefunds/README.md +0 -279
- package/docs/sdks/jobs/README.md +0 -107
- package/docs/sdks/merchantaccounts/README.md +0 -382
- package/docs/sdks/networktokens/README.md +0 -467
- package/docs/sdks/paymentlinks/README.md +0 -381
- package/docs/sdks/paymentmethods/README.md +0 -376
- package/docs/sdks/paymentoptions/README.md +0 -97
- package/docs/sdks/paymentservicedefinitions/README.md +0 -281
- package/docs/sdks/paymentservices/README.md +0 -706
- package/docs/sdks/paymentservicetokens/README.md +0 -286
- package/docs/sdks/payouts/README.md +0 -298
- package/docs/sdks/refunds/README.md +0 -97
- package/docs/sdks/reportexecutions/README.md +0 -100
- package/docs/sdks/reports/README.md +0 -403
- package/docs/sdks/sessions/README.md +0 -289
- package/docs/sdks/settlements/README.md +0 -188
- package/docs/sdks/shippingdetails/README.md +0 -462
- package/docs/sdks/transactions/README.md +0 -752
- package/examples/README.md +0 -31
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
# Sessions
|
|
2
|
-
(*digitalWallets.sessions*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [googlePay](#googlepay) - Create a Google Pay session
|
|
9
|
-
* [applePay](#applepay) - Create a Apple Pay session
|
|
10
|
-
* [clickToPay](#clicktopay) - Create a Click to Pay session
|
|
11
|
-
|
|
12
|
-
## googlePay
|
|
13
|
-
|
|
14
|
-
Create a session for use with Google Pay.
|
|
15
|
-
|
|
16
|
-
### Example Usage
|
|
17
|
-
|
|
18
|
-
<!-- UsageSnippet language="typescript" operationID="create_google_pay_digital_wallet_session" method="post" path="/digital-wallets/google/session" -->
|
|
19
|
-
```typescript
|
|
20
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
21
|
-
import fs from "fs";
|
|
22
|
-
|
|
23
|
-
const gr4vy = new Gr4vy({
|
|
24
|
-
id: "example",
|
|
25
|
-
server: "sandbox",
|
|
26
|
-
merchantAccountId: "default",
|
|
27
|
-
bearerAuth: withToken({
|
|
28
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
29
|
-
}),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
async function run() {
|
|
33
|
-
const result = await gr4vy.digitalWallets.sessions.googlePay({
|
|
34
|
-
originDomain: "example.com",
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
console.log(result);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
run();
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### Standalone function
|
|
44
|
-
|
|
45
|
-
The standalone function version of this method:
|
|
46
|
-
|
|
47
|
-
```typescript
|
|
48
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
49
|
-
import { digitalWalletsSessionsGooglePay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsGooglePay.js";
|
|
50
|
-
|
|
51
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
52
|
-
// You can create one instance of it to use across an application.
|
|
53
|
-
const gr4vy = new Gr4vyCore({
|
|
54
|
-
merchantAccountId: "<id>",
|
|
55
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
async function run() {
|
|
59
|
-
const res = await digitalWalletsSessionsGooglePay(gr4vy, {
|
|
60
|
-
originDomain: "example.com",
|
|
61
|
-
});
|
|
62
|
-
if (res.ok) {
|
|
63
|
-
const { value: result } = res;
|
|
64
|
-
console.log(result);
|
|
65
|
-
} else {
|
|
66
|
-
console.log("digitalWalletsSessionsGooglePay failed:", res.error);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
run();
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Parameters
|
|
74
|
-
|
|
75
|
-
| Parameter | Type | Required | Description |
|
|
76
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
77
|
-
| `googlePaySessionRequest` | [components.GooglePaySessionRequest](../../models/components/googlepaysessionrequest.md) | :heavy_check_mark: | N/A |
|
|
78
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
|
|
79
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
80
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
81
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
82
|
-
|
|
83
|
-
### Response
|
|
84
|
-
|
|
85
|
-
**Promise\<[components.GooglePaySession](../../models/components/googlepaysession.md)\>**
|
|
86
|
-
|
|
87
|
-
### Errors
|
|
88
|
-
|
|
89
|
-
| Error Type | Status Code | Content Type |
|
|
90
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
91
|
-
| errors.Error400 | 400 | application/json |
|
|
92
|
-
| errors.Error401 | 401 | application/json |
|
|
93
|
-
| errors.Error403 | 403 | application/json |
|
|
94
|
-
| errors.Error404 | 404 | application/json |
|
|
95
|
-
| errors.Error405 | 405 | application/json |
|
|
96
|
-
| errors.Error409 | 409 | application/json |
|
|
97
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
98
|
-
| errors.Error425 | 425 | application/json |
|
|
99
|
-
| errors.Error429 | 429 | application/json |
|
|
100
|
-
| errors.Error500 | 500 | application/json |
|
|
101
|
-
| errors.Error502 | 502 | application/json |
|
|
102
|
-
| errors.Error504 | 504 | application/json |
|
|
103
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
104
|
-
|
|
105
|
-
## applePay
|
|
106
|
-
|
|
107
|
-
Create a session for use with Apple Pay.
|
|
108
|
-
|
|
109
|
-
### Example Usage
|
|
110
|
-
|
|
111
|
-
<!-- UsageSnippet language="typescript" operationID="create_apple_pay_digital_wallet_session" method="post" path="/digital-wallets/apple/session" -->
|
|
112
|
-
```typescript
|
|
113
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
114
|
-
import fs from "fs";
|
|
115
|
-
|
|
116
|
-
const gr4vy = new Gr4vy({
|
|
117
|
-
id: "example",
|
|
118
|
-
server: "sandbox",
|
|
119
|
-
merchantAccountId: "default",
|
|
120
|
-
bearerAuth: withToken({
|
|
121
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
122
|
-
}),
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
async function run() {
|
|
126
|
-
const result = await gr4vy.digitalWallets.sessions.applePay({
|
|
127
|
-
validationUrl: "https://apple-pay-gateway-cert.apple.com",
|
|
128
|
-
domainName: "example.com",
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
console.log(result);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
run();
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Standalone function
|
|
138
|
-
|
|
139
|
-
The standalone function version of this method:
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
143
|
-
import { digitalWalletsSessionsApplePay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsApplePay.js";
|
|
144
|
-
|
|
145
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
146
|
-
// You can create one instance of it to use across an application.
|
|
147
|
-
const gr4vy = new Gr4vyCore({
|
|
148
|
-
merchantAccountId: "<id>",
|
|
149
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
async function run() {
|
|
153
|
-
const res = await digitalWalletsSessionsApplePay(gr4vy, {
|
|
154
|
-
validationUrl: "https://apple-pay-gateway-cert.apple.com",
|
|
155
|
-
domainName: "example.com",
|
|
156
|
-
});
|
|
157
|
-
if (res.ok) {
|
|
158
|
-
const { value: result } = res;
|
|
159
|
-
console.log(result);
|
|
160
|
-
} else {
|
|
161
|
-
console.log("digitalWalletsSessionsApplePay failed:", res.error);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
run();
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Parameters
|
|
169
|
-
|
|
170
|
-
| Parameter | Type | Required | Description |
|
|
171
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
172
|
-
| `applePaySessionRequest` | [components.ApplePaySessionRequest](../../models/components/applepaysessionrequest.md) | :heavy_check_mark: | N/A |
|
|
173
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
|
|
174
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
175
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
176
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
177
|
-
|
|
178
|
-
### Response
|
|
179
|
-
|
|
180
|
-
**Promise\<[{ [k: string]: any }](../../models/.md)\>**
|
|
181
|
-
|
|
182
|
-
### Errors
|
|
183
|
-
|
|
184
|
-
| Error Type | Status Code | Content Type |
|
|
185
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
186
|
-
| errors.Error400 | 400 | application/json |
|
|
187
|
-
| errors.Error401 | 401 | application/json |
|
|
188
|
-
| errors.Error403 | 403 | application/json |
|
|
189
|
-
| errors.Error404 | 404 | application/json |
|
|
190
|
-
| errors.Error405 | 405 | application/json |
|
|
191
|
-
| errors.Error409 | 409 | application/json |
|
|
192
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
193
|
-
| errors.Error425 | 425 | application/json |
|
|
194
|
-
| errors.Error429 | 429 | application/json |
|
|
195
|
-
| errors.Error500 | 500 | application/json |
|
|
196
|
-
| errors.Error502 | 502 | application/json |
|
|
197
|
-
| errors.Error504 | 504 | application/json |
|
|
198
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
199
|
-
|
|
200
|
-
## clickToPay
|
|
201
|
-
|
|
202
|
-
Create a session for use with Click to Pay.
|
|
203
|
-
|
|
204
|
-
### Example Usage
|
|
205
|
-
|
|
206
|
-
<!-- UsageSnippet language="typescript" operationID="create_click_to_pay_digital_wallet_session" method="post" path="/digital-wallets/click-to-pay/session" -->
|
|
207
|
-
```typescript
|
|
208
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
209
|
-
import fs from "fs";
|
|
210
|
-
|
|
211
|
-
const gr4vy = new Gr4vy({
|
|
212
|
-
id: "example",
|
|
213
|
-
server: "sandbox",
|
|
214
|
-
merchantAccountId: "default",
|
|
215
|
-
bearerAuth: withToken({
|
|
216
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
217
|
-
}),
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
async function run() {
|
|
221
|
-
const result = await gr4vy.digitalWallets.sessions.clickToPay({
|
|
222
|
-
checkoutSessionId: "4137b1cf-39ac-42a8-bad6-1c680d5dab6b",
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
console.log(result);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
run();
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Standalone function
|
|
232
|
-
|
|
233
|
-
The standalone function version of this method:
|
|
234
|
-
|
|
235
|
-
```typescript
|
|
236
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
237
|
-
import { digitalWalletsSessionsClickToPay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsClickToPay.js";
|
|
238
|
-
|
|
239
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
240
|
-
// You can create one instance of it to use across an application.
|
|
241
|
-
const gr4vy = new Gr4vyCore({
|
|
242
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
async function run() {
|
|
246
|
-
const res = await digitalWalletsSessionsClickToPay(gr4vy, {
|
|
247
|
-
checkoutSessionId: "4137b1cf-39ac-42a8-bad6-1c680d5dab6b",
|
|
248
|
-
});
|
|
249
|
-
if (res.ok) {
|
|
250
|
-
const { value: result } = res;
|
|
251
|
-
console.log(result);
|
|
252
|
-
} else {
|
|
253
|
-
console.log("digitalWalletsSessionsClickToPay failed:", res.error);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
run();
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
### Parameters
|
|
261
|
-
|
|
262
|
-
| Parameter | Type | Required | Description |
|
|
263
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
264
|
-
| `request` | [components.ClickToPaySessionRequest](../../models/components/clicktopaysessionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
265
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
266
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
267
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
268
|
-
|
|
269
|
-
### Response
|
|
270
|
-
|
|
271
|
-
**Promise\<[components.ClickToPaySession](../../models/components/clicktopaysession.md)\>**
|
|
272
|
-
|
|
273
|
-
### Errors
|
|
274
|
-
|
|
275
|
-
| Error Type | Status Code | Content Type |
|
|
276
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
277
|
-
| errors.Error400 | 400 | application/json |
|
|
278
|
-
| errors.Error401 | 401 | application/json |
|
|
279
|
-
| errors.Error403 | 403 | application/json |
|
|
280
|
-
| errors.Error404 | 404 | application/json |
|
|
281
|
-
| errors.Error405 | 405 | application/json |
|
|
282
|
-
| errors.Error409 | 409 | application/json |
|
|
283
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
284
|
-
| errors.Error425 | 425 | application/json |
|
|
285
|
-
| errors.Error429 | 429 | application/json |
|
|
286
|
-
| errors.Error500 | 500 | application/json |
|
|
287
|
-
| errors.Error502 | 502 | application/json |
|
|
288
|
-
| errors.Error504 | 504 | application/json |
|
|
289
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
# Settlements
|
|
2
|
-
(*transactions.settlements*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [get](#get) - Get transaction settlement
|
|
9
|
-
* [list](#list) - List transaction settlements
|
|
10
|
-
|
|
11
|
-
## get
|
|
12
|
-
|
|
13
|
-
Retrieve a specific settlement for a transaction by its unique identifier.
|
|
14
|
-
|
|
15
|
-
### Example Usage
|
|
16
|
-
|
|
17
|
-
<!-- UsageSnippet language="typescript" operationID="get_transaction_settlement" method="get" path="/transactions/{transaction_id}/settlements/{settlement_id}" -->
|
|
18
|
-
```typescript
|
|
19
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
20
|
-
import fs from "fs";
|
|
21
|
-
|
|
22
|
-
const gr4vy = new Gr4vy({
|
|
23
|
-
id: "example",
|
|
24
|
-
server: "sandbox",
|
|
25
|
-
merchantAccountId: "default",
|
|
26
|
-
bearerAuth: withToken({
|
|
27
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
28
|
-
}),
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
async function run() {
|
|
32
|
-
const result = await gr4vy.transactions.settlements.get("7099948d-7286-47e4-aad8-b68f7eb44591", "b1e2c3d4-5678-1234-9abc-1234567890ab");
|
|
33
|
-
|
|
34
|
-
console.log(result);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
run();
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Standalone function
|
|
41
|
-
|
|
42
|
-
The standalone function version of this method:
|
|
43
|
-
|
|
44
|
-
```typescript
|
|
45
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
46
|
-
import { transactionsSettlementsGet } from "@gr4vy/sdk/funcs/transactionsSettlementsGet.js";
|
|
47
|
-
|
|
48
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
49
|
-
// You can create one instance of it to use across an application.
|
|
50
|
-
const gr4vy = new Gr4vyCore({
|
|
51
|
-
merchantAccountId: "<id>",
|
|
52
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
async function run() {
|
|
56
|
-
const res = await transactionsSettlementsGet(gr4vy, "7099948d-7286-47e4-aad8-b68f7eb44591", "b1e2c3d4-5678-1234-9abc-1234567890ab");
|
|
57
|
-
if (res.ok) {
|
|
58
|
-
const { value: result } = res;
|
|
59
|
-
console.log(result);
|
|
60
|
-
} else {
|
|
61
|
-
console.log("transactionsSettlementsGet failed:", res.error);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
run();
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Parameters
|
|
69
|
-
|
|
70
|
-
| Parameter | Type | Required | Description | Example |
|
|
71
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
72
|
-
| `transactionId` | *string* | :heavy_check_mark: | The unique identifier of the transaction. | [object Object] |
|
|
73
|
-
| `settlementId` | *string* | :heavy_check_mark: | The unique identifier of the settlement. | [object Object] |
|
|
74
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
|
|
75
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
|
76
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
|
|
77
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
|
|
78
|
-
|
|
79
|
-
### Response
|
|
80
|
-
|
|
81
|
-
**Promise\<[components.Settlement](../../models/components/settlement.md)\>**
|
|
82
|
-
|
|
83
|
-
### Errors
|
|
84
|
-
|
|
85
|
-
| Error Type | Status Code | Content Type |
|
|
86
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
87
|
-
| errors.Error400 | 400 | application/json |
|
|
88
|
-
| errors.Error401 | 401 | application/json |
|
|
89
|
-
| errors.Error403 | 403 | application/json |
|
|
90
|
-
| errors.Error404 | 404 | application/json |
|
|
91
|
-
| errors.Error405 | 405 | application/json |
|
|
92
|
-
| errors.Error409 | 409 | application/json |
|
|
93
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
94
|
-
| errors.Error425 | 425 | application/json |
|
|
95
|
-
| errors.Error429 | 429 | application/json |
|
|
96
|
-
| errors.Error500 | 500 | application/json |
|
|
97
|
-
| errors.Error502 | 502 | application/json |
|
|
98
|
-
| errors.Error504 | 504 | application/json |
|
|
99
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
100
|
-
|
|
101
|
-
## list
|
|
102
|
-
|
|
103
|
-
List all settlements for a specific transaction.
|
|
104
|
-
|
|
105
|
-
### Example Usage
|
|
106
|
-
|
|
107
|
-
<!-- UsageSnippet language="typescript" operationID="list_transaction_settlements" method="get" path="/transactions/{transaction_id}/settlements" -->
|
|
108
|
-
```typescript
|
|
109
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
110
|
-
import fs from "fs";
|
|
111
|
-
|
|
112
|
-
const gr4vy = new Gr4vy({
|
|
113
|
-
id: "example",
|
|
114
|
-
server: "sandbox",
|
|
115
|
-
merchantAccountId: "default",
|
|
116
|
-
bearerAuth: withToken({
|
|
117
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
118
|
-
}),
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
async function run() {
|
|
122
|
-
const result = await gr4vy.transactions.settlements.list("7099948d-7286-47e4-aad8-b68f7eb44591");
|
|
123
|
-
|
|
124
|
-
console.log(result);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
run();
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Standalone function
|
|
131
|
-
|
|
132
|
-
The standalone function version of this method:
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
136
|
-
import { transactionsSettlementsList } from "@gr4vy/sdk/funcs/transactionsSettlementsList.js";
|
|
137
|
-
|
|
138
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
139
|
-
// You can create one instance of it to use across an application.
|
|
140
|
-
const gr4vy = new Gr4vyCore({
|
|
141
|
-
merchantAccountId: "<id>",
|
|
142
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
async function run() {
|
|
146
|
-
const res = await transactionsSettlementsList(gr4vy, "7099948d-7286-47e4-aad8-b68f7eb44591");
|
|
147
|
-
if (res.ok) {
|
|
148
|
-
const { value: result } = res;
|
|
149
|
-
console.log(result);
|
|
150
|
-
} else {
|
|
151
|
-
console.log("transactionsSettlementsList failed:", res.error);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
run();
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Parameters
|
|
159
|
-
|
|
160
|
-
| Parameter | Type | Required | Description | Example |
|
|
161
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
162
|
-
| `transactionId` | *string* | :heavy_check_mark: | The unique identifier of the transaction. | [object Object] |
|
|
163
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
|
|
164
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
|
165
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
|
|
166
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
|
|
167
|
-
|
|
168
|
-
### Response
|
|
169
|
-
|
|
170
|
-
**Promise\<[components.Settlements](../../models/components/settlements.md)\>**
|
|
171
|
-
|
|
172
|
-
### Errors
|
|
173
|
-
|
|
174
|
-
| Error Type | Status Code | Content Type |
|
|
175
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
176
|
-
| errors.Error400 | 400 | application/json |
|
|
177
|
-
| errors.Error401 | 401 | application/json |
|
|
178
|
-
| errors.Error403 | 403 | application/json |
|
|
179
|
-
| errors.Error404 | 404 | application/json |
|
|
180
|
-
| errors.Error405 | 405 | application/json |
|
|
181
|
-
| errors.Error409 | 409 | application/json |
|
|
182
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
183
|
-
| errors.Error425 | 425 | application/json |
|
|
184
|
-
| errors.Error429 | 429 | application/json |
|
|
185
|
-
| errors.Error500 | 500 | application/json |
|
|
186
|
-
| errors.Error502 | 502 | application/json |
|
|
187
|
-
| errors.Error504 | 504 | application/json |
|
|
188
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|