@gr4vy/sdk 1.5.7 → 1.6.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/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/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/monatospeioptions.d.ts +32 -0
- package/models/components/monatospeioptions.d.ts.map +1 -0
- package/models/components/monatospeioptions.js +78 -0
- package/models/components/monatospeioptions.js.map +1 -0
- package/models/components/transactionconnectionoptions.d.ts +6 -0
- package/models/components/transactionconnectionoptions.d.ts.map +1 -1
- package/models/components/transactionconnectionoptions.js +5 -0
- package/models/components/transactionconnectionoptions.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +1 -0
- package/src/models/components/monatospeioptions.ts +78 -0
- package/src/models/components/transactionconnectionoptions.ts +15 -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,706 +0,0 @@
|
|
|
1
|
-
# PaymentServices
|
|
2
|
-
(*paymentServices*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [list](#list) - List payment services
|
|
9
|
-
* [create](#create) - Update a configured payment service
|
|
10
|
-
* [get](#get) - Get payment service
|
|
11
|
-
* [update](#update) - Configure a payment service
|
|
12
|
-
* [delete](#delete) - Delete a configured payment service
|
|
13
|
-
* [verify](#verify) - Verify payment service credentials
|
|
14
|
-
* [session](#session) - Create a session for a payment service definition
|
|
15
|
-
|
|
16
|
-
## list
|
|
17
|
-
|
|
18
|
-
List the configured payment services.
|
|
19
|
-
|
|
20
|
-
### Example Usage
|
|
21
|
-
|
|
22
|
-
<!-- UsageSnippet language="typescript" operationID="list_payment_services" method="get" path="/payment-services" -->
|
|
23
|
-
```typescript
|
|
24
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
25
|
-
import fs from "fs";
|
|
26
|
-
|
|
27
|
-
const gr4vy = new Gr4vy({
|
|
28
|
-
id: "example",
|
|
29
|
-
server: "sandbox",
|
|
30
|
-
merchantAccountId: "default",
|
|
31
|
-
bearerAuth: withToken({
|
|
32
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
33
|
-
}),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
async function run() {
|
|
37
|
-
const result = await gr4vy.paymentServices.list();
|
|
38
|
-
|
|
39
|
-
for await (const page of result) {
|
|
40
|
-
console.log(page);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
run();
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Standalone function
|
|
48
|
-
|
|
49
|
-
The standalone function version of this method:
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
53
|
-
import { paymentServicesList } from "@gr4vy/sdk/funcs/paymentServicesList.js";
|
|
54
|
-
|
|
55
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
56
|
-
// You can create one instance of it to use across an application.
|
|
57
|
-
const gr4vy = new Gr4vyCore({
|
|
58
|
-
merchantAccountId: "<id>",
|
|
59
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
async function run() {
|
|
63
|
-
const res = await paymentServicesList(gr4vy);
|
|
64
|
-
if (res.ok) {
|
|
65
|
-
const { value: result } = res;
|
|
66
|
-
for await (const page of result) {
|
|
67
|
-
console.log(page);
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
console.log("paymentServicesList failed:", res.error);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
run();
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Parameters
|
|
78
|
-
|
|
79
|
-
| Parameter | Type | Required | Description |
|
|
80
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
81
|
-
| `request` | [operations.ListPaymentServicesRequest](../../models/operations/listpaymentservicesrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
82
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
83
|
-
| `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. |
|
|
84
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
85
|
-
|
|
86
|
-
### Response
|
|
87
|
-
|
|
88
|
-
**Promise\<[operations.ListPaymentServicesResponse](../../models/operations/listpaymentservicesresponse.md)\>**
|
|
89
|
-
|
|
90
|
-
### Errors
|
|
91
|
-
|
|
92
|
-
| Error Type | Status Code | Content Type |
|
|
93
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
94
|
-
| errors.Error400 | 400 | application/json |
|
|
95
|
-
| errors.Error401 | 401 | application/json |
|
|
96
|
-
| errors.Error403 | 403 | application/json |
|
|
97
|
-
| errors.Error404 | 404 | application/json |
|
|
98
|
-
| errors.Error405 | 405 | application/json |
|
|
99
|
-
| errors.Error409 | 409 | application/json |
|
|
100
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
101
|
-
| errors.Error425 | 425 | application/json |
|
|
102
|
-
| errors.Error429 | 429 | application/json |
|
|
103
|
-
| errors.Error500 | 500 | application/json |
|
|
104
|
-
| errors.Error502 | 502 | application/json |
|
|
105
|
-
| errors.Error504 | 504 | application/json |
|
|
106
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
107
|
-
|
|
108
|
-
## create
|
|
109
|
-
|
|
110
|
-
Updates the configuration of a payment service.
|
|
111
|
-
|
|
112
|
-
### Example Usage
|
|
113
|
-
|
|
114
|
-
<!-- UsageSnippet language="typescript" operationID="update_payment_service" method="post" path="/payment-services" -->
|
|
115
|
-
```typescript
|
|
116
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
117
|
-
import fs from "fs";
|
|
118
|
-
|
|
119
|
-
const gr4vy = new Gr4vy({
|
|
120
|
-
id: "example",
|
|
121
|
-
server: "sandbox",
|
|
122
|
-
merchantAccountId: "default",
|
|
123
|
-
bearerAuth: withToken({
|
|
124
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
125
|
-
}),
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
async function run() {
|
|
129
|
-
const result = await gr4vy.paymentServices.create({
|
|
130
|
-
displayName: "Stripe",
|
|
131
|
-
paymentServiceDefinitionId: "stripe-card",
|
|
132
|
-
fields: [
|
|
133
|
-
{
|
|
134
|
-
key: "api_key",
|
|
135
|
-
value: "key-12345",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
key: "api_key",
|
|
139
|
-
value: "key-12345",
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
acceptedCurrencies: [
|
|
143
|
-
"USD",
|
|
144
|
-
"EUR",
|
|
145
|
-
"GBP",
|
|
146
|
-
],
|
|
147
|
-
acceptedCountries: [
|
|
148
|
-
"US",
|
|
149
|
-
"DE",
|
|
150
|
-
"GB",
|
|
151
|
-
],
|
|
152
|
-
threeDSecureEnabled: true,
|
|
153
|
-
settlementReportingEnabled: true,
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
console.log(result);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
run();
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Standalone function
|
|
163
|
-
|
|
164
|
-
The standalone function version of this method:
|
|
165
|
-
|
|
166
|
-
```typescript
|
|
167
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
168
|
-
import { paymentServicesCreate } from "@gr4vy/sdk/funcs/paymentServicesCreate.js";
|
|
169
|
-
|
|
170
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
171
|
-
// You can create one instance of it to use across an application.
|
|
172
|
-
const gr4vy = new Gr4vyCore({
|
|
173
|
-
merchantAccountId: "<id>",
|
|
174
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
async function run() {
|
|
178
|
-
const res = await paymentServicesCreate(gr4vy, {
|
|
179
|
-
displayName: "Stripe",
|
|
180
|
-
paymentServiceDefinitionId: "stripe-card",
|
|
181
|
-
fields: [
|
|
182
|
-
{
|
|
183
|
-
key: "api_key",
|
|
184
|
-
value: "key-12345",
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
key: "api_key",
|
|
188
|
-
value: "key-12345",
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
|
-
acceptedCurrencies: [
|
|
192
|
-
"USD",
|
|
193
|
-
"EUR",
|
|
194
|
-
"GBP",
|
|
195
|
-
],
|
|
196
|
-
acceptedCountries: [
|
|
197
|
-
"US",
|
|
198
|
-
"DE",
|
|
199
|
-
"GB",
|
|
200
|
-
],
|
|
201
|
-
threeDSecureEnabled: true,
|
|
202
|
-
settlementReportingEnabled: true,
|
|
203
|
-
});
|
|
204
|
-
if (res.ok) {
|
|
205
|
-
const { value: result } = res;
|
|
206
|
-
console.log(result);
|
|
207
|
-
} else {
|
|
208
|
-
console.log("paymentServicesCreate failed:", res.error);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
run();
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Parameters
|
|
216
|
-
|
|
217
|
-
| Parameter | Type | Required | Description |
|
|
218
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
219
|
-
| `paymentServiceCreate` | [components.PaymentServiceCreate](../../models/components/paymentservicecreate.md) | :heavy_check_mark: | N/A |
|
|
220
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
|
|
221
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
222
|
-
| `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. |
|
|
223
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
224
|
-
|
|
225
|
-
### Response
|
|
226
|
-
|
|
227
|
-
**Promise\<[components.PaymentService](../../models/components/paymentservice.md)\>**
|
|
228
|
-
|
|
229
|
-
### Errors
|
|
230
|
-
|
|
231
|
-
| Error Type | Status Code | Content Type |
|
|
232
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
233
|
-
| errors.Error400 | 400 | application/json |
|
|
234
|
-
| errors.Error401 | 401 | application/json |
|
|
235
|
-
| errors.Error403 | 403 | application/json |
|
|
236
|
-
| errors.Error404 | 404 | application/json |
|
|
237
|
-
| errors.Error405 | 405 | application/json |
|
|
238
|
-
| errors.Error409 | 409 | application/json |
|
|
239
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
240
|
-
| errors.Error425 | 425 | application/json |
|
|
241
|
-
| errors.Error429 | 429 | application/json |
|
|
242
|
-
| errors.Error500 | 500 | application/json |
|
|
243
|
-
| errors.Error502 | 502 | application/json |
|
|
244
|
-
| errors.Error504 | 504 | application/json |
|
|
245
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
246
|
-
|
|
247
|
-
## get
|
|
248
|
-
|
|
249
|
-
Get the details of a configured payment service.
|
|
250
|
-
|
|
251
|
-
### Example Usage
|
|
252
|
-
|
|
253
|
-
<!-- UsageSnippet language="typescript" operationID="get_payment_service" method="get" path="/payment-services/{payment_service_id}" -->
|
|
254
|
-
```typescript
|
|
255
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
256
|
-
import fs from "fs";
|
|
257
|
-
|
|
258
|
-
const gr4vy = new Gr4vy({
|
|
259
|
-
id: "example",
|
|
260
|
-
server: "sandbox",
|
|
261
|
-
merchantAccountId: "default",
|
|
262
|
-
bearerAuth: withToken({
|
|
263
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
264
|
-
}),
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
async function run() {
|
|
268
|
-
const result = await gr4vy.paymentServices.get("fffd152a-9532-4087-9a4f-de58754210f0");
|
|
269
|
-
|
|
270
|
-
console.log(result);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
run();
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Standalone function
|
|
277
|
-
|
|
278
|
-
The standalone function version of this method:
|
|
279
|
-
|
|
280
|
-
```typescript
|
|
281
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
282
|
-
import { paymentServicesGet } from "@gr4vy/sdk/funcs/paymentServicesGet.js";
|
|
283
|
-
|
|
284
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
285
|
-
// You can create one instance of it to use across an application.
|
|
286
|
-
const gr4vy = new Gr4vyCore({
|
|
287
|
-
merchantAccountId: "<id>",
|
|
288
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
async function run() {
|
|
292
|
-
const res = await paymentServicesGet(gr4vy, "fffd152a-9532-4087-9a4f-de58754210f0");
|
|
293
|
-
if (res.ok) {
|
|
294
|
-
const { value: result } = res;
|
|
295
|
-
console.log(result);
|
|
296
|
-
} else {
|
|
297
|
-
console.log("paymentServicesGet failed:", res.error);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
run();
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
### Parameters
|
|
305
|
-
|
|
306
|
-
| Parameter | Type | Required | Description | Example |
|
|
307
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
308
|
-
| `paymentServiceId` | *string* | :heavy_check_mark: | the ID of the payment service | [object Object] |
|
|
309
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
|
|
310
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
|
311
|
-
| `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. | |
|
|
312
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
|
|
313
|
-
|
|
314
|
-
### Response
|
|
315
|
-
|
|
316
|
-
**Promise\<[components.PaymentService](../../models/components/paymentservice.md)\>**
|
|
317
|
-
|
|
318
|
-
### Errors
|
|
319
|
-
|
|
320
|
-
| Error Type | Status Code | Content Type |
|
|
321
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
322
|
-
| errors.Error400 | 400 | application/json |
|
|
323
|
-
| errors.Error401 | 401 | application/json |
|
|
324
|
-
| errors.Error403 | 403 | application/json |
|
|
325
|
-
| errors.Error404 | 404 | application/json |
|
|
326
|
-
| errors.Error405 | 405 | application/json |
|
|
327
|
-
| errors.Error409 | 409 | application/json |
|
|
328
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
329
|
-
| errors.Error425 | 425 | application/json |
|
|
330
|
-
| errors.Error429 | 429 | application/json |
|
|
331
|
-
| errors.Error500 | 500 | application/json |
|
|
332
|
-
| errors.Error502 | 502 | application/json |
|
|
333
|
-
| errors.Error504 | 504 | application/json |
|
|
334
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
335
|
-
|
|
336
|
-
## update
|
|
337
|
-
|
|
338
|
-
Configures a new payment service for use by merchants.
|
|
339
|
-
|
|
340
|
-
### Example Usage
|
|
341
|
-
|
|
342
|
-
<!-- UsageSnippet language="typescript" operationID="create_payment_service" method="put" path="/payment-services/{payment_service_id}" -->
|
|
343
|
-
```typescript
|
|
344
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
345
|
-
import fs from "fs";
|
|
346
|
-
|
|
347
|
-
const gr4vy = new Gr4vy({
|
|
348
|
-
id: "example",
|
|
349
|
-
server: "sandbox",
|
|
350
|
-
merchantAccountId: "default",
|
|
351
|
-
bearerAuth: withToken({
|
|
352
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
353
|
-
}),
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
async function run() {
|
|
357
|
-
const result = await gr4vy.paymentServices.update({
|
|
358
|
-
settlementReportingEnabled: true,
|
|
359
|
-
}, "fffd152a-9532-4087-9a4f-de58754210f0");
|
|
360
|
-
|
|
361
|
-
console.log(result);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
run();
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### Standalone function
|
|
368
|
-
|
|
369
|
-
The standalone function version of this method:
|
|
370
|
-
|
|
371
|
-
```typescript
|
|
372
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
373
|
-
import { paymentServicesUpdate } from "@gr4vy/sdk/funcs/paymentServicesUpdate.js";
|
|
374
|
-
|
|
375
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
376
|
-
// You can create one instance of it to use across an application.
|
|
377
|
-
const gr4vy = new Gr4vyCore({
|
|
378
|
-
merchantAccountId: "<id>",
|
|
379
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
async function run() {
|
|
383
|
-
const res = await paymentServicesUpdate(gr4vy, {
|
|
384
|
-
settlementReportingEnabled: true,
|
|
385
|
-
}, "fffd152a-9532-4087-9a4f-de58754210f0");
|
|
386
|
-
if (res.ok) {
|
|
387
|
-
const { value: result } = res;
|
|
388
|
-
console.log(result);
|
|
389
|
-
} else {
|
|
390
|
-
console.log("paymentServicesUpdate failed:", res.error);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
run();
|
|
395
|
-
```
|
|
396
|
-
|
|
397
|
-
### Parameters
|
|
398
|
-
|
|
399
|
-
| Parameter | Type | Required | Description | Example |
|
|
400
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
401
|
-
| `paymentServiceId` | *string* | :heavy_check_mark: | the ID of the payment service | [object Object] |
|
|
402
|
-
| `paymentServiceUpdate` | [components.PaymentServiceUpdate](../../models/components/paymentserviceupdate.md) | :heavy_check_mark: | N/A | |
|
|
403
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
|
|
404
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
|
405
|
-
| `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. | |
|
|
406
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
|
|
407
|
-
|
|
408
|
-
### Response
|
|
409
|
-
|
|
410
|
-
**Promise\<[components.PaymentService](../../models/components/paymentservice.md)\>**
|
|
411
|
-
|
|
412
|
-
### Errors
|
|
413
|
-
|
|
414
|
-
| Error Type | Status Code | Content Type |
|
|
415
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
416
|
-
| errors.Error400 | 400 | application/json |
|
|
417
|
-
| errors.Error401 | 401 | application/json |
|
|
418
|
-
| errors.Error403 | 403 | application/json |
|
|
419
|
-
| errors.Error404 | 404 | application/json |
|
|
420
|
-
| errors.Error405 | 405 | application/json |
|
|
421
|
-
| errors.Error409 | 409 | application/json |
|
|
422
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
423
|
-
| errors.Error425 | 425 | application/json |
|
|
424
|
-
| errors.Error429 | 429 | application/json |
|
|
425
|
-
| errors.Error500 | 500 | application/json |
|
|
426
|
-
| errors.Error502 | 502 | application/json |
|
|
427
|
-
| errors.Error504 | 504 | application/json |
|
|
428
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
429
|
-
|
|
430
|
-
## delete
|
|
431
|
-
|
|
432
|
-
Deletes all the configuration of a payment service.
|
|
433
|
-
|
|
434
|
-
### Example Usage
|
|
435
|
-
|
|
436
|
-
<!-- UsageSnippet language="typescript" operationID="delete_payment_service" method="delete" path="/payment-services/{payment_service_id}" -->
|
|
437
|
-
```typescript
|
|
438
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
439
|
-
import fs from "fs";
|
|
440
|
-
|
|
441
|
-
const gr4vy = new Gr4vy({
|
|
442
|
-
id: "example",
|
|
443
|
-
server: "sandbox",
|
|
444
|
-
merchantAccountId: "default",
|
|
445
|
-
bearerAuth: withToken({
|
|
446
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
447
|
-
}),
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
async function run() {
|
|
451
|
-
await gr4vy.paymentServices.delete("fffd152a-9532-4087-9a4f-de58754210f0");
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
run();
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
### Standalone function
|
|
460
|
-
|
|
461
|
-
The standalone function version of this method:
|
|
462
|
-
|
|
463
|
-
```typescript
|
|
464
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
465
|
-
import { paymentServicesDelete } from "@gr4vy/sdk/funcs/paymentServicesDelete.js";
|
|
466
|
-
|
|
467
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
468
|
-
// You can create one instance of it to use across an application.
|
|
469
|
-
const gr4vy = new Gr4vyCore({
|
|
470
|
-
merchantAccountId: "<id>",
|
|
471
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
472
|
-
});
|
|
473
|
-
|
|
474
|
-
async function run() {
|
|
475
|
-
const res = await paymentServicesDelete(gr4vy, "fffd152a-9532-4087-9a4f-de58754210f0");
|
|
476
|
-
if (res.ok) {
|
|
477
|
-
const { value: result } = res;
|
|
478
|
-
|
|
479
|
-
} else {
|
|
480
|
-
console.log("paymentServicesDelete failed:", res.error);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
run();
|
|
485
|
-
```
|
|
486
|
-
|
|
487
|
-
### Parameters
|
|
488
|
-
|
|
489
|
-
| Parameter | Type | Required | Description | Example |
|
|
490
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
491
|
-
| `paymentServiceId` | *string* | :heavy_check_mark: | the ID of the payment service | [object Object] |
|
|
492
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
|
|
493
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
|
494
|
-
| `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. | |
|
|
495
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
|
|
496
|
-
|
|
497
|
-
### Response
|
|
498
|
-
|
|
499
|
-
**Promise\<void\>**
|
|
500
|
-
|
|
501
|
-
### Errors
|
|
502
|
-
|
|
503
|
-
| Error Type | Status Code | Content Type |
|
|
504
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
505
|
-
| errors.Error400 | 400 | application/json |
|
|
506
|
-
| errors.Error401 | 401 | application/json |
|
|
507
|
-
| errors.Error403 | 403 | application/json |
|
|
508
|
-
| errors.Error404 | 404 | application/json |
|
|
509
|
-
| errors.Error405 | 405 | application/json |
|
|
510
|
-
| errors.Error409 | 409 | application/json |
|
|
511
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
512
|
-
| errors.Error425 | 425 | application/json |
|
|
513
|
-
| errors.Error429 | 429 | application/json |
|
|
514
|
-
| errors.Error500 | 500 | application/json |
|
|
515
|
-
| errors.Error502 | 502 | application/json |
|
|
516
|
-
| errors.Error504 | 504 | application/json |
|
|
517
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
518
|
-
|
|
519
|
-
## verify
|
|
520
|
-
|
|
521
|
-
Verify the credentials of a configured payment service
|
|
522
|
-
|
|
523
|
-
### Example Usage
|
|
524
|
-
|
|
525
|
-
<!-- UsageSnippet language="typescript" operationID="verify_payment_service_credentials" method="post" path="/payment-services/verify" -->
|
|
526
|
-
```typescript
|
|
527
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
528
|
-
import fs from "fs";
|
|
529
|
-
|
|
530
|
-
const gr4vy = new Gr4vy({
|
|
531
|
-
id: "example",
|
|
532
|
-
server: "sandbox",
|
|
533
|
-
merchantAccountId: "default",
|
|
534
|
-
bearerAuth: withToken({
|
|
535
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
536
|
-
}),
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
async function run() {
|
|
540
|
-
const result = await gr4vy.paymentServices.verify({
|
|
541
|
-
paymentServiceDefinitionId: "stripe-card",
|
|
542
|
-
fields: [],
|
|
543
|
-
});
|
|
544
|
-
|
|
545
|
-
console.log(result);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
run();
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
### Standalone function
|
|
552
|
-
|
|
553
|
-
The standalone function version of this method:
|
|
554
|
-
|
|
555
|
-
```typescript
|
|
556
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
557
|
-
import { paymentServicesVerify } from "@gr4vy/sdk/funcs/paymentServicesVerify.js";
|
|
558
|
-
|
|
559
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
560
|
-
// You can create one instance of it to use across an application.
|
|
561
|
-
const gr4vy = new Gr4vyCore({
|
|
562
|
-
merchantAccountId: "<id>",
|
|
563
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
564
|
-
});
|
|
565
|
-
|
|
566
|
-
async function run() {
|
|
567
|
-
const res = await paymentServicesVerify(gr4vy, {
|
|
568
|
-
paymentServiceDefinitionId: "stripe-card",
|
|
569
|
-
fields: [],
|
|
570
|
-
});
|
|
571
|
-
if (res.ok) {
|
|
572
|
-
const { value: result } = res;
|
|
573
|
-
console.log(result);
|
|
574
|
-
} else {
|
|
575
|
-
console.log("paymentServicesVerify failed:", res.error);
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
run();
|
|
580
|
-
```
|
|
581
|
-
|
|
582
|
-
### Parameters
|
|
583
|
-
|
|
584
|
-
| Parameter | Type | Required | Description |
|
|
585
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
586
|
-
| `verifyCredentials` | [components.VerifyCredentials](../../models/components/verifycredentials.md) | :heavy_check_mark: | N/A |
|
|
587
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
|
|
588
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
589
|
-
| `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. |
|
|
590
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
591
|
-
|
|
592
|
-
### Response
|
|
593
|
-
|
|
594
|
-
**Promise\<[any](../../models/.md)\>**
|
|
595
|
-
|
|
596
|
-
### Errors
|
|
597
|
-
|
|
598
|
-
| Error Type | Status Code | Content Type |
|
|
599
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
600
|
-
| errors.Error400 | 400 | application/json |
|
|
601
|
-
| errors.Error401 | 401 | application/json |
|
|
602
|
-
| errors.Error403 | 403 | application/json |
|
|
603
|
-
| errors.Error404 | 404 | application/json |
|
|
604
|
-
| errors.Error405 | 405 | application/json |
|
|
605
|
-
| errors.Error409 | 409 | application/json |
|
|
606
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
607
|
-
| errors.Error425 | 425 | application/json |
|
|
608
|
-
| errors.Error429 | 429 | application/json |
|
|
609
|
-
| errors.Error500 | 500 | application/json |
|
|
610
|
-
| errors.Error502 | 502 | application/json |
|
|
611
|
-
| errors.Error504 | 504 | application/json |
|
|
612
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
613
|
-
|
|
614
|
-
## session
|
|
615
|
-
|
|
616
|
-
Creates a session for a payment service that supports sessions.
|
|
617
|
-
|
|
618
|
-
### Example Usage
|
|
619
|
-
|
|
620
|
-
<!-- UsageSnippet language="typescript" operationID="create_payment_service_session" method="post" path="/payment-services/{payment_service_id}/sessions" -->
|
|
621
|
-
```typescript
|
|
622
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
623
|
-
import fs from "fs";
|
|
624
|
-
|
|
625
|
-
const gr4vy = new Gr4vy({
|
|
626
|
-
id: "example",
|
|
627
|
-
server: "sandbox",
|
|
628
|
-
merchantAccountId: "default",
|
|
629
|
-
bearerAuth: withToken({
|
|
630
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
631
|
-
}),
|
|
632
|
-
});
|
|
633
|
-
|
|
634
|
-
async function run() {
|
|
635
|
-
const result = await gr4vy.paymentServices.session({
|
|
636
|
-
|
|
637
|
-
}, "fffd152a-9532-4087-9a4f-de58754210f0");
|
|
638
|
-
|
|
639
|
-
console.log(result);
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
run();
|
|
643
|
-
```
|
|
644
|
-
|
|
645
|
-
### Standalone function
|
|
646
|
-
|
|
647
|
-
The standalone function version of this method:
|
|
648
|
-
|
|
649
|
-
```typescript
|
|
650
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
651
|
-
import { paymentServicesSession } from "@gr4vy/sdk/funcs/paymentServicesSession.js";
|
|
652
|
-
|
|
653
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
654
|
-
// You can create one instance of it to use across an application.
|
|
655
|
-
const gr4vy = new Gr4vyCore({
|
|
656
|
-
merchantAccountId: "<id>",
|
|
657
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
658
|
-
});
|
|
659
|
-
|
|
660
|
-
async function run() {
|
|
661
|
-
const res = await paymentServicesSession(gr4vy, {
|
|
662
|
-
|
|
663
|
-
}, "fffd152a-9532-4087-9a4f-de58754210f0");
|
|
664
|
-
if (res.ok) {
|
|
665
|
-
const { value: result } = res;
|
|
666
|
-
console.log(result);
|
|
667
|
-
} else {
|
|
668
|
-
console.log("paymentServicesSession failed:", res.error);
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
run();
|
|
673
|
-
```
|
|
674
|
-
|
|
675
|
-
### Parameters
|
|
676
|
-
|
|
677
|
-
| Parameter | Type | Required | Description | Example |
|
|
678
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
679
|
-
| `paymentServiceId` | *string* | :heavy_check_mark: | the ID of the payment service | [object Object] |
|
|
680
|
-
| `requestBody` | Record<string, *any*> | :heavy_check_mark: | N/A | |
|
|
681
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
|
|
682
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
|
683
|
-
| `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. | |
|
|
684
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
|
|
685
|
-
|
|
686
|
-
### Response
|
|
687
|
-
|
|
688
|
-
**Promise\<[components.CreateSession](../../models/components/createsession.md)\>**
|
|
689
|
-
|
|
690
|
-
### Errors
|
|
691
|
-
|
|
692
|
-
| Error Type | Status Code | Content Type |
|
|
693
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
694
|
-
| errors.Error400 | 400 | application/json |
|
|
695
|
-
| errors.Error401 | 401 | application/json |
|
|
696
|
-
| errors.Error403 | 403 | application/json |
|
|
697
|
-
| errors.Error404 | 404 | application/json |
|
|
698
|
-
| errors.Error405 | 405 | application/json |
|
|
699
|
-
| errors.Error409 | 409 | application/json |
|
|
700
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
701
|
-
| errors.Error425 | 425 | application/json |
|
|
702
|
-
| errors.Error429 | 429 | application/json |
|
|
703
|
-
| errors.Error500 | 500 | application/json |
|
|
704
|
-
| errors.Error502 | 502 | application/json |
|
|
705
|
-
| errors.Error504 | 504 | application/json |
|
|
706
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|