@gr4vy/sdk 1.1.29 → 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 (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 +63 -91
  35. package/examples/accountUpdaterJobsCreate.example.ts +9 -4
  36. package/examples/package-lock.json +2716 -0
  37. package/jsr.json +1 -1
  38. package/lib/config.d.ts +3 -3
  39. package/lib/config.js +3 -3
  40. package/package.json +1 -1
  41. package/src/lib/config.ts +3 -3
@@ -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() {
@@ -21,15 +21,16 @@ Returns a paginated list of transactions for the merchant account, sorted by mos
21
21
 
22
22
  <!-- UsageSnippet language="typescript" operationID="list_transactions" method="get" path="/transactions" -->
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 { transactionsList } from "@gr4vy/sdk/funcs/transactionsList.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 @@ Create a new transaction using a supported payment method. If additional buyer a
117
113
 
118
114
  <!-- UsageSnippet language="typescript" operationID="create_transaction" method="post" path="/transactions" -->
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() {
@@ -151,18 +148,13 @@ The standalone function version of this method:
151
148
 
152
149
  ```typescript
153
150
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
154
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
155
151
  import { transactionsCreate } from "@gr4vy/sdk/funcs/transactionsCreate.js";
156
152
 
157
153
  // Use `Gr4vyCore` for best tree-shaking performance.
158
154
  // You can create one instance of it to use across an application.
159
155
  const gr4vy = new Gr4vyCore({
160
156
  merchantAccountId: "<id>",
161
- server: "sandbox",
162
- id: "example",
163
- bearerAuth: withToken({
164
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
165
- }),
157
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
166
158
  });
167
159
 
168
160
  async function run() {
@@ -228,15 +220,16 @@ Retrieve the details of a transaction by its unique identifier.
228
220
 
229
221
  <!-- UsageSnippet language="typescript" operationID="get_transaction" method="get" path="/transactions/{transaction_id}" -->
230
222
  ```typescript
231
- import { Gr4vy } from "@gr4vy/sdk";
223
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
224
+ import fs from "fs";
232
225
 
233
226
  const gr4vy = new Gr4vy({
234
- merchantAccountId: "<id>",
235
- server: "sandbox",
236
- id: "example",
237
- bearerAuth: withToken({
238
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
239
- }),
227
+ id: "example",
228
+ server: "sandbox",
229
+ merchantAccountId: "default",
230
+ bearerAuth: withToken({
231
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
232
+ }),
240
233
  });
241
234
 
242
235
  async function run() {
@@ -254,18 +247,13 @@ The standalone function version of this method:
254
247
 
255
248
  ```typescript
256
249
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
257
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
258
250
  import { transactionsGet } from "@gr4vy/sdk/funcs/transactionsGet.js";
259
251
 
260
252
  // Use `Gr4vyCore` for best tree-shaking performance.
261
253
  // You can create one instance of it to use across an application.
262
254
  const gr4vy = new Gr4vyCore({
263
255
  merchantAccountId: "<id>",
264
- server: "sandbox",
265
- id: "example",
266
- bearerAuth: withToken({
267
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
268
- }),
256
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
269
257
  });
270
258
 
271
259
  async function run() {
@@ -321,15 +309,16 @@ Manually updates a transaction.
321
309
 
322
310
  <!-- UsageSnippet language="typescript" operationID="update_transaction" method="put" path="/transactions/{transaction_id}" -->
323
311
  ```typescript
324
- import { Gr4vy } from "@gr4vy/sdk";
312
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
313
+ import fs from "fs";
325
314
 
326
315
  const gr4vy = new Gr4vy({
327
- merchantAccountId: "<id>",
328
- server: "sandbox",
329
- id: "example",
330
- bearerAuth: withToken({
331
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
332
- }),
316
+ id: "example",
317
+ server: "sandbox",
318
+ merchantAccountId: "default",
319
+ bearerAuth: withToken({
320
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
321
+ }),
333
322
  });
334
323
 
335
324
  async function run() {
@@ -347,18 +336,13 @@ The standalone function version of this method:
347
336
 
348
337
  ```typescript
349
338
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
350
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
351
339
  import { transactionsUpdate } from "@gr4vy/sdk/funcs/transactionsUpdate.js";
352
340
 
353
341
  // Use `Gr4vyCore` for best tree-shaking performance.
354
342
  // You can create one instance of it to use across an application.
355
343
  const gr4vy = new Gr4vyCore({
356
344
  merchantAccountId: "<id>",
357
- server: "sandbox",
358
- id: "example",
359
- bearerAuth: withToken({
360
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
361
- }),
345
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
362
346
  });
363
347
 
364
348
  async function run() {
@@ -415,15 +399,16 @@ Captures a previously authorized transaction. You can capture the full or a part
415
399
 
416
400
  <!-- UsageSnippet language="typescript" operationID="capture_transaction" method="post" path="/transactions/{transaction_id}/capture" -->
417
401
  ```typescript
418
- import { Gr4vy } from "@gr4vy/sdk";
402
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
403
+ import fs from "fs";
419
404
 
420
405
  const gr4vy = new Gr4vy({
421
- merchantAccountId: "<id>",
422
- server: "sandbox",
423
- id: "example",
424
- bearerAuth: withToken({
425
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
426
- }),
406
+ id: "example",
407
+ server: "sandbox",
408
+ merchantAccountId: "default",
409
+ bearerAuth: withToken({
410
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
411
+ }),
427
412
  });
428
413
 
429
414
  async function run() {
@@ -441,18 +426,13 @@ The standalone function version of this method:
441
426
 
442
427
  ```typescript
443
428
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
444
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
445
429
  import { transactionsCapture } from "@gr4vy/sdk/funcs/transactionsCapture.js";
446
430
 
447
431
  // Use `Gr4vyCore` for best tree-shaking performance.
448
432
  // You can create one instance of it to use across an application.
449
433
  const gr4vy = new Gr4vyCore({
450
434
  merchantAccountId: "<id>",
451
- server: "sandbox",
452
- id: "example",
453
- bearerAuth: withToken({
454
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
455
- }),
435
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
456
436
  });
457
437
 
458
438
  async function run() {
@@ -510,15 +490,16 @@ Voids a previously authorized transaction. If the transaction was not yet succes
510
490
 
511
491
  <!-- UsageSnippet language="typescript" operationID="void_transaction" method="post" path="/transactions/{transaction_id}/void" -->
512
492
  ```typescript
513
- import { Gr4vy } from "@gr4vy/sdk";
493
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
494
+ import fs from "fs";
514
495
 
515
496
  const gr4vy = new Gr4vy({
516
- merchantAccountId: "<id>",
517
- server: "sandbox",
518
- id: "example",
519
- bearerAuth: withToken({
520
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
521
- }),
497
+ id: "example",
498
+ server: "sandbox",
499
+ merchantAccountId: "default",
500
+ bearerAuth: withToken({
501
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
502
+ }),
522
503
  });
523
504
 
524
505
  async function run() {
@@ -536,18 +517,13 @@ The standalone function version of this method:
536
517
 
537
518
  ```typescript
538
519
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
539
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
540
520
  import { transactionsVoid } from "@gr4vy/sdk/funcs/transactionsVoid.js";
541
521
 
542
522
  // Use `Gr4vyCore` for best tree-shaking performance.
543
523
  // You can create one instance of it to use across an application.
544
524
  const gr4vy = new Gr4vyCore({
545
525
  merchantAccountId: "<id>",
546
- server: "sandbox",
547
- id: "example",
548
- bearerAuth: withToken({
549
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
550
- }),
526
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
551
527
  });
552
528
 
553
529
  async function run() {
@@ -604,15 +580,16 @@ Synchronizes the status of a transaction with the underlying payment service pro
604
580
 
605
581
  <!-- UsageSnippet language="typescript" operationID="sync_transaction" method="post" path="/transactions/{transaction_id}/sync" -->
606
582
  ```typescript
607
- import { Gr4vy } from "@gr4vy/sdk";
583
+ import { Gr4vy, withToken } from "@gr4vy/sdk";
584
+ import fs from "fs";
608
585
 
609
586
  const gr4vy = new Gr4vy({
610
- merchantAccountId: "<id>",
611
- server: "sandbox",
612
- id: "example",
613
- bearerAuth: withToken({
614
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
615
- }),
587
+ id: "example",
588
+ server: "sandbox",
589
+ merchantAccountId: "default",
590
+ bearerAuth: withToken({
591
+ privateKey: fs.readFileSync("private_key.pem", "utf8"),
592
+ }),
616
593
  });
617
594
 
618
595
  async function run() {
@@ -630,18 +607,13 @@ The standalone function version of this method:
630
607
 
631
608
  ```typescript
632
609
  import { Gr4vyCore } from "@gr4vy/sdk/core.js";
633
- import { withToken } from "@gr4vy/sdk/lib/auth.js";
634
610
  import { transactionsSync } from "@gr4vy/sdk/funcs/transactionsSync.js";
635
611
 
636
612
  // Use `Gr4vyCore` for best tree-shaking performance.
637
613
  // You can create one instance of it to use across an application.
638
614
  const gr4vy = new Gr4vyCore({
639
615
  merchantAccountId: "<id>",
640
- server: "sandbox",
641
- id: "example",
642
- bearerAuth: withToken({
643
- privateKey: fs.readFileSync("private_key.pem", "utf8"),
644
- }),
616
+ bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
645
617
  });
646
618
 
647
619
  async function run() {
@@ -8,14 +8,19 @@ dotenv.config();
8
8
  * Example usage of the @gr4vy/sdk SDK
9
9
  *
10
10
  * To run this example from the examples directory:
11
- * npm run build && npx tsx accountUpdaterJobsCreate.ts
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() {