@gr4vy/sdk 1.1.28 → 1.1.30

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 (63) hide show
  1. package/FUNCTIONS.md +9 -9
  2. package/README.md +91 -61
  3. package/docs/sdks/all/README.md +9 -13
  4. package/docs/sdks/auditlogs/README.md +9 -13
  5. package/docs/sdks/balances/README.md +9 -13
  6. package/docs/sdks/buyers/README.md +45 -65
  7. package/docs/sdks/cardschemedefinitions/README.md +9 -13
  8. package/docs/sdks/checkoutsessions/README.md +36 -52
  9. package/docs/sdks/cryptogram/README.md +9 -13
  10. package/docs/sdks/digitalwallets/README.md +45 -65
  11. package/docs/sdks/domains/README.md +18 -26
  12. package/docs/sdks/events/README.md +9 -13
  13. package/docs/sdks/executions/README.md +27 -39
  14. package/docs/sdks/giftcards/README.md +36 -52
  15. package/docs/sdks/gr4vy/README.md +0 -83
  16. package/docs/sdks/gr4vygiftcards/README.md +9 -13
  17. package/docs/sdks/gr4vypaymentmethods/README.md +9 -13
  18. package/docs/sdks/gr4vyrefunds/README.md +27 -39
  19. package/docs/sdks/jobs/README.md +9 -13
  20. package/docs/sdks/merchantaccounts/README.md +36 -48
  21. package/docs/sdks/networktokens/README.md +45 -65
  22. package/docs/sdks/paymentlinks/README.md +36 -52
  23. package/docs/sdks/paymentmethods/README.md +36 -52
  24. package/docs/sdks/paymentoptions/README.md +9 -13
  25. package/docs/sdks/paymentservicedefinitions/README.md +27 -36
  26. package/docs/sdks/paymentservices/README.md +63 -91
  27. package/docs/sdks/paymentservicetokens/README.md +27 -39
  28. package/docs/sdks/payouts/README.md +27 -39
  29. package/docs/sdks/refunds/README.md +9 -13
  30. package/docs/sdks/reportexecutions/README.md +9 -13
  31. package/docs/sdks/reports/README.md +36 -52
  32. package/docs/sdks/sessions/README.md +27 -38
  33. package/docs/sdks/settlements/README.md +18 -26
  34. package/docs/sdks/shippingdetails/README.md +45 -65
  35. package/docs/sdks/transactions/README.md +63 -91
  36. package/examples/accountUpdaterJobsCreate.example.ts +37 -0
  37. package/examples/package-lock.json +2716 -0
  38. package/jsr.json +1 -1
  39. package/lib/config.d.ts +3 -3
  40. package/lib/config.js +3 -3
  41. package/models/operations/index.d.ts +0 -1
  42. package/models/operations/index.d.ts.map +1 -1
  43. package/models/operations/index.js +0 -1
  44. package/models/operations/index.js.map +1 -1
  45. package/package.json +1 -1
  46. package/sdk/sdk.d.ts +1 -5
  47. package/sdk/sdk.d.ts.map +1 -1
  48. package/sdk/sdk.js +0 -8
  49. package/sdk/sdk.js.map +1 -1
  50. package/src/lib/config.ts +3 -3
  51. package/src/models/operations/index.ts +0 -1
  52. package/src/sdk/sdk.ts +1 -17
  53. package/examples/browsePaymentMethodDefinitionsGet.example.ts +0 -27
  54. package/funcs/browsePaymentMethodDefinitionsGet.d.ts +0 -14
  55. package/funcs/browsePaymentMethodDefinitionsGet.d.ts.map +0 -1
  56. package/funcs/browsePaymentMethodDefinitionsGet.js +0 -130
  57. package/funcs/browsePaymentMethodDefinitionsGet.js.map +0 -1
  58. package/models/operations/browsepaymentmethoddefinitionsget.d.ts +0 -57
  59. package/models/operations/browsepaymentmethoddefinitionsget.d.ts.map +0 -1
  60. package/models/operations/browsepaymentmethoddefinitionsget.js +0 -96
  61. package/models/operations/browsepaymentmethoddefinitionsget.js.map +0 -1
  62. package/src/funcs/browsePaymentMethodDefinitionsGet.ts +0 -188
  63. package/src/models/operations/browsepaymentmethoddefinitionsget.ts +0 -149
@@ -17,15 +17,16 @@ Returns a list of payouts made.
17
17
 
18
18
  <!-- UsageSnippet language="typescript" operationID="list_payouts" method="get" path="/payouts" -->
19
19
  ```typescript
20
- import { Gr4vy } from "@gr4vy/sdk";
20
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
21
+ import fs from "fs";
21
22
 
22
23
  const gr4vy = new Gr4vy({
23
- merchantAccountId: "<id>",
24
- server: "sandbox",
25
- id: "example",
26
- bearerAuth: withToken({
27
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
28
- }),
24
+ id: "example",
25
+ server: "sandbox",
26
+ merchantAccountId: "default",
27
+ bearerAuth: withToken({
28
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
29
+ }),
29
30
  });
30
31
 
31
32
  async function run() {
@@ -45,18 +46,13 @@ The standalone function version of this method:
45
46
 
46
47
  ```typescript
47
48
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
48
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
49
49
  import { payoutsList } from "@gr4vy/sdk/funcs/payoutsList.js";
50
50
 
51
51
  // Use `Gr4vyCore` for best tree-shaking performance.
52
52
  // You can create one instance of it to use across an application.
53
53
  const gr4vy = new Gr4vyCore({
54
54
  merchantAccountId: "<id>",
55
- server: "sandbox",
56
- id: "example",
57
- bearerAuth: withToken({
58
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
59
- }),
55
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
60
56
  });
61
57
 
62
58
  async function run() {
@@ -115,15 +111,16 @@ Creates a new payout.
115
111
 
116
112
  <!-- UsageSnippet language="typescript" operationID="create_payout" method="post" path="/payouts" -->
117
113
  ```typescript
118
- import { Gr4vy } from "@gr4vy/sdk";
114
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
115
+ import fs from "fs";
119
116
 
120
117
  const gr4vy = new Gr4vy({
121
- merchantAccountId: "<id>",
122
- server: "sandbox",
123
- id: "example",
124
- bearerAuth: withToken({
125
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
126
- }),
118
+ id: "example",
119
+ server: "sandbox",
120
+ merchantAccountId: "default",
121
+ bearerAuth: withToken({
122
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
123
+ }),
127
124
  });
128
125
 
129
126
  async function run() {
@@ -149,18 +146,13 @@ The standalone function version of this method:
149
146
 
150
147
  ```typescript
151
148
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
152
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
153
149
  import { payoutsCreate } from "@gr4vy/sdk/funcs/payoutsCreate.js";
154
150
 
155
151
  // Use `Gr4vyCore` for best tree-shaking performance.
156
152
  // You can create one instance of it to use across an application.
157
153
  const gr4vy = new Gr4vyCore({
158
154
  merchantAccountId: "<id>",
159
- server: "sandbox",
160
- id: "example",
161
- bearerAuth: withToken({
162
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
163
- }),
155
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
164
156
  });
165
157
 
166
158
  async function run() {
@@ -224,15 +216,16 @@ Retrieves a payout.
224
216
 
225
217
  <!-- UsageSnippet language="typescript" operationID="get_payout" method="get" path="/payouts/{payout_id}" -->
226
218
  ```typescript
227
- import { Gr4vy } from "@gr4vy/sdk";
219
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
220
+ import fs from "fs";
228
221
 
229
222
  const gr4vy = new Gr4vy({
230
- merchantAccountId: "<id>",
231
- server: "sandbox",
232
- id: "example",
233
- bearerAuth: withToken({
234
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
235
- }),
223
+ id: "example",
224
+ server: "sandbox",
225
+ merchantAccountId: "default",
226
+ bearerAuth: withToken({
227
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
228
+ }),
236
229
  });
237
230
 
238
231
  async function run() {
@@ -250,18 +243,13 @@ The standalone function version of this method:
250
243
 
251
244
  ```typescript
252
245
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
253
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
254
246
  import { payoutsGet } from "@gr4vy/sdk/funcs/payoutsGet.js";
255
247
 
256
248
  // Use `Gr4vyCore` for best tree-shaking performance.
257
249
  // You can create one instance of it to use across an application.
258
250
  const gr4vy = new Gr4vyCore({
259
251
  merchantAccountId: "<id>",
260
- server: "sandbox",
261
- id: "example",
262
- bearerAuth: withToken({
263
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
264
- }),
252
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
265
253
  });
266
254
 
267
255
  async function run() {
@@ -15,15 +15,16 @@ Fetch a refund.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="get_refund" method="get" path="/refunds/{refund_id}" -->
17
17
  ```typescript
18
- import { Gr4vy } from "@gr4vy/sdk";
18
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
19
+ import fs from "fs";
19
20
 
20
21
  const gr4vy = new Gr4vy({
21
- merchantAccountId: "<id>",
22
- server: "sandbox",
23
- id: "example",
24
- bearerAuth: withToken({
25
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
- }),
22
+ id: "example",
23
+ server: "sandbox",
24
+ merchantAccountId: "default",
25
+ bearerAuth: withToken({
26
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
+ }),
27
28
  });
28
29
 
29
30
  async function run() {
@@ -41,18 +42,13 @@ The standalone function version of this method:
41
42
 
42
43
  ```typescript
43
44
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
44
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
45
45
  import { refundsGet } from "@gr4vy/sdk/funcs/refundsGet.js";
46
46
 
47
47
  // Use `Gr4vyCore` for best tree-shaking performance.
48
48
  // You can create one instance of it to use across an application.
49
49
  const gr4vy = new Gr4vyCore({
50
50
  merchantAccountId: "<id>",
51
- server: "sandbox",
52
- id: "example",
53
- bearerAuth: withToken({
54
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
55
- }),
51
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
56
52
  });
57
53
 
58
54
  async function run() {
@@ -15,15 +15,16 @@ List all executed reports that have been generated.
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_all_report_executions" method="get" path="/report-executions" -->
17
17
  ```typescript
18
- import { Gr4vy } from "@gr4vy/sdk";
18
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
19
+ import fs from "fs";
19
20
 
20
21
  const gr4vy = new Gr4vy({
21
- merchantAccountId: "<id>",
22
- server: "sandbox",
23
- id: "example",
24
- bearerAuth: withToken({
25
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
26
- }),
22
+ id: "example",
23
+ server: "sandbox",
24
+ merchantAccountId: "default",
25
+ bearerAuth: withToken({
26
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
+ }),
27
28
  });
28
29
 
29
30
  async function run() {
@@ -43,18 +44,13 @@ The standalone function version of this method:
43
44
 
44
45
  ```typescript
45
46
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
46
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
47
47
  import { reportExecutionsList } from "@gr4vy/sdk/funcs/reportExecutionsList.js";
48
48
 
49
49
  // Use `Gr4vyCore` for best tree-shaking performance.
50
50
  // You can create one instance of it to use across an application.
51
51
  const gr4vy = new Gr4vyCore({
52
52
  merchantAccountId: "<id>",
53
- server: "sandbox",
54
- id: "example",
55
- bearerAuth: withToken({
56
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
57
- }),
53
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
58
54
  });
59
55
 
60
56
  async function run() {
@@ -18,15 +18,16 @@ List all configured reports that can be generated.
18
18
 
19
19
  <!-- UsageSnippet language="typescript" operationID="list_reports" method="get" path="/reports" -->
20
20
  ```typescript
21
- import { Gr4vy } from "@gr4vy/sdk";
21
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
22
+ import fs from "fs";
22
23
 
23
24
  const gr4vy = new Gr4vy({
24
- merchantAccountId: "<id>",
25
- server: "sandbox",
26
- id: "example",
27
- bearerAuth: withToken({
28
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
29
- }),
25
+ id: "example",
26
+ server: "sandbox",
27
+ merchantAccountId: "default",
28
+ bearerAuth: withToken({
29
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
30
+ }),
30
31
  });
31
32
 
32
33
  async function run() {
@@ -46,18 +47,13 @@ The standalone function version of this method:
46
47
 
47
48
  ```typescript
48
49
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
49
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
50
50
  import { reportsList } from "@gr4vy/sdk/funcs/reportsList.js";
51
51
 
52
52
  // Use `Gr4vyCore` for best tree-shaking performance.
53
53
  // You can create one instance of it to use across an application.
54
54
  const gr4vy = new Gr4vyCore({
55
55
  merchantAccountId: "<id>",
56
- server: "sandbox",
57
- id: "example",
58
- bearerAuth: withToken({
59
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
60
- }),
56
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
61
57
  });
62
58
 
63
59
  async function run() {
@@ -114,15 +110,16 @@ Create a new report.
114
110
 
115
111
  <!-- UsageSnippet language="typescript" operationID="add_report" method="post" path="/reports" -->
116
112
  ```typescript
117
- import { Gr4vy } from "@gr4vy/sdk";
113
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
114
+ import fs from "fs";
118
115
 
119
116
  const gr4vy = new Gr4vy({
120
- merchantAccountId: "<id>",
121
- server: "sandbox",
122
- id: "example",
123
- bearerAuth: withToken({
124
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
125
- }),
117
+ id: "example",
118
+ server: "sandbox",
119
+ merchantAccountId: "default",
120
+ bearerAuth: withToken({
121
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
122
+ }),
126
123
  });
127
124
 
128
125
  async function run() {
@@ -156,18 +153,13 @@ The standalone function version of this method:
156
153
 
157
154
  ```typescript
158
155
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
159
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
160
156
  import { reportsCreate } from "@gr4vy/sdk/funcs/reportsCreate.js";
161
157
 
162
158
  // Use `Gr4vyCore` for best tree-shaking performance.
163
159
  // You can create one instance of it to use across an application.
164
160
  const gr4vy = new Gr4vyCore({
165
161
  merchantAccountId: "<id>",
166
- server: "sandbox",
167
- id: "example",
168
- bearerAuth: withToken({
169
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
170
- }),
162
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
171
163
  });
172
164
 
173
165
  async function run() {
@@ -239,15 +231,16 @@ Fetches a report by its ID.
239
231
 
240
232
  <!-- UsageSnippet language="typescript" operationID="get_report" method="get" path="/reports/{report_id}" -->
241
233
  ```typescript
242
- import { Gr4vy } from "@gr4vy/sdk";
234
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
235
+ import fs from "fs";
243
236
 
244
237
  const gr4vy = new Gr4vy({
245
- merchantAccountId: "<id>",
246
- server: "sandbox",
247
- id: "example",
248
- bearerAuth: withToken({
249
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
250
- }),
238
+ id: "example",
239
+ server: "sandbox",
240
+ merchantAccountId: "default",
241
+ bearerAuth: withToken({
242
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
243
+ }),
251
244
  });
252
245
 
253
246
  async function run() {
@@ -265,18 +258,13 @@ The standalone function version of this method:
265
258
 
266
259
  ```typescript
267
260
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
268
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
269
261
  import { reportsGet } from "@gr4vy/sdk/funcs/reportsGet.js";
270
262
 
271
263
  // Use `Gr4vyCore` for best tree-shaking performance.
272
264
  // You can create one instance of it to use across an application.
273
265
  const gr4vy = new Gr4vyCore({
274
266
  merchantAccountId: "<id>",
275
- server: "sandbox",
276
- id: "example",
277
- bearerAuth: withToken({
278
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
279
- }),
267
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
280
268
  });
281
269
 
282
270
  async function run() {
@@ -332,15 +320,16 @@ Updates the configuration of a report.
332
320
 
333
321
  <!-- UsageSnippet language="typescript" operationID="update_report" method="put" path="/reports/{report_id}" -->
334
322
  ```typescript
335
- import { Gr4vy } from "@gr4vy/sdk";
323
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
324
+ import fs from "fs";
336
325
 
337
326
  const gr4vy = new Gr4vy({
338
- merchantAccountId: "<id>",
339
- server: "sandbox",
340
- id: "example",
341
- bearerAuth: withToken({
342
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
343
- }),
327
+ id: "example",
328
+ server: "sandbox",
329
+ merchantAccountId: "default",
330
+ bearerAuth: withToken({
331
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
332
+ }),
344
333
  });
345
334
 
346
335
  async function run() {
@@ -358,18 +347,13 @@ The standalone function version of this method:
358
347
 
359
348
  ```typescript
360
349
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
361
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
362
350
  import { reportsPut } from "@gr4vy/sdk/funcs/reportsPut.js";
363
351
 
364
352
  // Use `Gr4vyCore` for best tree-shaking performance.
365
353
  // You can create one instance of it to use across an application.
366
354
  const gr4vy = new Gr4vyCore({
367
355
  merchantAccountId: "<id>",
368
- server: "sandbox",
369
- id: "example",
370
- bearerAuth: withToken({
371
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
372
- }),
356
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
373
357
  });
374
358
 
375
359
  async function run() {
@@ -17,15 +17,16 @@ Create a session for use with Google Pay.
17
17
 
18
18
  <!-- UsageSnippet language="typescript" operationID="create_google_pay_digital_wallet_session" method="post" path="/digital-wallets/google/session" -->
19
19
  ```typescript
20
- import { Gr4vy } from "@gr4vy/sdk";
20
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
21
+ import fs from "fs";
21
22
 
22
23
  const gr4vy = new Gr4vy({
23
- merchantAccountId: "<id>",
24
- server: "sandbox",
25
- id: "example",
26
- bearerAuth: withToken({
27
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
28
- }),
24
+ id: "example",
25
+ server: "sandbox",
26
+ merchantAccountId: "default",
27
+ bearerAuth: withToken({
28
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
29
+ }),
29
30
  });
30
31
 
31
32
  async function run() {
@@ -45,18 +46,13 @@ The standalone function version of this method:
45
46
 
46
47
  ```typescript
47
48
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
48
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
49
49
  import { digitalWalletsSessionsGooglePay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsGooglePay.js";
50
50
 
51
51
  // Use `Gr4vyCore` for best tree-shaking performance.
52
52
  // You can create one instance of it to use across an application.
53
53
  const gr4vy = new Gr4vyCore({
54
54
  merchantAccountId: "<id>",
55
- server: "sandbox",
56
- id: "example",
57
- bearerAuth: withToken({
58
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
59
- }),
55
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
60
56
  });
61
57
 
62
58
  async function run() {
@@ -114,15 +110,16 @@ Create a session for use with Apple Pay.
114
110
 
115
111
  <!-- UsageSnippet language="typescript" operationID="create_apple_pay_digital_wallet_session" method="post" path="/digital-wallets/apple/session" -->
116
112
  ```typescript
117
- import { Gr4vy } from "@gr4vy/sdk";
113
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
114
+ import fs from "fs";
118
115
 
119
116
  const gr4vy = new Gr4vy({
120
- merchantAccountId: "<id>",
121
- server: "sandbox",
122
- id: "example",
123
- bearerAuth: withToken({
124
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
125
- }),
117
+ id: "example",
118
+ server: "sandbox",
119
+ merchantAccountId: "default",
120
+ bearerAuth: withToken({
121
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
122
+ }),
126
123
  });
127
124
 
128
125
  async function run() {
@@ -143,18 +140,13 @@ The standalone function version of this method:
143
140
 
144
141
  ```typescript
145
142
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
146
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
147
143
  import { digitalWalletsSessionsApplePay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsApplePay.js";
148
144
 
149
145
  // Use `Gr4vyCore` for best tree-shaking performance.
150
146
  // You can create one instance of it to use across an application.
151
147
  const gr4vy = new Gr4vyCore({
152
148
  merchantAccountId: "<id>",
153
- server: "sandbox",
154
- id: "example",
155
- bearerAuth: withToken({
156
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
157
- }),
149
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
158
150
  });
159
151
 
160
152
  async function run() {
@@ -213,14 +205,16 @@ Create a session for use with Click to Pay.
213
205
 
214
206
  <!-- UsageSnippet language="typescript" operationID="create_click_to_pay_digital_wallet_session" method="post" path="/digital-wallets/click-to-pay/session" -->
215
207
  ```typescript
216
- import { Gr4vy } from "@gr4vy/sdk";
208
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
209
+ import fs from "fs";
217
210
 
218
211
  const gr4vy = new Gr4vy({
219
- server: "sandbox",
220
- id: "example",
221
- bearerAuth: withToken({
222
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
223
- }),
212
+ id: "example",
213
+ server: "sandbox",
214
+ merchantAccountId: "default",
215
+ bearerAuth: withToken({
216
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
217
+ }),
224
218
  });
225
219
 
226
220
  async function run() {
@@ -240,17 +234,12 @@ The standalone function version of this method:
240
234
 
241
235
  ```typescript
242
236
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
243
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
244
237
  import { digitalWalletsSessionsClickToPay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsClickToPay.js";
245
238
 
246
239
  // Use `Gr4vyCore` for best tree-shaking performance.
247
240
  // You can create one instance of it to use across an application.
248
241
  const gr4vy = new Gr4vyCore({
249
- server: "sandbox",
250
- id: "example",
251
- bearerAuth: withToken({
252
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
253
- }),
242
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
254
243
  });
255
244
 
256
245
  async function run() {
@@ -16,15 +16,16 @@ Retrieve a specific settlement for a transaction by its unique identifier.
16
16
 
17
17
  <!-- UsageSnippet language="typescript" operationID="get_transaction_settlement" method="get" path="/transactions/{transaction_id}/settlements/{settlement_id}" -->
18
18
  ```typescript
19
- import { Gr4vy } from "@gr4vy/sdk";
19
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
20
+ import fs from "fs";
20
21
 
21
22
  const gr4vy = new Gr4vy({
22
- merchantAccountId: "<id>",
23
- server: "sandbox",
24
- id: "example",
25
- bearerAuth: withToken({
26
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
- }),
23
+ id: "example",
24
+ server: "sandbox",
25
+ merchantAccountId: "default",
26
+ bearerAuth: withToken({
27
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
28
+ }),
28
29
  });
29
30
 
30
31
  async function run() {
@@ -42,18 +43,13 @@ The standalone function version of this method:
42
43
 
43
44
  ```typescript
44
45
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
45
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
46
46
  import { transactionsSettlementsGet } from "@gr4vy/sdk/funcs/transactionsSettlementsGet.js";
47
47
 
48
48
  // Use `Gr4vyCore` for best tree-shaking performance.
49
49
  // You can create one instance of it to use across an application.
50
50
  const gr4vy = new Gr4vyCore({
51
51
  merchantAccountId: "<id>",
52
- server: "sandbox",
53
- id: "example",
54
- bearerAuth: withToken({
55
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
56
- }),
52
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
57
53
  });
58
54
 
59
55
  async function run() {
@@ -110,15 +106,16 @@ List all settlements for a specific transaction.
110
106
 
111
107
  <!-- UsageSnippet language="typescript" operationID="list_transaction_settlements" method="get" path="/transactions/{transaction_id}/settlements" -->
112
108
  ```typescript
113
- import { Gr4vy } from "@gr4vy/sdk";
109
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
110
+ import fs from "fs";
114
111
 
115
112
  const gr4vy = new Gr4vy({
116
- merchantAccountId: "<id>",
117
- server: "sandbox",
118
- id: "example",
119
- bearerAuth: withToken({
120
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
121
- }),
113
+ id: "example",
114
+ server: "sandbox",
115
+ merchantAccountId: "default",
116
+ bearerAuth: withToken({
117
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
118
+ }),
122
119
  });
123
120
 
124
121
  async function run() {
@@ -136,18 +133,13 @@ The standalone function version of this method:
136
133
 
137
134
  ```typescript
138
135
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
139
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
140
136
  import { transactionsSettlementsList } from "@gr4vy/sdk/funcs/transactionsSettlementsList.js";
141
137
 
142
138
  // Use `Gr4vyCore` for best tree-shaking performance.
143
139
  // You can create one instance of it to use across an application.
144
140
  const gr4vy = new Gr4vyCore({
145
141
  merchantAccountId: "<id>",
146
- server: "sandbox",
147
- id: "example",
148
- bearerAuth: withToken({
149
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
150
- }),
142
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
151
143
  });
152
144
 
153
145
  async function run() {