@gr4vy/sdk 1.1.40 → 1.1.41

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 (41) 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/jsr.json +1 -1
  38. package/lib/config.d.ts +2 -2
  39. package/lib/config.js +2 -2
  40. package/package.json +1 -1
  41. package/src/lib/config.ts +2 -2
@@ -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() {
@@ -19,15 +19,16 @@ Associate shipping details to a buyer.
19
19
 
20
20
  <!-- UsageSnippet language="typescript" operationID="add_buyer_shipping_details" method="post" path="/buyers/{buyer_id}/shipping-details" -->
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 { buyersShippingDetailsCreate } from "@gr4vy/sdk/funcs/buyersShippingDetailsCreate.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() {
@@ -113,15 +109,16 @@ List all the shipping details associated to a specific buyer.
113
109
 
114
110
  <!-- UsageSnippet language="typescript" operationID="list_buyer_shipping_details" method="get" path="/buyers/{buyer_id}/shipping-details" -->
115
111
  ```typescript
116
- import { Gr4vy } from "@gr4vy/sdk";
112
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
113
+ import fs from "fs";
117
114
 
118
115
  const gr4vy = new Gr4vy({
119
- merchantAccountId: "<id>",
120
- server: "sandbox",
121
- id: "example",
122
- bearerAuth: withToken({
123
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
124
- }),
116
+ id: "example",
117
+ server: "sandbox",
118
+ merchantAccountId: "default",
119
+ bearerAuth: withToken({
120
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
121
+ }),
125
122
  });
126
123
 
127
124
  async function run() {
@@ -139,18 +136,13 @@ The standalone function version of this method:
139
136
 
140
137
  ```typescript
141
138
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
142
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
143
139
  import { buyersShippingDetailsList } from "@gr4vy/sdk/funcs/buyersShippingDetailsList.js";
144
140
 
145
141
  // Use `Gr4vyCore` for best tree-shaking performance.
146
142
  // You can create one instance of it to use across an application.
147
143
  const gr4vy = new Gr4vyCore({
148
144
  merchantAccountId: "<id>",
149
- server: "sandbox",
150
- id: "example",
151
- bearerAuth: withToken({
152
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
153
- }),
145
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
154
146
  });
155
147
 
156
148
  async function run() {
@@ -206,15 +198,16 @@ Get a buyer's shipping details.
206
198
 
207
199
  <!-- UsageSnippet language="typescript" operationID="get_buyer_shipping_details" method="get" path="/buyers/{buyer_id}/shipping-details/{shipping_details_id}" -->
208
200
  ```typescript
209
- import { Gr4vy } from "@gr4vy/sdk";
201
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
202
+ import fs from "fs";
210
203
 
211
204
  const gr4vy = new Gr4vy({
212
- merchantAccountId: "<id>",
213
- server: "sandbox",
214
- id: "example",
215
- bearerAuth: withToken({
216
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
217
- }),
205
+ id: "example",
206
+ server: "sandbox",
207
+ merchantAccountId: "default",
208
+ bearerAuth: withToken({
209
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
210
+ }),
218
211
  });
219
212
 
220
213
  async function run() {
@@ -232,18 +225,13 @@ The standalone function version of this method:
232
225
 
233
226
  ```typescript
234
227
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
235
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
236
228
  import { buyersShippingDetailsGet } from "@gr4vy/sdk/funcs/buyersShippingDetailsGet.js";
237
229
 
238
230
  // Use `Gr4vyCore` for best tree-shaking performance.
239
231
  // You can create one instance of it to use across an application.
240
232
  const gr4vy = new Gr4vyCore({
241
233
  merchantAccountId: "<id>",
242
- server: "sandbox",
243
- id: "example",
244
- bearerAuth: withToken({
245
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
246
- }),
234
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
247
235
  });
248
236
 
249
237
  async function run() {
@@ -300,15 +288,16 @@ Update the shipping details associated to a specific buyer.
300
288
 
301
289
  <!-- UsageSnippet language="typescript" operationID="update_buyer_shipping_details" method="put" path="/buyers/{buyer_id}/shipping-details/{shipping_details_id}" -->
302
290
  ```typescript
303
- import { Gr4vy } from "@gr4vy/sdk";
291
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
292
+ import fs from "fs";
304
293
 
305
294
  const gr4vy = new Gr4vy({
306
- merchantAccountId: "<id>",
307
- server: "sandbox",
308
- id: "example",
309
- bearerAuth: withToken({
310
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
311
- }),
295
+ id: "example",
296
+ server: "sandbox",
297
+ merchantAccountId: "default",
298
+ bearerAuth: withToken({
299
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
300
+ }),
312
301
  });
313
302
 
314
303
  async function run() {
@@ -326,18 +315,13 @@ The standalone function version of this method:
326
315
 
327
316
  ```typescript
328
317
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
329
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
330
318
  import { buyersShippingDetailsUpdate } from "@gr4vy/sdk/funcs/buyersShippingDetailsUpdate.js";
331
319
 
332
320
  // Use `Gr4vyCore` for best tree-shaking performance.
333
321
  // You can create one instance of it to use across an application.
334
322
  const gr4vy = new Gr4vyCore({
335
323
  merchantAccountId: "<id>",
336
- server: "sandbox",
337
- id: "example",
338
- bearerAuth: withToken({
339
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
340
- }),
324
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
341
325
  });
342
326
 
343
327
  async function run() {
@@ -395,15 +379,16 @@ Delete the shipping details associated to a specific buyer.
395
379
 
396
380
  <!-- UsageSnippet language="typescript" operationID="delete_buyer_shipping_details" method="delete" path="/buyers/{buyer_id}/shipping-details/{shipping_details_id}" -->
397
381
  ```typescript
398
- import { Gr4vy } from "@gr4vy/sdk";
382
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
383
+ import fs from "fs";
399
384
 
400
385
  const gr4vy = new Gr4vy({
401
- merchantAccountId: "<id>",
402
- server: "sandbox",
403
- id: "example",
404
- bearerAuth: withToken({
405
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
406
- }),
386
+ id: "example",
387
+ server: "sandbox",
388
+ merchantAccountId: "default",
389
+ bearerAuth: withToken({
390
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
391
+ }),
407
392
  });
408
393
 
409
394
  async function run() {
@@ -421,18 +406,13 @@ The standalone function version of this method:
421
406
 
422
407
  ```typescript
423
408
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
424
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
425
409
  import { buyersShippingDetailsDelete } from "@gr4vy/sdk/funcs/buyersShippingDetailsDelete.js";
426
410
 
427
411
  // Use `Gr4vyCore` for best tree-shaking performance.
428
412
  // You can create one instance of it to use across an application.
429
413
  const gr4vy = new Gr4vyCore({
430
414
  merchantAccountId: "<id>",
431
- server: "sandbox",
432
- id: "example",
433
- bearerAuth: withToken({
434
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
435
- }),
415
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
436
416
  });
437
417
 
438
418
  async function run() {
@@ -22,15 +22,16 @@ Returns a paginated list of transactions for the merchant account, sorted by mos
22
22
 
23
23
  <!-- UsageSnippet language="typescript" operationID="list_transactions" method="get" path="/transactions" -->
24
24
  ```typescript
25
- import { Gr4vy } from "@gr4vy/sdk";
25
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
26
+ import fs from "fs";
26
27
 
27
28
  const gr4vy = new Gr4vy({
28
- merchantAccountId: "<id>",
29
- server: "sandbox",
30
- id: "example",
31
- bearerAuth: withToken({
32
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
33
- }),
29
+ id: "example",
30
+ server: "sandbox",
31
+ merchantAccountId: "default",
32
+ bearerAuth: withToken({
33
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
34
+ }),
34
35
  });
35
36
 
36
37
  async function run() {
@@ -50,18 +51,13 @@ The standalone function version of this method:
50
51
 
51
52
  ```typescript
52
53
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
53
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
54
54
  import { transactionsList } from "@gr4vy/sdk/funcs/transactionsList.js";
55
55
 
56
56
  // Use `Gr4vyCore` for best tree-shaking performance.
57
57
  // You can create one instance of it to use across an application.
58
58
  const gr4vy = new Gr4vyCore({
59
59
  merchantAccountId: "<id>",
60
- server: "sandbox",
61
- id: "example",
62
- bearerAuth: withToken({
63
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
64
- }),
60
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
65
61
  });
66
62
 
67
63
  async function run() {
@@ -118,15 +114,16 @@ Create a new transaction using a supported payment method. If additional buyer a
118
114
 
119
115
  <!-- UsageSnippet language="typescript" operationID="create_transaction" method="post" path="/transactions" -->
120
116
  ```typescript
121
- import { Gr4vy } from "@gr4vy/sdk";
117
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
118
+ import fs from "fs";
122
119
 
123
120
  const gr4vy = new Gr4vy({
124
- merchantAccountId: "<id>",
125
- server: "sandbox",
126
- id: "example",
127
- bearerAuth: withToken({
128
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
129
- }),
121
+ id: "example",
122
+ server: "sandbox",
123
+ merchantAccountId: "default",
124
+ bearerAuth: withToken({
125
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
126
+ }),
130
127
  });
131
128
 
132
129
  async function run() {
@@ -152,18 +149,13 @@ The standalone function version of this method:
152
149
 
153
150
  ```typescript
154
151
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
155
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
156
152
  import { transactionsCreate } from "@gr4vy/sdk/funcs/transactionsCreate.js";
157
153
 
158
154
  // Use `Gr4vyCore` for best tree-shaking performance.
159
155
  // You can create one instance of it to use across an application.
160
156
  const gr4vy = new Gr4vyCore({
161
157
  merchantAccountId: "<id>",
162
- server: "sandbox",
163
- id: "example",
164
- bearerAuth: withToken({
165
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
166
- }),
158
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
167
159
  });
168
160
 
169
161
  async function run() {
@@ -229,15 +221,16 @@ Retrieve the details of a transaction by its unique identifier.
229
221
 
230
222
  <!-- UsageSnippet language="typescript" operationID="get_transaction" method="get" path="/transactions/{transaction_id}" -->
231
223
  ```typescript
232
- import { Gr4vy } from "@gr4vy/sdk";
224
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
225
+ import fs from "fs";
233
226
 
234
227
  const gr4vy = new Gr4vy({
235
- merchantAccountId: "<id>",
236
- server: "sandbox",
237
- id: "example",
238
- bearerAuth: withToken({
239
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
240
- }),
228
+ id: "example",
229
+ server: "sandbox",
230
+ merchantAccountId: "default",
231
+ bearerAuth: withToken({
232
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
233
+ }),
241
234
  });
242
235
 
243
236
  async function run() {
@@ -255,18 +248,13 @@ The standalone function version of this method:
255
248
 
256
249
  ```typescript
257
250
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
258
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
259
251
  import { transactionsGet } from "@gr4vy/sdk/funcs/transactionsGet.js";
260
252
 
261
253
  // Use `Gr4vyCore` for best tree-shaking performance.
262
254
  // You can create one instance of it to use across an application.
263
255
  const gr4vy = new Gr4vyCore({
264
256
  merchantAccountId: "<id>",
265
- server: "sandbox",
266
- id: "example",
267
- bearerAuth: withToken({
268
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
269
- }),
257
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
270
258
  });
271
259
 
272
260
  async function run() {
@@ -322,15 +310,16 @@ Manually updates a transaction.
322
310
 
323
311
  <!-- UsageSnippet language="typescript" operationID="update_transaction" method="put" path="/transactions/{transaction_id}" -->
324
312
  ```typescript
325
- import { Gr4vy } from "@gr4vy/sdk";
313
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
314
+ import fs from "fs";
326
315
 
327
316
  const gr4vy = new Gr4vy({
328
- merchantAccountId: "<id>",
329
- server: "sandbox",
330
- id: "example",
331
- bearerAuth: withToken({
332
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
333
- }),
317
+ id: "example",
318
+ server: "sandbox",
319
+ merchantAccountId: "default",
320
+ bearerAuth: withToken({
321
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
322
+ }),
334
323
  });
335
324
 
336
325
  async function run() {
@@ -348,18 +337,13 @@ The standalone function version of this method:
348
337
 
349
338
  ```typescript
350
339
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
351
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
352
340
  import { transactionsUpdate } from "@gr4vy/sdk/funcs/transactionsUpdate.js";
353
341
 
354
342
  // Use `Gr4vyCore` for best tree-shaking performance.
355
343
  // You can create one instance of it to use across an application.
356
344
  const gr4vy = new Gr4vyCore({
357
345
  merchantAccountId: "<id>",
358
- server: "sandbox",
359
- id: "example",
360
- bearerAuth: withToken({
361
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
362
- }),
346
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
363
347
  });
364
348
 
365
349
  async function run() {
@@ -416,15 +400,16 @@ Captures a previously authorized transaction. You can capture the full or a part
416
400
 
417
401
  <!-- UsageSnippet language="typescript" operationID="capture_transaction" method="post" path="/transactions/{transaction_id}/capture" -->
418
402
  ```typescript
419
- import { Gr4vy } from "@gr4vy/sdk";
403
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
404
+ import fs from "fs";
420
405
 
421
406
  const gr4vy = new Gr4vy({
422
- merchantAccountId: "<id>",
423
- server: "sandbox",
424
- id: "example",
425
- bearerAuth: withToken({
426
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
427
- }),
407
+ id: "example",
408
+ server: "sandbox",
409
+ merchantAccountId: "default",
410
+ bearerAuth: withToken({
411
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
412
+ }),
428
413
  });
429
414
 
430
415
  async function run() {
@@ -442,18 +427,13 @@ The standalone function version of this method:
442
427
 
443
428
  ```typescript
444
429
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
445
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
446
430
  import { transactionsCapture } from "@gr4vy/sdk/funcs/transactionsCapture.js";
447
431
 
448
432
  // Use `Gr4vyCore` for best tree-shaking performance.
449
433
  // You can create one instance of it to use across an application.
450
434
  const gr4vy = new Gr4vyCore({
451
435
  merchantAccountId: "<id>",
452
- server: "sandbox",
453
- id: "example",
454
- bearerAuth: withToken({
455
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
456
- }),
436
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
457
437
  });
458
438
 
459
439
  async function run() {
@@ -511,15 +491,16 @@ Voids a previously authorized transaction. If the transaction was not yet succes
511
491
 
512
492
  <!-- UsageSnippet language="typescript" operationID="void_transaction" method="post" path="/transactions/{transaction_id}/void" -->
513
493
  ```typescript
514
- import { Gr4vy } from "@gr4vy/sdk";
494
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
495
+ import fs from "fs";
515
496
 
516
497
  const gr4vy = new Gr4vy({
517
- merchantAccountId: "<id>",
518
- server: "sandbox",
519
- id: "example",
520
- bearerAuth: withToken({
521
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
522
- }),
498
+ id: "example",
499
+ server: "sandbox",
500
+ merchantAccountId: "default",
501
+ bearerAuth: withToken({
502
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
503
+ }),
523
504
  });
524
505
 
525
506
  async function run() {
@@ -537,18 +518,13 @@ The standalone function version of this method:
537
518
 
538
519
  ```typescript
539
520
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
540
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
541
521
  import { transactionsVoid } from "@gr4vy/sdk/funcs/transactionsVoid.js";
542
522
 
543
523
  // Use `Gr4vyCore` for best tree-shaking performance.
544
524
  // You can create one instance of it to use across an application.
545
525
  const gr4vy = new Gr4vyCore({
546
526
  merchantAccountId: "<id>",
547
- server: "sandbox",
548
- id: "example",
549
- bearerAuth: withToken({
550
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
551
- }),
527
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
552
528
  });
553
529
 
554
530
  async function run() {
@@ -605,15 +581,16 @@ Cancels a pending transaction. If the transaction was successfully authorized, o
605
581
 
606
582
  <!-- UsageSnippet language="typescript" operationID="cancel_transaction" method="post" path="/transactions/{transaction_id}/cancel" -->
607
583
  ```typescript
608
- import { Gr4vy } from "@gr4vy/sdk";
584
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
585
+ import fs from "fs";
609
586
 
610
587
  const gr4vy = new Gr4vy({
611
- merchantAccountId: "<id>",
612
- server: "sandbox",
613
- id: "example",
614
- bearerAuth: withToken({
615
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
616
- }),
588
+ id: "example",
589
+ server: "sandbox",
590
+ merchantAccountId: "default",
591
+ bearerAuth: withToken({
592
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
593
+ }),
617
594
  });
618
595
 
619
596
  async function run() {
@@ -631,18 +608,13 @@ The standalone function version of this method:
631
608
 
632
609
  ```typescript
633
610
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
634
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
635
611
  import { transactionsCancel } from "@gr4vy/sdk/funcs/transactionsCancel.js";
636
612
 
637
613
  // Use `Gr4vyCore` for best tree-shaking performance.
638
614
  // You can create one instance of it to use across an application.
639
615
  const gr4vy = new Gr4vyCore({
640
616
  merchantAccountId: "<id>",
641
- server: "sandbox",
642
- id: "example",
643
- bearerAuth: withToken({
644
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
645
- }),
617
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
646
618
  });
647
619
 
648
620
  async function run() {
@@ -698,15 +670,16 @@ Synchronizes the status of a transaction with the underlying payment service pro
698
670
 
699
671
  <!-- UsageSnippet language="typescript" operationID="sync_transaction" method="post" path="/transactions/{transaction_id}/sync" -->
700
672
  ```typescript
701
- import { Gr4vy } from "@gr4vy/sdk";
673
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
674
+ import fs from "fs";
702
675
 
703
676
  const gr4vy = new Gr4vy({
704
- merchantAccountId: "<id>",
705
- server: "sandbox",
706
- id: "example",
707
- bearerAuth: withToken({
708
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
709
- }),
677
+ id: "example",
678
+ server: "sandbox",
679
+ merchantAccountId: "default",
680
+ bearerAuth: withToken({
681
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
682
+ }),
710
683
  });
711
684
 
712
685
  async function run() {
@@ -724,18 +697,13 @@ The standalone function version of this method:
724
697
 
725
698
  ```typescript
726
699
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
727
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
728
700
  import { transactionsSync } from "@gr4vy/sdk/funcs/transactionsSync.js";
729
701
 
730
702
  // Use `Gr4vyCore` for best tree-shaking performance.
731
703
  // You can create one instance of it to use across an application.
732
704
  const gr4vy = new Gr4vyCore({
733
705
  merchantAccountId: "<id>",
734
- server: "sandbox",
735
- id: "example",
736
- bearerAuth: withToken({
737
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
738
- }),
706
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
739
707
  });
740
708
 
741
709
  async function run() {
@@ -11,11 +11,16 @@ dotenv.config();
11
11
  * npm run build && npx tsx accountUpdaterJobsCreate.example.ts
12
12
  */
13
13
 
14
- import { Gr4vy } from "@gr4vy/sdk";
14
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
15
+ import fs from "fs";
15
16
 
16
17
  const gr4vy = new Gr4vy({
17
- merchantAccountId: "<id>",
18
- bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
18
+ id: "example",
19
+ server: "sandbox",
20
+ merchantAccountId: "default",
21
+ bearerAuth: withToken({
22
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
23
+ }),
19
24
  });
20
25
 
21
26
  async function main() {