@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
@@ -19,15 +19,16 @@ List all network tokens stored for a payment method.
19
19
 
20
20
  <!-- UsageSnippet language="typescript" operationID="list_payment_method_network_tokens" method="get" path="/payment-methods/{payment_method_id}/network-tokens" -->
21
21
  ```typescript
22
- import { Gr4vy } from "@gr4vy/sdk";
22
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
23
+ import fs from "fs";
23
24
 
24
25
  const gr4vy = new Gr4vy({
25
- merchantAccountId: "<id>",
26
- server: "sandbox",
27
- id: "example",
28
- bearerAuth: withToken({
29
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
30
- }),
26
+ id: "example",
27
+ server: "sandbox",
28
+ merchantAccountId: "default",
29
+ bearerAuth: withToken({
30
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
31
+ }),
31
32
  });
32
33
 
33
34
  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 { paymentMethodsNetworkTokensList } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensList.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() {
@@ -112,15 +108,16 @@ Provision a network token for a payment method.
112
108
 
113
109
  <!-- UsageSnippet language="typescript" operationID="create_payment_method_network_token" method="post" path="/payment-methods/{payment_method_id}/network-tokens" -->
114
110
  ```typescript
115
- import { Gr4vy } from "@gr4vy/sdk";
111
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
112
+ import fs from "fs";
116
113
 
117
114
  const gr4vy = new Gr4vy({
118
- merchantAccountId: "<id>",
119
- server: "sandbox",
120
- id: "example",
121
- bearerAuth: withToken({
122
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
123
- }),
115
+ id: "example",
116
+ server: "sandbox",
117
+ merchantAccountId: "default",
118
+ bearerAuth: withToken({
119
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
120
+ }),
124
121
  });
125
122
 
126
123
  async function run() {
@@ -141,18 +138,13 @@ The standalone function version of this method:
141
138
 
142
139
  ```typescript
143
140
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
144
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
145
141
  import { paymentMethodsNetworkTokensCreate } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensCreate.js";
146
142
 
147
143
  // Use `Gr4vyCore` for best tree-shaking performance.
148
144
  // You can create one instance of it to use across an application.
149
145
  const gr4vy = new Gr4vyCore({
150
146
  merchantAccountId: "<id>",
151
- server: "sandbox",
152
- id: "example",
153
- bearerAuth: withToken({
154
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
155
- }),
147
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
156
148
  });
157
149
 
158
150
  async function run() {
@@ -212,15 +204,16 @@ Suspend a network token for a payment method.
212
204
 
213
205
  <!-- UsageSnippet language="typescript" operationID="suspend_payment_method_network_token" method="post" path="/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend" -->
214
206
  ```typescript
215
- import { Gr4vy } from "@gr4vy/sdk";
207
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
208
+ import fs from "fs";
216
209
 
217
210
  const gr4vy = new Gr4vy({
218
- merchantAccountId: "<id>",
219
- server: "sandbox",
220
- id: "example",
221
- bearerAuth: withToken({
222
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
223
- }),
211
+ id: "example",
212
+ server: "sandbox",
213
+ merchantAccountId: "default",
214
+ bearerAuth: withToken({
215
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
216
+ }),
224
217
  });
225
218
 
226
219
  async function run() {
@@ -238,18 +231,13 @@ The standalone function version of this method:
238
231
 
239
232
  ```typescript
240
233
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
241
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
242
234
  import { paymentMethodsNetworkTokensSuspend } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensSuspend.js";
243
235
 
244
236
  // Use `Gr4vyCore` for best tree-shaking performance.
245
237
  // You can create one instance of it to use across an application.
246
238
  const gr4vy = new Gr4vyCore({
247
239
  merchantAccountId: "<id>",
248
- server: "sandbox",
249
- id: "example",
250
- bearerAuth: withToken({
251
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
252
- }),
240
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
253
241
  });
254
242
 
255
243
  async function run() {
@@ -306,15 +294,16 @@ Resume a suspended network token for a payment method.
306
294
 
307
295
  <!-- UsageSnippet language="typescript" operationID="resume_payment_method_network_token" method="post" path="/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/resume" -->
308
296
  ```typescript
309
- import { Gr4vy } from "@gr4vy/sdk";
297
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
298
+ import fs from "fs";
310
299
 
311
300
  const gr4vy = new Gr4vy({
312
- merchantAccountId: "<id>",
313
- server: "sandbox",
314
- id: "example",
315
- bearerAuth: withToken({
316
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
317
- }),
301
+ id: "example",
302
+ server: "sandbox",
303
+ merchantAccountId: "default",
304
+ bearerAuth: withToken({
305
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
306
+ }),
318
307
  });
319
308
 
320
309
  async function run() {
@@ -332,18 +321,13 @@ The standalone function version of this method:
332
321
 
333
322
  ```typescript
334
323
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
335
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
336
324
  import { paymentMethodsNetworkTokensResume } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensResume.js";
337
325
 
338
326
  // Use `Gr4vyCore` for best tree-shaking performance.
339
327
  // You can create one instance of it to use across an application.
340
328
  const gr4vy = new Gr4vyCore({
341
329
  merchantAccountId: "<id>",
342
- server: "sandbox",
343
- id: "example",
344
- bearerAuth: withToken({
345
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
346
- }),
330
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
347
331
  });
348
332
 
349
333
  async function run() {
@@ -400,15 +384,16 @@ Delete a network token for a payment method.
400
384
 
401
385
  <!-- UsageSnippet language="typescript" operationID="delete_payment_method_network_token" method="delete" path="/payment-methods/{payment_method_id}/network-tokens/{network_token_id}" -->
402
386
  ```typescript
403
- import { Gr4vy } from "@gr4vy/sdk";
387
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
388
+ import fs from "fs";
404
389
 
405
390
  const gr4vy = new Gr4vy({
406
- merchantAccountId: "<id>",
407
- server: "sandbox",
408
- id: "example",
409
- bearerAuth: withToken({
410
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
411
- }),
391
+ id: "example",
392
+ server: "sandbox",
393
+ merchantAccountId: "default",
394
+ bearerAuth: withToken({
395
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
396
+ }),
412
397
  });
413
398
 
414
399
  async function run() {
@@ -426,18 +411,13 @@ The standalone function version of this method:
426
411
 
427
412
  ```typescript
428
413
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
429
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
430
414
  import { paymentMethodsNetworkTokensDelete } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensDelete.js";
431
415
 
432
416
  // Use `Gr4vyCore` for best tree-shaking performance.
433
417
  // You can create one instance of it to use across an application.
434
418
  const gr4vy = new Gr4vyCore({
435
419
  merchantAccountId: "<id>",
436
- server: "sandbox",
437
- id: "example",
438
- bearerAuth: withToken({
439
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
440
- }),
420
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
441
421
  });
442
422
 
443
423
  async function run() {
@@ -18,15 +18,16 @@ Create a new payment link.
18
18
 
19
19
  <!-- UsageSnippet language="typescript" operationID="add_payment_link" method="post" path="/payment-links" -->
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() {
@@ -48,18 +49,13 @@ The standalone function version of this method:
48
49
 
49
50
  ```typescript
50
51
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
51
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
52
52
  import { paymentLinksCreate } from "@gr4vy/sdk/funcs/paymentLinksCreate.js";
53
53
 
54
54
  // Use `Gr4vyCore` for best tree-shaking performance.
55
55
  // You can create one instance of it to use across an application.
56
56
  const gr4vy = new Gr4vyCore({
57
57
  merchantAccountId: "<id>",
58
- server: "sandbox",
59
- id: "example",
60
- bearerAuth: withToken({
61
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
62
- }),
58
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
63
59
  });
64
60
 
65
61
  async function run() {
@@ -119,15 +115,16 @@ List all created payment links.
119
115
 
120
116
  <!-- UsageSnippet language="typescript" operationID="list_payment_links" method="get" path="/payment-links" -->
121
117
  ```typescript
122
- import { Gr4vy } from "@gr4vy/sdk";
118
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
119
+ import fs from "fs";
123
120
 
124
121
  const gr4vy = new Gr4vy({
125
- merchantAccountId: "<id>",
126
- server: "sandbox",
127
- id: "example",
128
- bearerAuth: withToken({
129
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
130
- }),
122
+ id: "example",
123
+ server: "sandbox",
124
+ merchantAccountId: "default",
125
+ bearerAuth: withToken({
126
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
127
+ }),
131
128
  });
132
129
 
133
130
  async function run() {
@@ -147,18 +144,13 @@ The standalone function version of this method:
147
144
 
148
145
  ```typescript
149
146
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
150
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
151
147
  import { paymentLinksList } from "@gr4vy/sdk/funcs/paymentLinksList.js";
152
148
 
153
149
  // Use `Gr4vyCore` for best tree-shaking performance.
154
150
  // You can create one instance of it to use across an application.
155
151
  const gr4vy = new Gr4vyCore({
156
152
  merchantAccountId: "<id>",
157
- server: "sandbox",
158
- id: "example",
159
- bearerAuth: withToken({
160
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
161
- }),
153
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
162
154
  });
163
155
 
164
156
  async function run() {
@@ -218,15 +210,16 @@ Expire an existing payment link.
218
210
 
219
211
  <!-- UsageSnippet language="typescript" operationID="expire_payment_link" method="post" path="/payment-links/{payment_link_id}/expire" -->
220
212
  ```typescript
221
- import { Gr4vy } from "@gr4vy/sdk";
213
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
214
+ import fs from "fs";
222
215
 
223
216
  const gr4vy = new Gr4vy({
224
- merchantAccountId: "<id>",
225
- server: "sandbox",
226
- id: "example",
227
- bearerAuth: withToken({
228
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
229
- }),
217
+ id: "example",
218
+ server: "sandbox",
219
+ merchantAccountId: "default",
220
+ bearerAuth: withToken({
221
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
222
+ }),
230
223
  });
231
224
 
232
225
  async function run() {
@@ -244,18 +237,13 @@ The standalone function version of this method:
244
237
 
245
238
  ```typescript
246
239
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
247
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
248
240
  import { paymentLinksExpire } from "@gr4vy/sdk/funcs/paymentLinksExpire.js";
249
241
 
250
242
  // Use `Gr4vyCore` for best tree-shaking performance.
251
243
  // You can create one instance of it to use across an application.
252
244
  const gr4vy = new Gr4vyCore({
253
245
  merchantAccountId: "<id>",
254
- server: "sandbox",
255
- id: "example",
256
- bearerAuth: withToken({
257
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
258
- }),
246
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
259
247
  });
260
248
 
261
249
  async function run() {
@@ -311,15 +299,16 @@ Fetch the details for a payment link.
311
299
 
312
300
  <!-- UsageSnippet language="typescript" operationID="get_payment_link" method="get" path="/payment-links/{payment_link_id}" -->
313
301
  ```typescript
314
- import { Gr4vy } from "@gr4vy/sdk";
302
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
303
+ import fs from "fs";
315
304
 
316
305
  const gr4vy = new Gr4vy({
317
- merchantAccountId: "<id>",
318
- server: "sandbox",
319
- id: "example",
320
- bearerAuth: withToken({
321
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
322
- }),
306
+ id: "example",
307
+ server: "sandbox",
308
+ merchantAccountId: "default",
309
+ bearerAuth: withToken({
310
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
311
+ }),
323
312
  });
324
313
 
325
314
  async function run() {
@@ -337,18 +326,13 @@ The standalone function version of this method:
337
326
 
338
327
  ```typescript
339
328
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
340
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
341
329
  import { paymentLinksGet } from "@gr4vy/sdk/funcs/paymentLinksGet.js";
342
330
 
343
331
  // Use `Gr4vyCore` for best tree-shaking performance.
344
332
  // You can create one instance of it to use across an application.
345
333
  const gr4vy = new Gr4vyCore({
346
334
  merchantAccountId: "<id>",
347
- server: "sandbox",
348
- id: "example",
349
- bearerAuth: withToken({
350
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
351
- }),
335
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
352
336
  });
353
337
 
354
338
  async function run() {
@@ -18,15 +18,16 @@ List all stored payment method.
18
18
 
19
19
  <!-- UsageSnippet language="typescript" operationID="list_payment_methods" method="get" path="/payment-methods" -->
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 { paymentMethodsList } from "@gr4vy/sdk/funcs/paymentMethodsList.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 @@ Store a new payment method.
114
110
 
115
111
  <!-- UsageSnippet language="typescript" operationID="create_payment_method" method="post" path="/payment-methods" -->
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 { paymentMethodsCreate } from "@gr4vy/sdk/funcs/paymentMethodsCreate.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,15 +205,16 @@ Retrieve a payment method.
213
205
 
214
206
  <!-- UsageSnippet language="typescript" operationID="get_payment_method" method="get" path="/payment-methods/{payment_method_id}" -->
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
- merchantAccountId: "<id>",
220
- server: "sandbox",
221
- id: "example",
222
- bearerAuth: withToken({
223
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
224
- }),
212
+ id: "example",
213
+ server: "sandbox",
214
+ merchantAccountId: "default",
215
+ bearerAuth: withToken({
216
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
217
+ }),
225
218
  });
226
219
 
227
220
  async function run() {
@@ -239,18 +232,13 @@ The standalone function version of this method:
239
232
 
240
233
  ```typescript
241
234
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
242
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
243
235
  import { paymentMethodsGet } from "@gr4vy/sdk/funcs/paymentMethodsGet.js";
244
236
 
245
237
  // Use `Gr4vyCore` for best tree-shaking performance.
246
238
  // You can create one instance of it to use across an application.
247
239
  const gr4vy = new Gr4vyCore({
248
240
  merchantAccountId: "<id>",
249
- server: "sandbox",
250
- id: "example",
251
- bearerAuth: withToken({
252
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
253
- }),
241
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
254
242
  });
255
243
 
256
244
  async function run() {
@@ -306,15 +294,16 @@ Delete a payment method.
306
294
 
307
295
  <!-- UsageSnippet language="typescript" operationID="delete_payment_method" method="delete" path="/payment-methods/{payment_method_id}" -->
308
296
  ```typescript
309
- import { Gr4vy } from "@gr4vy/sdk";
297
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
298
+ import fs from "fs";
310
299
 
311
300
  const gr4vy = new Gr4vy({
312
- merchantAccountId: "<id>",
313
- server: "sandbox",
314
- id: "example",
315
- bearerAuth: withToken({
316
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
317
- }),
301
+ id: "example",
302
+ server: "sandbox",
303
+ merchantAccountId: "default",
304
+ bearerAuth: withToken({
305
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
306
+ }),
318
307
  });
319
308
 
320
309
  async function run() {
@@ -332,18 +321,13 @@ The standalone function version of this method:
332
321
 
333
322
  ```typescript
334
323
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
335
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
336
324
  import { paymentMethodsDelete } from "@gr4vy/sdk/funcs/paymentMethodsDelete.js";
337
325
 
338
326
  // Use `Gr4vyCore` for best tree-shaking performance.
339
327
  // You can create one instance of it to use across an application.
340
328
  const gr4vy = new Gr4vyCore({
341
329
  merchantAccountId: "<id>",
342
- server: "sandbox",
343
- id: "example",
344
- bearerAuth: withToken({
345
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
346
- }),
330
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
347
331
  });
348
332
 
349
333
  async function run() {
@@ -15,15 +15,16 @@ List the payment options available at checkout. filtering by country, currency,
15
15
 
16
16
  <!-- UsageSnippet language="typescript" operationID="list_payment_options" method="post" path="/payment-options" -->
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 { paymentOptionsList } from "@gr4vy/sdk/funcs/paymentOptionsList.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() {