@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,14 +17,16 @@ List the definitions of each payment service that can be configured.
17
17
 
18
18
  <!-- UsageSnippet language="typescript" operationID="list_payment_service_definitions" method="get" path="/payment-service-definitions" -->
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
- server: "sandbox",
24
- id: "example",
25
- bearerAuth: withToken({
26
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
27
- }),
24
+ id: "example",
25
+ server: "sandbox",
26
+ merchantAccountId: "default",
27
+ bearerAuth: withToken({
28
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
29
+ }),
28
30
  });
29
31
 
30
32
  async function run() {
@@ -44,17 +46,12 @@ The standalone function version of this method:
44
46
 
45
47
  ```typescript
46
48
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
47
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
48
49
  import { paymentServiceDefinitionsList } from "@gr4vy/sdk/funcs/paymentServiceDefinitionsList.js";
49
50
 
50
51
  // Use `Gr4vyCore` for best tree-shaking performance.
51
52
  // You can create one instance of it to use across an application.
52
53
  const gr4vy = new Gr4vyCore({
53
- server: "sandbox",
54
- id: "example",
55
- bearerAuth: withToken({
56
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
57
- }),
54
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
58
55
  });
59
56
 
60
57
  async function run() {
@@ -112,14 +109,16 @@ Get the definition of a payment service that can be configured.
112
109
 
113
110
  <!-- UsageSnippet language="typescript" operationID="get_payment_service_definition" method="get" path="/payment-service-definitions/{payment_service_definition_id}" -->
114
111
  ```typescript
115
- import { Gr4vy } from "@gr4vy/sdk";
112
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
113
+ import fs from "fs";
116
114
 
117
115
  const gr4vy = new Gr4vy({
118
- server: "sandbox",
119
- id: "example",
120
- bearerAuth: withToken({
121
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
122
- }),
116
+ id: "example",
117
+ server: "sandbox",
118
+ merchantAccountId: "default",
119
+ bearerAuth: withToken({
120
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
121
+ }),
123
122
  });
124
123
 
125
124
  async function run() {
@@ -137,17 +136,12 @@ The standalone function version of this method:
137
136
 
138
137
  ```typescript
139
138
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
140
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
141
139
  import { paymentServiceDefinitionsGet } from "@gr4vy/sdk/funcs/paymentServiceDefinitionsGet.js";
142
140
 
143
141
  // Use `Gr4vyCore` for best tree-shaking performance.
144
142
  // You can create one instance of it to use across an application.
145
143
  const gr4vy = new Gr4vyCore({
146
- server: "sandbox",
147
- id: "example",
148
- bearerAuth: withToken({
149
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
150
- }),
144
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
151
145
  });
152
146
 
153
147
  async function run() {
@@ -202,14 +196,16 @@ Creates a session for a payment service that supports sessions.
202
196
 
203
197
  <!-- UsageSnippet language="typescript" operationID="create_payment_service_definition_session" method="post" path="/payment-service-definitions/{payment_service_definition_id}/sessions" -->
204
198
  ```typescript
205
- import { Gr4vy } from "@gr4vy/sdk";
199
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
200
+ import fs from "fs";
206
201
 
207
202
  const gr4vy = new Gr4vy({
208
- server: "sandbox",
209
- id: "example",
210
- bearerAuth: withToken({
211
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
212
- }),
203
+ id: "example",
204
+ server: "sandbox",
205
+ merchantAccountId: "default",
206
+ bearerAuth: withToken({
207
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
208
+ }),
213
209
  });
214
210
 
215
211
  async function run() {
@@ -229,17 +225,12 @@ The standalone function version of this method:
229
225
 
230
226
  ```typescript
231
227
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
232
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
233
228
  import { paymentServiceDefinitionsSession } from "@gr4vy/sdk/funcs/paymentServiceDefinitionsSession.js";
234
229
 
235
230
  // Use `Gr4vyCore` for best tree-shaking performance.
236
231
  // You can create one instance of it to use across an application.
237
232
  const gr4vy = new Gr4vyCore({
238
- server: "sandbox",
239
- id: "example",
240
- bearerAuth: withToken({
241
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
242
- }),
233
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
243
234
  });
244
235
 
245
236
  async function run() {
@@ -21,15 +21,16 @@ List the configured payment services.
21
21
 
22
22
  <!-- UsageSnippet language="typescript" operationID="list_payment_services" method="get" path="/payment-services" -->
23
23
  ```typescript
24
- import { Gr4vy } from "@gr4vy/sdk";
24
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
25
+ import fs from "fs";
25
26
 
26
27
  const gr4vy = new Gr4vy({
27
- merchantAccountId: "<id>",
28
- server: "sandbox",
29
- id: "example",
30
- bearerAuth: withToken({
31
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
32
- }),
28
+ id: "example",
29
+ server: "sandbox",
30
+ merchantAccountId: "default",
31
+ bearerAuth: withToken({
32
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
33
+ }),
33
34
  });
34
35
 
35
36
  async function run() {
@@ -49,18 +50,13 @@ The standalone function version of this method:
49
50
 
50
51
  ```typescript
51
52
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
52
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
53
53
  import { paymentServicesList } from "@gr4vy/sdk/funcs/paymentServicesList.js";
54
54
 
55
55
  // Use `Gr4vyCore` for best tree-shaking performance.
56
56
  // You can create one instance of it to use across an application.
57
57
  const gr4vy = new Gr4vyCore({
58
58
  merchantAccountId: "<id>",
59
- server: "sandbox",
60
- id: "example",
61
- bearerAuth: withToken({
62
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
63
- }),
59
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
64
60
  });
65
61
 
66
62
  async function run() {
@@ -117,15 +113,16 @@ Updates the configuration of a payment service.
117
113
 
118
114
  <!-- UsageSnippet language="typescript" operationID="update_payment_service" method="post" path="/payment-services" -->
119
115
  ```typescript
120
- import { Gr4vy } from "@gr4vy/sdk";
116
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
117
+ import fs from "fs";
121
118
 
122
119
  const gr4vy = new Gr4vy({
123
- merchantAccountId: "<id>",
124
- server: "sandbox",
125
- id: "example",
126
- bearerAuth: withToken({
127
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
128
- }),
120
+ id: "example",
121
+ server: "sandbox",
122
+ merchantAccountId: "default",
123
+ bearerAuth: withToken({
124
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
125
+ }),
129
126
  });
130
127
 
131
128
  async function run() {
@@ -168,18 +165,13 @@ The standalone function version of this method:
168
165
 
169
166
  ```typescript
170
167
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
171
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
172
168
  import { paymentServicesCreate } from "@gr4vy/sdk/funcs/paymentServicesCreate.js";
173
169
 
174
170
  // Use `Gr4vyCore` for best tree-shaking performance.
175
171
  // You can create one instance of it to use across an application.
176
172
  const gr4vy = new Gr4vyCore({
177
173
  merchantAccountId: "<id>",
178
- server: "sandbox",
179
- id: "example",
180
- bearerAuth: withToken({
181
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
182
- }),
174
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
183
175
  });
184
176
 
185
177
  async function run() {
@@ -260,15 +252,16 @@ Get the details of a configured payment service.
260
252
 
261
253
  <!-- UsageSnippet language="typescript" operationID="get_payment_service" method="get" path="/payment-services/{payment_service_id}" -->
262
254
  ```typescript
263
- import { Gr4vy } from "@gr4vy/sdk";
255
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
256
+ import fs from "fs";
264
257
 
265
258
  const gr4vy = new Gr4vy({
266
- merchantAccountId: "<id>",
267
- server: "sandbox",
268
- id: "example",
269
- bearerAuth: withToken({
270
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
271
- }),
259
+ id: "example",
260
+ server: "sandbox",
261
+ merchantAccountId: "default",
262
+ bearerAuth: withToken({
263
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
264
+ }),
272
265
  });
273
266
 
274
267
  async function run() {
@@ -286,18 +279,13 @@ The standalone function version of this method:
286
279
 
287
280
  ```typescript
288
281
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
289
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
290
282
  import { paymentServicesGet } from "@gr4vy/sdk/funcs/paymentServicesGet.js";
291
283
 
292
284
  // Use `Gr4vyCore` for best tree-shaking performance.
293
285
  // You can create one instance of it to use across an application.
294
286
  const gr4vy = new Gr4vyCore({
295
287
  merchantAccountId: "<id>",
296
- server: "sandbox",
297
- id: "example",
298
- bearerAuth: withToken({
299
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
300
- }),
288
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
301
289
  });
302
290
 
303
291
  async function run() {
@@ -353,15 +341,16 @@ Configures a new payment service for use by merchants.
353
341
 
354
342
  <!-- UsageSnippet language="typescript" operationID="create_payment_service" method="put" path="/payment-services/{payment_service_id}" -->
355
343
  ```typescript
356
- import { Gr4vy } from "@gr4vy/sdk";
344
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
345
+ import fs from "fs";
357
346
 
358
347
  const gr4vy = new Gr4vy({
359
- merchantAccountId: "<id>",
360
- server: "sandbox",
361
- id: "example",
362
- bearerAuth: withToken({
363
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
364
- }),
348
+ id: "example",
349
+ server: "sandbox",
350
+ merchantAccountId: "default",
351
+ bearerAuth: withToken({
352
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
353
+ }),
365
354
  });
366
355
 
367
356
  async function run() {
@@ -381,18 +370,13 @@ The standalone function version of this method:
381
370
 
382
371
  ```typescript
383
372
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
384
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
385
373
  import { paymentServicesUpdate } from "@gr4vy/sdk/funcs/paymentServicesUpdate.js";
386
374
 
387
375
  // Use `Gr4vyCore` for best tree-shaking performance.
388
376
  // You can create one instance of it to use across an application.
389
377
  const gr4vy = new Gr4vyCore({
390
378
  merchantAccountId: "<id>",
391
- server: "sandbox",
392
- id: "example",
393
- bearerAuth: withToken({
394
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
395
- }),
379
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
396
380
  });
397
381
 
398
382
  async function run() {
@@ -451,15 +435,16 @@ Deletes all the configuration of a payment service.
451
435
 
452
436
  <!-- UsageSnippet language="typescript" operationID="delete_payment_service" method="delete" path="/payment-services/{payment_service_id}" -->
453
437
  ```typescript
454
- import { Gr4vy } from "@gr4vy/sdk";
438
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
439
+ import fs from "fs";
455
440
 
456
441
  const gr4vy = new Gr4vy({
457
- merchantAccountId: "<id>",
458
- server: "sandbox",
459
- id: "example",
460
- bearerAuth: withToken({
461
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
462
- }),
442
+ id: "example",
443
+ server: "sandbox",
444
+ merchantAccountId: "default",
445
+ bearerAuth: withToken({
446
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
447
+ }),
463
448
  });
464
449
 
465
450
  async function run() {
@@ -477,18 +462,13 @@ The standalone function version of this method:
477
462
 
478
463
  ```typescript
479
464
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
480
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
481
465
  import { paymentServicesDelete } from "@gr4vy/sdk/funcs/paymentServicesDelete.js";
482
466
 
483
467
  // Use `Gr4vyCore` for best tree-shaking performance.
484
468
  // You can create one instance of it to use across an application.
485
469
  const gr4vy = new Gr4vyCore({
486
470
  merchantAccountId: "<id>",
487
- server: "sandbox",
488
- id: "example",
489
- bearerAuth: withToken({
490
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
491
- }),
471
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
492
472
  });
493
473
 
494
474
  async function run() {
@@ -544,15 +524,16 @@ Verify the credentials of a configured payment service
544
524
 
545
525
  <!-- UsageSnippet language="typescript" operationID="verify_payment_service_credentials" method="post" path="/payment-services/verify" -->
546
526
  ```typescript
547
- import { Gr4vy } from "@gr4vy/sdk";
527
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
528
+ import fs from "fs";
548
529
 
549
530
  const gr4vy = new Gr4vy({
550
- merchantAccountId: "<id>",
551
- server: "sandbox",
552
- id: "example",
553
- bearerAuth: withToken({
554
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
555
- }),
531
+ id: "example",
532
+ server: "sandbox",
533
+ merchantAccountId: "default",
534
+ bearerAuth: withToken({
535
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
536
+ }),
556
537
  });
557
538
 
558
539
  async function run() {
@@ -573,18 +554,13 @@ The standalone function version of this method:
573
554
 
574
555
  ```typescript
575
556
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
576
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
577
557
  import { paymentServicesVerify } from "@gr4vy/sdk/funcs/paymentServicesVerify.js";
578
558
 
579
559
  // Use `Gr4vyCore` for best tree-shaking performance.
580
560
  // You can create one instance of it to use across an application.
581
561
  const gr4vy = new Gr4vyCore({
582
562
  merchantAccountId: "<id>",
583
- server: "sandbox",
584
- id: "example",
585
- bearerAuth: withToken({
586
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
587
- }),
563
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
588
564
  });
589
565
 
590
566
  async function run() {
@@ -643,15 +619,16 @@ Creates a session for a payment service that supports sessions.
643
619
 
644
620
  <!-- UsageSnippet language="typescript" operationID="create_payment_service_session" method="post" path="/payment-services/{payment_service_id}/sessions" -->
645
621
  ```typescript
646
- import { Gr4vy } from "@gr4vy/sdk";
622
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
623
+ import fs from "fs";
647
624
 
648
625
  const gr4vy = new Gr4vy({
649
- merchantAccountId: "<id>",
650
- server: "sandbox",
651
- id: "example",
652
- bearerAuth: withToken({
653
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
654
- }),
626
+ id: "example",
627
+ server: "sandbox",
628
+ merchantAccountId: "default",
629
+ bearerAuth: withToken({
630
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
631
+ }),
655
632
  });
656
633
 
657
634
  async function run() {
@@ -671,18 +648,13 @@ The standalone function version of this method:
671
648
 
672
649
  ```typescript
673
650
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
674
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
675
651
  import { paymentServicesSession } from "@gr4vy/sdk/funcs/paymentServicesSession.js";
676
652
 
677
653
  // Use `Gr4vyCore` for best tree-shaking performance.
678
654
  // You can create one instance of it to use across an application.
679
655
  const gr4vy = new Gr4vyCore({
680
656
  merchantAccountId: "<id>",
681
- server: "sandbox",
682
- id: "example",
683
- bearerAuth: withToken({
684
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
685
- }),
657
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
686
658
  });
687
659
 
688
660
  async function run() {
@@ -17,15 +17,16 @@ List all gateway tokens stored for a payment method.
17
17
 
18
18
  <!-- UsageSnippet language="typescript" operationID="list_payment_method_payment_service_tokens" method="get" path="/payment-methods/{payment_method_id}/payment-service-tokens" -->
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() {
@@ -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 { paymentMethodsPaymentServiceTokensList } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensList.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() {
@@ -111,15 +107,16 @@ Create a gateway tokens for a payment method.
111
107
 
112
108
  <!-- UsageSnippet language="typescript" operationID="create_payment_method_payment_service_token" method="post" path="/payment-methods/{payment_method_id}/payment-service-tokens" -->
113
109
  ```typescript
114
- import { Gr4vy } from "@gr4vy/sdk";
110
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
111
+ import fs from "fs";
115
112
 
116
113
  const gr4vy = new Gr4vy({
117
- merchantAccountId: "<id>",
118
- server: "sandbox",
119
- id: "example",
120
- bearerAuth: withToken({
121
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
122
- }),
114
+ id: "example",
115
+ server: "sandbox",
116
+ merchantAccountId: "default",
117
+ bearerAuth: withToken({
118
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
119
+ }),
123
120
  });
124
121
 
125
122
  async function run() {
@@ -140,18 +137,13 @@ The standalone function version of this method:
140
137
 
141
138
  ```typescript
142
139
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
143
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
144
140
  import { paymentMethodsPaymentServiceTokensCreate } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensCreate.js";
145
141
 
146
142
  // Use `Gr4vyCore` for best tree-shaking performance.
147
143
  // You can create one instance of it to use across an application.
148
144
  const gr4vy = new Gr4vyCore({
149
145
  merchantAccountId: "<id>",
150
- server: "sandbox",
151
- id: "example",
152
- bearerAuth: withToken({
153
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
154
- }),
146
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
155
147
  });
156
148
 
157
149
  async function run() {
@@ -211,15 +203,16 @@ Delete a gateway tokens for a payment method.
211
203
 
212
204
  <!-- UsageSnippet language="typescript" operationID="delete_payment_method_payment_service_token" method="delete" path="/payment-methods/{payment_method_id}/payment-service-tokens/{payment_service_token_id}" -->
213
205
  ```typescript
214
- import { Gr4vy } from "@gr4vy/sdk";
206
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
207
+ import fs from "fs";
215
208
 
216
209
  const gr4vy = new Gr4vy({
217
- merchantAccountId: "<id>",
218
- server: "sandbox",
219
- id: "example",
220
- bearerAuth: withToken({
221
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
222
- }),
210
+ id: "example",
211
+ server: "sandbox",
212
+ merchantAccountId: "default",
213
+ bearerAuth: withToken({
214
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
215
+ }),
223
216
  });
224
217
 
225
218
  async function run() {
@@ -237,18 +230,13 @@ The standalone function version of this method:
237
230
 
238
231
  ```typescript
239
232
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
240
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
241
233
  import { paymentMethodsPaymentServiceTokensDelete } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensDelete.js";
242
234
 
243
235
  // Use `Gr4vyCore` for best tree-shaking performance.
244
236
  // You can create one instance of it to use across an application.
245
237
  const gr4vy = new Gr4vyCore({
246
238
  merchantAccountId: "<id>",
247
- server: "sandbox",
248
- id: "example",
249
- bearerAuth: withToken({
250
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
251
- }),
239
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
252
240
  });
253
241
 
254
242
  async function run() {