@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.
Files changed (49) hide show
  1. package/examples/package-lock.json +1 -1
  2. package/jsr.json +1 -1
  3. package/lib/config.d.ts +3 -3
  4. package/lib/config.js +3 -3
  5. package/models/components/checkoutsession.d.ts +15 -0
  6. package/models/components/checkoutsession.d.ts.map +1 -1
  7. package/models/components/checkoutsession.js +8 -0
  8. package/models/components/checkoutsession.js.map +1 -1
  9. package/models/components/checkoutsessioncreate.d.ts +15 -0
  10. package/models/components/checkoutsessioncreate.d.ts.map +1 -1
  11. package/models/components/checkoutsessioncreate.js +8 -0
  12. package/models/components/checkoutsessioncreate.js.map +1 -1
  13. package/package.json +1 -1
  14. package/src/lib/config.ts +3 -3
  15. package/src/models/components/checkoutsession.ts +23 -0
  16. package/src/models/components/checkoutsessioncreate.ts +23 -0
  17. package/docs/sdks/all/README.md +0 -98
  18. package/docs/sdks/auditlogs/README.md +0 -100
  19. package/docs/sdks/balances/README.md +0 -123
  20. package/docs/sdks/buyers/README.md +0 -461
  21. package/docs/sdks/cardschemedefinitions/README.md +0 -96
  22. package/docs/sdks/checkoutsessions/README.md +0 -367
  23. package/docs/sdks/cryptogram/README.md +0 -103
  24. package/docs/sdks/digitalwallets/README.md +0 -465
  25. package/docs/sdks/domains/README.md +0 -197
  26. package/docs/sdks/events/README.md +0 -99
  27. package/docs/sdks/executions/README.md +0 -285
  28. package/docs/sdks/giftcards/README.md +0 -376
  29. package/docs/sdks/gr4vygiftcards/README.md +0 -98
  30. package/docs/sdks/gr4vypaymentmethods/README.md +0 -96
  31. package/docs/sdks/gr4vyrefunds/README.md +0 -279
  32. package/docs/sdks/jobs/README.md +0 -107
  33. package/docs/sdks/merchantaccounts/README.md +0 -382
  34. package/docs/sdks/networktokens/README.md +0 -467
  35. package/docs/sdks/paymentlinks/README.md +0 -381
  36. package/docs/sdks/paymentmethods/README.md +0 -376
  37. package/docs/sdks/paymentoptions/README.md +0 -97
  38. package/docs/sdks/paymentservicedefinitions/README.md +0 -281
  39. package/docs/sdks/paymentservices/README.md +0 -706
  40. package/docs/sdks/paymentservicetokens/README.md +0 -286
  41. package/docs/sdks/payouts/README.md +0 -298
  42. package/docs/sdks/refunds/README.md +0 -97
  43. package/docs/sdks/reportexecutions/README.md +0 -100
  44. package/docs/sdks/reports/README.md +0 -403
  45. package/docs/sdks/sessions/README.md +0 -289
  46. package/docs/sdks/settlements/README.md +0 -188
  47. package/docs/sdks/shippingdetails/README.md +0 -462
  48. package/docs/sdks/transactions/README.md +0 -752
  49. package/examples/README.md +0 -31
@@ -1,376 +0,0 @@
1
- # GiftCards
2
- (*giftCards*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [get](#get) - Get gift card
9
- * [delete](#delete) - Delete a gift card
10
- * [create](#create) - Create gift card
11
- * [list](#list) - List gift cards
12
-
13
- ## get
14
-
15
- Fetch details about a gift card.
16
-
17
- ### Example Usage
18
-
19
- <!-- UsageSnippet language="typescript" operationID="get_gift_card" method="get" path="/gift-cards/{gift_card_id}" -->
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.giftCards.get("356d56e5-fe16-42ae-97ee-8d55d846ae2e");
35
-
36
- console.log(result);
37
- }
38
-
39
- run();
40
- ```
41
-
42
- ### Standalone function
43
-
44
- The standalone function version of this method:
45
-
46
- ```typescript
47
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
48
- import { giftCardsGet } from "@gr4vy/sdk/funcs/giftCardsGet.js";
49
-
50
- // Use `Gr4vyCore` for best tree-shaking performance.
51
- // You can create one instance of it to use across an application.
52
- const gr4vy = new Gr4vyCore({
53
- merchantAccountId: "<id>",
54
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
55
- });
56
-
57
- async function run() {
58
- const res = await giftCardsGet(gr4vy, "356d56e5-fe16-42ae-97ee-8d55d846ae2e");
59
- if (res.ok) {
60
- const { value: result } = res;
61
- console.log(result);
62
- } else {
63
- console.log("giftCardsGet failed:", res.error);
64
- }
65
- }
66
-
67
- run();
68
- ```
69
-
70
- ### Parameters
71
-
72
- | Parameter | Type | Required | Description | Example |
73
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
74
- | `giftCardId` | *string* | :heavy_check_mark: | The ID of the gift card. | [object Object] |
75
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
76
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
77
- | `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. | |
78
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
79
-
80
- ### Response
81
-
82
- **Promise\<[components.GiftCard](../../models/components/giftcard.md)\>**
83
-
84
- ### Errors
85
-
86
- | Error Type | Status Code | Content Type |
87
- | -------------------------- | -------------------------- | -------------------------- |
88
- | errors.Error400 | 400 | application/json |
89
- | errors.Error401 | 401 | application/json |
90
- | errors.Error403 | 403 | application/json |
91
- | errors.Error404 | 404 | application/json |
92
- | errors.Error405 | 405 | application/json |
93
- | errors.Error409 | 409 | application/json |
94
- | errors.HTTPValidationError | 422 | application/json |
95
- | errors.Error425 | 425 | application/json |
96
- | errors.Error429 | 429 | application/json |
97
- | errors.Error500 | 500 | application/json |
98
- | errors.Error502 | 502 | application/json |
99
- | errors.Error504 | 504 | application/json |
100
- | errors.SDKError | 4XX, 5XX | \*/\* |
101
-
102
- ## delete
103
-
104
- Removes a gift card from our system.
105
-
106
- ### Example Usage
107
-
108
- <!-- UsageSnippet language="typescript" operationID="delete_gift_card" method="delete" path="/gift-cards/{gift_card_id}" -->
109
- ```typescript
110
- import { Gr4vy, withToken } from "@gr4vy/sdk";
111
- import fs from "fs";
112
-
113
- const gr4vy = new Gr4vy({
114
- id: "example",
115
- server: "sandbox",
116
- merchantAccountId: "default",
117
- bearerAuth: withToken({
118
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
119
- }),
120
- });
121
-
122
- async function run() {
123
- await gr4vy.giftCards.delete("356d56e5-fe16-42ae-97ee-8d55d846ae2e");
124
-
125
-
126
- }
127
-
128
- run();
129
- ```
130
-
131
- ### Standalone function
132
-
133
- The standalone function version of this method:
134
-
135
- ```typescript
136
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
137
- import { giftCardsDelete } from "@gr4vy/sdk/funcs/giftCardsDelete.js";
138
-
139
- // Use `Gr4vyCore` for best tree-shaking performance.
140
- // You can create one instance of it to use across an application.
141
- const gr4vy = new Gr4vyCore({
142
- merchantAccountId: "<id>",
143
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
144
- });
145
-
146
- async function run() {
147
- const res = await giftCardsDelete(gr4vy, "356d56e5-fe16-42ae-97ee-8d55d846ae2e");
148
- if (res.ok) {
149
- const { value: result } = res;
150
-
151
- } else {
152
- console.log("giftCardsDelete failed:", res.error);
153
- }
154
- }
155
-
156
- run();
157
- ```
158
-
159
- ### Parameters
160
-
161
- | Parameter | Type | Required | Description | Example |
162
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
163
- | `giftCardId` | *string* | :heavy_check_mark: | The ID of the gift card. | [object Object] |
164
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | |
165
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
166
- | `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. | |
167
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | |
168
-
169
- ### Response
170
-
171
- **Promise\<void\>**
172
-
173
- ### Errors
174
-
175
- | Error Type | Status Code | Content Type |
176
- | -------------------------- | -------------------------- | -------------------------- |
177
- | errors.Error400 | 400 | application/json |
178
- | errors.Error401 | 401 | application/json |
179
- | errors.Error403 | 403 | application/json |
180
- | errors.Error404 | 404 | application/json |
181
- | errors.Error405 | 405 | application/json |
182
- | errors.Error409 | 409 | application/json |
183
- | errors.HTTPValidationError | 422 | application/json |
184
- | errors.Error425 | 425 | application/json |
185
- | errors.Error429 | 429 | application/json |
186
- | errors.Error500 | 500 | application/json |
187
- | errors.Error502 | 502 | application/json |
188
- | errors.Error504 | 504 | application/json |
189
- | errors.SDKError | 4XX, 5XX | \*/\* |
190
-
191
- ## create
192
-
193
- Store a new gift card in the vault.
194
-
195
- ### Example Usage
196
-
197
- <!-- UsageSnippet language="typescript" operationID="create_gift_card" method="post" path="/gift-cards" -->
198
- ```typescript
199
- import { Gr4vy, withToken } from "@gr4vy/sdk";
200
- import fs from "fs";
201
-
202
- const gr4vy = new Gr4vy({
203
- id: "example",
204
- server: "sandbox",
205
- merchantAccountId: "default",
206
- bearerAuth: withToken({
207
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
208
- }),
209
- });
210
-
211
- async function run() {
212
- const result = await gr4vy.giftCards.create({
213
- number: "4123455541234561234",
214
- pin: "1234",
215
- });
216
-
217
- console.log(result);
218
- }
219
-
220
- run();
221
- ```
222
-
223
- ### Standalone function
224
-
225
- The standalone function version of this method:
226
-
227
- ```typescript
228
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
229
- import { giftCardsCreate } from "@gr4vy/sdk/funcs/giftCardsCreate.js";
230
-
231
- // Use `Gr4vyCore` for best tree-shaking performance.
232
- // You can create one instance of it to use across an application.
233
- const gr4vy = new Gr4vyCore({
234
- merchantAccountId: "<id>",
235
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
236
- });
237
-
238
- async function run() {
239
- const res = await giftCardsCreate(gr4vy, {
240
- number: "4123455541234561234",
241
- pin: "1234",
242
- });
243
- if (res.ok) {
244
- const { value: result } = res;
245
- console.log(result);
246
- } else {
247
- console.log("giftCardsCreate failed:", res.error);
248
- }
249
- }
250
-
251
- run();
252
- ```
253
-
254
- ### Parameters
255
-
256
- | Parameter | Type | Required | Description |
257
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
258
- | `giftCardCreate` | [components.GiftCardCreate](../../models/components/giftcardcreate.md) | :heavy_check_mark: | N/A |
259
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
260
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
261
- | `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. |
262
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
263
-
264
- ### Response
265
-
266
- **Promise\<[components.GiftCard](../../models/components/giftcard.md)\>**
267
-
268
- ### Errors
269
-
270
- | Error Type | Status Code | Content Type |
271
- | -------------------------- | -------------------------- | -------------------------- |
272
- | errors.Error400 | 400 | application/json |
273
- | errors.Error401 | 401 | application/json |
274
- | errors.Error403 | 403 | application/json |
275
- | errors.Error404 | 404 | application/json |
276
- | errors.Error405 | 405 | application/json |
277
- | errors.Error409 | 409 | application/json |
278
- | errors.HTTPValidationError | 422 | application/json |
279
- | errors.Error425 | 425 | application/json |
280
- | errors.Error429 | 429 | application/json |
281
- | errors.Error500 | 500 | application/json |
282
- | errors.Error502 | 502 | application/json |
283
- | errors.Error504 | 504 | application/json |
284
- | errors.SDKError | 4XX, 5XX | \*/\* |
285
-
286
- ## list
287
-
288
- Browser all gift cards.
289
-
290
- ### Example Usage
291
-
292
- <!-- UsageSnippet language="typescript" operationID="list_gift_cards" method="get" path="/gift-cards" -->
293
- ```typescript
294
- import { Gr4vy, withToken } from "@gr4vy/sdk";
295
- import fs from "fs";
296
-
297
- const gr4vy = new Gr4vy({
298
- id: "example",
299
- server: "sandbox",
300
- merchantAccountId: "default",
301
- bearerAuth: withToken({
302
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
303
- }),
304
- });
305
-
306
- async function run() {
307
- const result = await gr4vy.giftCards.list();
308
-
309
- for await (const page of result) {
310
- console.log(page);
311
- }
312
- }
313
-
314
- run();
315
- ```
316
-
317
- ### Standalone function
318
-
319
- The standalone function version of this method:
320
-
321
- ```typescript
322
- import { Gr4vyCore } from "@gr4vy/sdk/core.js";
323
- import { giftCardsList } from "@gr4vy/sdk/funcs/giftCardsList.js";
324
-
325
- // Use `Gr4vyCore` for best tree-shaking performance.
326
- // You can create one instance of it to use across an application.
327
- const gr4vy = new Gr4vyCore({
328
- merchantAccountId: "<id>",
329
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
330
- });
331
-
332
- async function run() {
333
- const res = await giftCardsList(gr4vy);
334
- if (res.ok) {
335
- const { value: result } = res;
336
- for await (const page of result) {
337
- console.log(page);
338
- }
339
- } else {
340
- console.log("giftCardsList failed:", res.error);
341
- }
342
- }
343
-
344
- run();
345
- ```
346
-
347
- ### Parameters
348
-
349
- | Parameter | Type | Required | Description |
350
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
351
- | `request` | [operations.ListGiftCardsRequest](../../models/operations/listgiftcardsrequest.md) | :heavy_check_mark: | The request object to use for the 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\<[operations.ListGiftCardsResponse](../../models/operations/listgiftcardsresponse.md)\>**
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,98 +0,0 @@
1
- # Gr4vyGiftCards
2
- (*buyers.giftCards*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List gift cards for a buyer
9
-
10
- ## list
11
-
12
- List all the stored gift cards for a specific buyer.
13
-
14
- ### Example Usage
15
-
16
- <!-- UsageSnippet language="typescript" operationID="list_buyer_gift_cards" method="get" path="/buyers/gift-cards" -->
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.buyers.giftCards.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 { buyersGiftCardsList } from "@gr4vy/sdk/funcs/buyersGiftCardsList.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 buyersGiftCardsList(gr4vy);
56
- if (res.ok) {
57
- const { value: result } = res;
58
- console.log(result);
59
- } else {
60
- console.log("buyersGiftCardsList failed:", res.error);
61
- }
62
- }
63
-
64
- run();
65
- ```
66
-
67
- ### Parameters
68
-
69
- | Parameter | Type | Required | Description |
70
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71
- | `buyerExternalIdentifier` | *string* | :heavy_minus_sign: | N/A |
72
- | `buyerId` | *string* | :heavy_minus_sign: | N/A |
73
- | `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
74
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
75
- | `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. |
76
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
77
-
78
- ### Response
79
-
80
- **Promise\<[components.GiftCardSummaries](../../models/components/giftcardsummaries.md)\>**
81
-
82
- ### Errors
83
-
84
- | Error Type | Status Code | Content Type |
85
- | -------------------------- | -------------------------- | -------------------------- |
86
- | errors.Error400 | 400 | application/json |
87
- | errors.Error401 | 401 | application/json |
88
- | errors.Error403 | 403 | application/json |
89
- | errors.Error404 | 404 | application/json |
90
- | errors.Error405 | 405 | application/json |
91
- | errors.Error409 | 409 | application/json |
92
- | errors.HTTPValidationError | 422 | application/json |
93
- | errors.Error425 | 425 | application/json |
94
- | errors.Error429 | 429 | application/json |
95
- | errors.Error500 | 500 | application/json |
96
- | errors.Error502 | 502 | application/json |
97
- | errors.Error504 | 504 | application/json |
98
- | errors.SDKError | 4XX, 5XX | \*/\* |
@@ -1,96 +0,0 @@
1
- # Gr4vyPaymentMethods
2
- (*buyers.paymentMethods*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [list](#list) - List payment methods for a buyer
9
-
10
- ## list
11
-
12
- List all the stored payment methods for a specific buyer.
13
-
14
- ### Example Usage
15
-
16
- <!-- UsageSnippet language="typescript" operationID="list_buyer_payment_methods" method="get" path="/buyers/payment-methods" -->
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.buyers.paymentMethods.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 { buyersPaymentMethodsList } from "@gr4vy/sdk/funcs/buyersPaymentMethodsList.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 buyersPaymentMethodsList(gr4vy);
56
- if (res.ok) {
57
- const { value: result } = res;
58
- console.log(result);
59
- } else {
60
- console.log("buyersPaymentMethodsList failed:", res.error);
61
- }
62
- }
63
-
64
- run();
65
- ```
66
-
67
- ### Parameters
68
-
69
- | Parameter | Type | Required | Description |
70
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71
- | `request` | [operations.ListBuyerPaymentMethodsRequest](../../models/operations/listbuyerpaymentmethodsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
72
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
73
- | `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. |
74
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
75
-
76
- ### Response
77
-
78
- **Promise\<[components.PaymentMethodSummaries](../../models/components/paymentmethodsummaries.md)\>**
79
-
80
- ### Errors
81
-
82
- | Error Type | Status Code | Content Type |
83
- | -------------------------- | -------------------------- | -------------------------- |
84
- | errors.Error400 | 400 | application/json |
85
- | errors.Error401 | 401 | application/json |
86
- | errors.Error403 | 403 | application/json |
87
- | errors.Error404 | 404 | application/json |
88
- | errors.Error405 | 405 | application/json |
89
- | errors.Error409 | 409 | application/json |
90
- | errors.HTTPValidationError | 422 | application/json |
91
- | errors.Error425 | 425 | application/json |
92
- | errors.Error429 | 429 | application/json |
93
- | errors.Error500 | 500 | application/json |
94
- | errors.Error502 | 502 | application/json |
95
- | errors.Error504 | 504 | application/json |
96
- | errors.SDKError | 4XX, 5XX | \*/\* |