@gr4vy/sdk 1.1.40 → 1.1.42

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 (86) hide show
  1. package/FUNCTIONS.md +1 -6
  2. package/README.md +32 -37
  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/gr4vygiftcards/README.md +9 -13
  16. package/docs/sdks/gr4vypaymentmethods/README.md +9 -13
  17. package/docs/sdks/gr4vyrefunds/README.md +27 -39
  18. package/docs/sdks/jobs/README.md +9 -13
  19. package/docs/sdks/merchantaccounts/README.md +36 -48
  20. package/docs/sdks/networktokens/README.md +45 -65
  21. package/docs/sdks/paymentlinks/README.md +36 -52
  22. package/docs/sdks/paymentmethods/README.md +36 -52
  23. package/docs/sdks/paymentoptions/README.md +9 -13
  24. package/docs/sdks/paymentservicedefinitions/README.md +27 -36
  25. package/docs/sdks/paymentservices/README.md +63 -91
  26. package/docs/sdks/paymentservicetokens/README.md +27 -39
  27. package/docs/sdks/payouts/README.md +27 -39
  28. package/docs/sdks/refunds/README.md +9 -13
  29. package/docs/sdks/reportexecutions/README.md +9 -13
  30. package/docs/sdks/reports/README.md +36 -52
  31. package/docs/sdks/sessions/README.md +27 -38
  32. package/docs/sdks/settlements/README.md +18 -26
  33. package/docs/sdks/shippingdetails/README.md +45 -65
  34. package/docs/sdks/transactions/README.md +72 -104
  35. package/examples/accountUpdaterJobsCreate.example.ts +8 -3
  36. package/examples/package-lock.json +620 -0
  37. package/funcs/auditLogsList.js +3 -0
  38. package/funcs/auditLogsList.js.map +1 -1
  39. package/funcs/buyersList.js +3 -0
  40. package/funcs/buyersList.js.map +1 -1
  41. package/funcs/giftCardsList.js +3 -0
  42. package/funcs/giftCardsList.js.map +1 -1
  43. package/funcs/merchantAccountsList.js +3 -0
  44. package/funcs/merchantAccountsList.js.map +1 -1
  45. package/funcs/paymentLinksList.js +3 -0
  46. package/funcs/paymentLinksList.js.map +1 -1
  47. package/funcs/paymentMethodsList.js +3 -0
  48. package/funcs/paymentMethodsList.js.map +1 -1
  49. package/funcs/paymentServiceDefinitionsList.js +3 -0
  50. package/funcs/paymentServiceDefinitionsList.js.map +1 -1
  51. package/funcs/paymentServicesList.js +3 -0
  52. package/funcs/paymentServicesList.js.map +1 -1
  53. package/funcs/payoutsList.js +3 -0
  54. package/funcs/payoutsList.js.map +1 -1
  55. package/funcs/reportExecutionsList.js +3 -0
  56. package/funcs/reportExecutionsList.js.map +1 -1
  57. package/funcs/reportsExecutionsList.js +3 -0
  58. package/funcs/reportsExecutionsList.js.map +1 -1
  59. package/funcs/reportsList.js +3 -0
  60. package/funcs/reportsList.js.map +1 -1
  61. package/funcs/transactionsList.js +3 -0
  62. package/funcs/transactionsList.js.map +1 -1
  63. package/jsr.json +1 -1
  64. package/lib/config.d.ts +3 -3
  65. package/lib/config.js +3 -3
  66. package/models/components/auditlogaction.d.ts +1 -0
  67. package/models/components/auditlogaction.d.ts.map +1 -1
  68. package/models/components/auditlogaction.js +1 -0
  69. package/models/components/auditlogaction.js.map +1 -1
  70. package/package.json +1 -1
  71. package/src/funcs/auditLogsList.ts +3 -0
  72. package/src/funcs/buyersList.ts +3 -0
  73. package/src/funcs/giftCardsList.ts +3 -0
  74. package/src/funcs/merchantAccountsList.ts +3 -0
  75. package/src/funcs/paymentLinksList.ts +3 -0
  76. package/src/funcs/paymentMethodsList.ts +3 -0
  77. package/src/funcs/paymentServiceDefinitionsList.ts +3 -0
  78. package/src/funcs/paymentServicesList.ts +3 -0
  79. package/src/funcs/payoutsList.ts +3 -0
  80. package/src/funcs/reportExecutionsList.ts +3 -0
  81. package/src/funcs/reportsExecutionsList.ts +3 -0
  82. package/src/funcs/reportsList.ts +3 -0
  83. package/src/funcs/transactionsList.ts +3 -0
  84. package/src/lib/config.ts +3 -3
  85. package/src/models/components/auditlogaction.ts +1 -0
  86. package/tests/utils/setup.ts +37 -0
@@ -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() {
@@ -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() {