@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,376 +0,0 @@
|
|
|
1
|
-
# PaymentMethods
|
|
2
|
-
(*paymentMethods*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [list](#list) - List all payment methods
|
|
9
|
-
* [create](#create) - Create payment method
|
|
10
|
-
* [get](#get) - Get payment method
|
|
11
|
-
* [delete](#delete) - Delete payment method
|
|
12
|
-
|
|
13
|
-
## list
|
|
14
|
-
|
|
15
|
-
List all stored payment method.
|
|
16
|
-
|
|
17
|
-
### Example Usage
|
|
18
|
-
|
|
19
|
-
<!-- UsageSnippet language="typescript" operationID="list_payment_methods" method="get" path="/payment-methods" -->
|
|
20
|
-
```typescript
|
|
21
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
22
|
-
import fs from "fs";
|
|
23
|
-
|
|
24
|
-
const gr4vy = new Gr4vy({
|
|
25
|
-
id: "example",
|
|
26
|
-
server: "sandbox",
|
|
27
|
-
merchantAccountId: "default",
|
|
28
|
-
bearerAuth: withToken({
|
|
29
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
30
|
-
}),
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
async function run() {
|
|
34
|
-
const result = await gr4vy.paymentMethods.list();
|
|
35
|
-
|
|
36
|
-
for await (const page of result) {
|
|
37
|
-
console.log(page);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
run();
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Standalone function
|
|
45
|
-
|
|
46
|
-
The standalone function version of this method:
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
50
|
-
import { paymentMethodsList } from "@gr4vy/sdk/funcs/paymentMethodsList.js";
|
|
51
|
-
|
|
52
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
53
|
-
// You can create one instance of it to use across an application.
|
|
54
|
-
const gr4vy = new Gr4vyCore({
|
|
55
|
-
merchantAccountId: "<id>",
|
|
56
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
async function run() {
|
|
60
|
-
const res = await paymentMethodsList(gr4vy);
|
|
61
|
-
if (res.ok) {
|
|
62
|
-
const { value: result } = res;
|
|
63
|
-
for await (const page of result) {
|
|
64
|
-
console.log(page);
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
console.log("paymentMethodsList failed:", res.error);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
run();
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Parameters
|
|
75
|
-
|
|
76
|
-
| Parameter | Type | Required | Description |
|
|
77
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
78
|
-
| `request` | [operations.ListPaymentMethodsRequest](../../models/operations/listpaymentmethodsrequest.md) | :heavy_check_mark: | The request object to use for the 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\<[operations.ListPaymentMethodsResponse](../../models/operations/listpaymentmethodsresponse.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
|
-
## create
|
|
106
|
-
|
|
107
|
-
Store a new payment method.
|
|
108
|
-
|
|
109
|
-
### Example Usage
|
|
110
|
-
|
|
111
|
-
<!-- UsageSnippet language="typescript" operationID="create_payment_method" method="post" path="/payment-methods" -->
|
|
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.paymentMethods.create({
|
|
127
|
-
method: "checkout-session",
|
|
128
|
-
id: "4137b1cf-39ac-42a8-bad6-1c680d5dab6b",
|
|
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 { paymentMethodsCreate } from "@gr4vy/sdk/funcs/paymentMethodsCreate.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 paymentMethodsCreate(gr4vy, {
|
|
154
|
-
method: "checkout-session",
|
|
155
|
-
id: "4137b1cf-39ac-42a8-bad6-1c680d5dab6b",
|
|
156
|
-
});
|
|
157
|
-
if (res.ok) {
|
|
158
|
-
const { value: result } = res;
|
|
159
|
-
console.log(result);
|
|
160
|
-
} else {
|
|
161
|
-
console.log("paymentMethodsCreate failed:", res.error);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
run();
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Parameters
|
|
169
|
-
|
|
170
|
-
| Parameter | Type | Required | Description |
|
|
171
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
172
|
-
| `requestBody` | *operations.CreatePaymentMethodBody* | :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\<[components.PaymentMethod](../../models/components/paymentmethod.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
|
-
## get
|
|
201
|
-
|
|
202
|
-
Retrieve a payment method.
|
|
203
|
-
|
|
204
|
-
### Example Usage
|
|
205
|
-
|
|
206
|
-
<!-- UsageSnippet language="typescript" operationID="get_payment_method" method="get" path="/payment-methods/{payment_method_id}" -->
|
|
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.paymentMethods.get("ef9496d8-53a5-4aad-8ca2-00eb68334389");
|
|
222
|
-
|
|
223
|
-
console.log(result);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
run();
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
### Standalone function
|
|
230
|
-
|
|
231
|
-
The standalone function version of this method:
|
|
232
|
-
|
|
233
|
-
```typescript
|
|
234
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
235
|
-
import { paymentMethodsGet } from "@gr4vy/sdk/funcs/paymentMethodsGet.js";
|
|
236
|
-
|
|
237
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
238
|
-
// You can create one instance of it to use across an application.
|
|
239
|
-
const gr4vy = new Gr4vyCore({
|
|
240
|
-
merchantAccountId: "<id>",
|
|
241
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
async function run() {
|
|
245
|
-
const res = await paymentMethodsGet(gr4vy, "ef9496d8-53a5-4aad-8ca2-00eb68334389");
|
|
246
|
-
if (res.ok) {
|
|
247
|
-
const { value: result } = res;
|
|
248
|
-
console.log(result);
|
|
249
|
-
} else {
|
|
250
|
-
console.log("paymentMethodsGet failed:", res.error);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
run();
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
### Parameters
|
|
258
|
-
|
|
259
|
-
| Parameter | Type | Required | Description | Example |
|
|
260
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
261
|
-
| `paymentMethodId` | *string* | :heavy_check_mark: | The ID of the payment method | [object Object] |
|
|
262
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
|
|
263
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
|
264
|
-
| `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. | |
|
|
265
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
|
|
266
|
-
|
|
267
|
-
### Response
|
|
268
|
-
|
|
269
|
-
**Promise\<[components.PaymentMethod](../../models/components/paymentmethod.md)\>**
|
|
270
|
-
|
|
271
|
-
### Errors
|
|
272
|
-
|
|
273
|
-
| Error Type | Status Code | Content Type |
|
|
274
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
275
|
-
| errors.Error400 | 400 | application/json |
|
|
276
|
-
| errors.Error401 | 401 | application/json |
|
|
277
|
-
| errors.Error403 | 403 | application/json |
|
|
278
|
-
| errors.Error404 | 404 | application/json |
|
|
279
|
-
| errors.Error405 | 405 | application/json |
|
|
280
|
-
| errors.Error409 | 409 | application/json |
|
|
281
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
282
|
-
| errors.Error425 | 425 | application/json |
|
|
283
|
-
| errors.Error429 | 429 | application/json |
|
|
284
|
-
| errors.Error500 | 500 | application/json |
|
|
285
|
-
| errors.Error502 | 502 | application/json |
|
|
286
|
-
| errors.Error504 | 504 | application/json |
|
|
287
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
288
|
-
|
|
289
|
-
## delete
|
|
290
|
-
|
|
291
|
-
Delete a payment method.
|
|
292
|
-
|
|
293
|
-
### Example Usage
|
|
294
|
-
|
|
295
|
-
<!-- UsageSnippet language="typescript" operationID="delete_payment_method" method="delete" path="/payment-methods/{payment_method_id}" -->
|
|
296
|
-
```typescript
|
|
297
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
298
|
-
import fs from "fs";
|
|
299
|
-
|
|
300
|
-
const gr4vy = new Gr4vy({
|
|
301
|
-
id: "example",
|
|
302
|
-
server: "sandbox",
|
|
303
|
-
merchantAccountId: "default",
|
|
304
|
-
bearerAuth: withToken({
|
|
305
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
306
|
-
}),
|
|
307
|
-
});
|
|
308
|
-
|
|
309
|
-
async function run() {
|
|
310
|
-
await gr4vy.paymentMethods.delete("ef9496d8-53a5-4aad-8ca2-00eb68334389");
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
run();
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
### Standalone function
|
|
319
|
-
|
|
320
|
-
The standalone function version of this method:
|
|
321
|
-
|
|
322
|
-
```typescript
|
|
323
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
324
|
-
import { paymentMethodsDelete } from "@gr4vy/sdk/funcs/paymentMethodsDelete.js";
|
|
325
|
-
|
|
326
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
327
|
-
// You can create one instance of it to use across an application.
|
|
328
|
-
const gr4vy = new Gr4vyCore({
|
|
329
|
-
merchantAccountId: "<id>",
|
|
330
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
async function run() {
|
|
334
|
-
const res = await paymentMethodsDelete(gr4vy, "ef9496d8-53a5-4aad-8ca2-00eb68334389");
|
|
335
|
-
if (res.ok) {
|
|
336
|
-
const { value: result } = res;
|
|
337
|
-
|
|
338
|
-
} else {
|
|
339
|
-
console.log("paymentMethodsDelete failed:", res.error);
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
run();
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
### Parameters
|
|
347
|
-
|
|
348
|
-
| Parameter | Type | Required | Description | Example |
|
|
349
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
350
|
-
| `paymentMethodId` | *string* | :heavy_check_mark: | The ID of the payment method | [object Object] |
|
|
351
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
|
|
352
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
|
353
|
-
| `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. | |
|
|
354
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
|
|
355
|
-
|
|
356
|
-
### Response
|
|
357
|
-
|
|
358
|
-
**Promise\<void\>**
|
|
359
|
-
|
|
360
|
-
### Errors
|
|
361
|
-
|
|
362
|
-
| Error Type | Status Code | Content Type |
|
|
363
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
364
|
-
| errors.Error400 | 400 | application/json |
|
|
365
|
-
| errors.Error401 | 401 | application/json |
|
|
366
|
-
| errors.Error403 | 403 | application/json |
|
|
367
|
-
| errors.Error404 | 404 | application/json |
|
|
368
|
-
| errors.Error405 | 405 | application/json |
|
|
369
|
-
| errors.Error409 | 409 | application/json |
|
|
370
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
371
|
-
| errors.Error425 | 425 | application/json |
|
|
372
|
-
| errors.Error429 | 429 | application/json |
|
|
373
|
-
| errors.Error500 | 500 | application/json |
|
|
374
|
-
| errors.Error502 | 502 | application/json |
|
|
375
|
-
| errors.Error504 | 504 | application/json |
|
|
376
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# PaymentOptions
|
|
2
|
-
(*paymentOptions*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [list](#list) - List payment options
|
|
9
|
-
|
|
10
|
-
## list
|
|
11
|
-
|
|
12
|
-
List the payment options available at checkout. filtering by country, currency, and additional fields passed to Flow rules.
|
|
13
|
-
|
|
14
|
-
### Example Usage
|
|
15
|
-
|
|
16
|
-
<!-- UsageSnippet language="typescript" operationID="list_payment_options" method="post" path="/payment-options" -->
|
|
17
|
-
```typescript
|
|
18
|
-
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
19
|
-
import fs from "fs";
|
|
20
|
-
|
|
21
|
-
const gr4vy = new Gr4vy({
|
|
22
|
-
id: "example",
|
|
23
|
-
server: "sandbox",
|
|
24
|
-
merchantAccountId: "default",
|
|
25
|
-
bearerAuth: withToken({
|
|
26
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
27
|
-
}),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
async function run() {
|
|
31
|
-
const result = await gr4vy.paymentOptions.list({});
|
|
32
|
-
|
|
33
|
-
console.log(result);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
run();
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Standalone function
|
|
40
|
-
|
|
41
|
-
The standalone function version of this method:
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
45
|
-
import { paymentOptionsList } from "@gr4vy/sdk/funcs/paymentOptionsList.js";
|
|
46
|
-
|
|
47
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
48
|
-
// You can create one instance of it to use across an application.
|
|
49
|
-
const gr4vy = new Gr4vyCore({
|
|
50
|
-
merchantAccountId: "<id>",
|
|
51
|
-
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
async function run() {
|
|
55
|
-
const res = await paymentOptionsList(gr4vy, {});
|
|
56
|
-
if (res.ok) {
|
|
57
|
-
const { value: result } = res;
|
|
58
|
-
console.log(result);
|
|
59
|
-
} else {
|
|
60
|
-
console.log("paymentOptionsList failed:", res.error);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
run();
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Parameters
|
|
68
|
-
|
|
69
|
-
| Parameter | Type | Required | Description |
|
|
70
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
71
|
-
| `paymentOptionRequest` | [components.PaymentOptionRequest](../../models/components/paymentoptionrequest.md) | :heavy_check_mark: | N/A |
|
|
72
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
|
|
73
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
74
|
-
| `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. |
|
|
75
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
76
|
-
|
|
77
|
-
### Response
|
|
78
|
-
|
|
79
|
-
**Promise\<[components.PaymentOptions](../../models/components/paymentoptions.md)\>**
|
|
80
|
-
|
|
81
|
-
### Errors
|
|
82
|
-
|
|
83
|
-
| Error Type | Status Code | Content Type |
|
|
84
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
85
|
-
| errors.Error400 | 400 | application/json |
|
|
86
|
-
| errors.Error401 | 401 | application/json |
|
|
87
|
-
| errors.Error403 | 403 | application/json |
|
|
88
|
-
| errors.Error404 | 404 | application/json |
|
|
89
|
-
| errors.Error405 | 405 | application/json |
|
|
90
|
-
| errors.Error409 | 409 | application/json |
|
|
91
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
92
|
-
| errors.Error425 | 425 | application/json |
|
|
93
|
-
| errors.Error429 | 429 | application/json |
|
|
94
|
-
| errors.Error500 | 500 | application/json |
|
|
95
|
-
| errors.Error502 | 502 | application/json |
|
|
96
|
-
| errors.Error504 | 504 | application/json |
|
|
97
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|