@gr4vy/sdk 1.1.30 → 1.1.32
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.
- package/FUNCTIONS.md +6 -1
- package/README.md +37 -32
- package/docs/sdks/all/README.md +13 -9
- package/docs/sdks/auditlogs/README.md +13 -9
- package/docs/sdks/balances/README.md +13 -9
- package/docs/sdks/buyers/README.md +65 -45
- package/docs/sdks/cardschemedefinitions/README.md +13 -9
- package/docs/sdks/checkoutsessions/README.md +52 -36
- package/docs/sdks/cryptogram/README.md +13 -9
- package/docs/sdks/digitalwallets/README.md +65 -45
- package/docs/sdks/domains/README.md +26 -18
- package/docs/sdks/events/README.md +13 -9
- package/docs/sdks/executions/README.md +39 -27
- package/docs/sdks/giftcards/README.md +52 -36
- package/docs/sdks/gr4vygiftcards/README.md +13 -9
- package/docs/sdks/gr4vypaymentmethods/README.md +13 -9
- package/docs/sdks/gr4vyrefunds/README.md +39 -27
- package/docs/sdks/jobs/README.md +13 -9
- package/docs/sdks/merchantaccounts/README.md +48 -36
- package/docs/sdks/networktokens/README.md +65 -45
- package/docs/sdks/paymentlinks/README.md +52 -36
- package/docs/sdks/paymentmethods/README.md +52 -36
- package/docs/sdks/paymentoptions/README.md +13 -9
- package/docs/sdks/paymentservicedefinitions/README.md +36 -27
- package/docs/sdks/paymentservices/README.md +91 -63
- package/docs/sdks/paymentservicetokens/README.md +39 -27
- package/docs/sdks/payouts/README.md +39 -27
- package/docs/sdks/refunds/README.md +13 -9
- package/docs/sdks/reportexecutions/README.md +13 -9
- package/docs/sdks/reports/README.md +52 -36
- package/docs/sdks/sessions/README.md +38 -27
- package/docs/sdks/settlements/README.md +26 -18
- package/docs/sdks/shippingdetails/README.md +65 -45
- package/docs/sdks/transactions/README.md +91 -63
- package/examples/accountUpdaterJobsCreate.example.ts +3 -8
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js.map +1 -1
- package/models/components/stripeconnectoptions.d.ts +5 -0
- package/models/components/stripeconnectoptions.d.ts.map +1 -1
- package/models/components/stripeconnectoptions.js +4 -0
- package/models/components/stripeconnectoptions.js.map +1 -1
- package/models/components/transactionevent.d.ts +2 -0
- package/models/components/transactionevent.d.ts.map +1 -1
- package/models/components/transactionevent.js +2 -0
- package/models/components/transactionevent.js.map +1 -1
- package/models/components/travelhuboptions.d.ts +5 -0
- package/models/components/travelhuboptions.d.ts.map +1 -1
- package/models/components/travelhuboptions.js +2 -0
- package/models/components/travelhuboptions.js.map +1 -1
- package/models/components/trustlyoptions.d.ts +5 -0
- package/models/components/trustlyoptions.d.ts.map +1 -1
- package/models/components/trustlyoptions.js +2 -0
- package/models/components/trustlyoptions.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +4 -1
- package/src/models/components/stripeconnectoptions.ts +9 -0
- package/src/models/components/transactionevent.ts +4 -0
- package/src/models/components/travelhuboptions.ts +7 -0
- package/src/models/components/trustlyoptions.ts +7 -0
- package/examples/package-lock.json +0 -2716
|
@@ -16,16 +16,15 @@ 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
|
|
20
|
-
import fs from "fs";
|
|
19
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
21
20
|
|
|
22
21
|
const gr4vy = new Gr4vy({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
merchantAccountId: "<id>",
|
|
23
|
+
server: "sandbox",
|
|
24
|
+
id: "example",
|
|
25
|
+
bearerAuth: withToken({
|
|
26
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
27
|
+
}),
|
|
29
28
|
});
|
|
30
29
|
|
|
31
30
|
async function run() {
|
|
@@ -43,13 +42,18 @@ The standalone function version of this method:
|
|
|
43
42
|
|
|
44
43
|
```typescript
|
|
45
44
|
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
|
-
|
|
52
|
+
server: "sandbox",
|
|
53
|
+
id: "example",
|
|
54
|
+
bearerAuth: withToken({
|
|
55
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
56
|
+
}),
|
|
53
57
|
});
|
|
54
58
|
|
|
55
59
|
async function run() {
|
|
@@ -106,16 +110,15 @@ List all settlements for a specific transaction.
|
|
|
106
110
|
|
|
107
111
|
<!-- UsageSnippet language="typescript" operationID="list_transaction_settlements" method="get" path="/transactions/{transaction_id}/settlements" -->
|
|
108
112
|
```typescript
|
|
109
|
-
import { Gr4vy
|
|
110
|
-
import fs from "fs";
|
|
113
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
111
114
|
|
|
112
115
|
const gr4vy = new Gr4vy({
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
merchantAccountId: "<id>",
|
|
117
|
+
server: "sandbox",
|
|
118
|
+
id: "example",
|
|
119
|
+
bearerAuth: withToken({
|
|
120
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
121
|
+
}),
|
|
119
122
|
});
|
|
120
123
|
|
|
121
124
|
async function run() {
|
|
@@ -133,13 +136,18 @@ The standalone function version of this method:
|
|
|
133
136
|
|
|
134
137
|
```typescript
|
|
135
138
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
139
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
136
140
|
import { transactionsSettlementsList } from "@gr4vy/sdk/funcs/transactionsSettlementsList.js";
|
|
137
141
|
|
|
138
142
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
139
143
|
// You can create one instance of it to use across an application.
|
|
140
144
|
const gr4vy = new Gr4vyCore({
|
|
141
145
|
merchantAccountId: "<id>",
|
|
142
|
-
|
|
146
|
+
server: "sandbox",
|
|
147
|
+
id: "example",
|
|
148
|
+
bearerAuth: withToken({
|
|
149
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
150
|
+
}),
|
|
143
151
|
});
|
|
144
152
|
|
|
145
153
|
async function run() {
|
|
@@ -19,16 +19,15 @@ 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
|
|
23
|
-
import fs from "fs";
|
|
22
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
24
23
|
|
|
25
24
|
const gr4vy = new Gr4vy({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
merchantAccountId: "<id>",
|
|
26
|
+
server: "sandbox",
|
|
27
|
+
id: "example",
|
|
28
|
+
bearerAuth: withToken({
|
|
29
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
30
|
+
}),
|
|
32
31
|
});
|
|
33
32
|
|
|
34
33
|
async function run() {
|
|
@@ -46,13 +45,18 @@ The standalone function version of this method:
|
|
|
46
45
|
|
|
47
46
|
```typescript
|
|
48
47
|
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
|
-
|
|
55
|
+
server: "sandbox",
|
|
56
|
+
id: "example",
|
|
57
|
+
bearerAuth: withToken({
|
|
58
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
59
|
+
}),
|
|
56
60
|
});
|
|
57
61
|
|
|
58
62
|
async function run() {
|
|
@@ -109,16 +113,15 @@ List all the shipping details associated to a specific buyer.
|
|
|
109
113
|
|
|
110
114
|
<!-- UsageSnippet language="typescript" operationID="list_buyer_shipping_details" method="get" path="/buyers/{buyer_id}/shipping-details" -->
|
|
111
115
|
```typescript
|
|
112
|
-
import { Gr4vy
|
|
113
|
-
import fs from "fs";
|
|
116
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
114
117
|
|
|
115
118
|
const gr4vy = new Gr4vy({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
merchantAccountId: "<id>",
|
|
120
|
+
server: "sandbox",
|
|
121
|
+
id: "example",
|
|
122
|
+
bearerAuth: withToken({
|
|
123
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
124
|
+
}),
|
|
122
125
|
});
|
|
123
126
|
|
|
124
127
|
async function run() {
|
|
@@ -136,13 +139,18 @@ The standalone function version of this method:
|
|
|
136
139
|
|
|
137
140
|
```typescript
|
|
138
141
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
142
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
139
143
|
import { buyersShippingDetailsList } from "@gr4vy/sdk/funcs/buyersShippingDetailsList.js";
|
|
140
144
|
|
|
141
145
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
142
146
|
// You can create one instance of it to use across an application.
|
|
143
147
|
const gr4vy = new Gr4vyCore({
|
|
144
148
|
merchantAccountId: "<id>",
|
|
145
|
-
|
|
149
|
+
server: "sandbox",
|
|
150
|
+
id: "example",
|
|
151
|
+
bearerAuth: withToken({
|
|
152
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
153
|
+
}),
|
|
146
154
|
});
|
|
147
155
|
|
|
148
156
|
async function run() {
|
|
@@ -198,16 +206,15 @@ Get a buyer's shipping details.
|
|
|
198
206
|
|
|
199
207
|
<!-- UsageSnippet language="typescript" operationID="get_buyer_shipping_details" method="get" path="/buyers/{buyer_id}/shipping-details/{shipping_details_id}" -->
|
|
200
208
|
```typescript
|
|
201
|
-
import { Gr4vy
|
|
202
|
-
import fs from "fs";
|
|
209
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
203
210
|
|
|
204
211
|
const gr4vy = new Gr4vy({
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
212
|
+
merchantAccountId: "<id>",
|
|
213
|
+
server: "sandbox",
|
|
214
|
+
id: "example",
|
|
215
|
+
bearerAuth: withToken({
|
|
216
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
217
|
+
}),
|
|
211
218
|
});
|
|
212
219
|
|
|
213
220
|
async function run() {
|
|
@@ -225,13 +232,18 @@ The standalone function version of this method:
|
|
|
225
232
|
|
|
226
233
|
```typescript
|
|
227
234
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
235
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
228
236
|
import { buyersShippingDetailsGet } from "@gr4vy/sdk/funcs/buyersShippingDetailsGet.js";
|
|
229
237
|
|
|
230
238
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
231
239
|
// You can create one instance of it to use across an application.
|
|
232
240
|
const gr4vy = new Gr4vyCore({
|
|
233
241
|
merchantAccountId: "<id>",
|
|
234
|
-
|
|
242
|
+
server: "sandbox",
|
|
243
|
+
id: "example",
|
|
244
|
+
bearerAuth: withToken({
|
|
245
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
246
|
+
}),
|
|
235
247
|
});
|
|
236
248
|
|
|
237
249
|
async function run() {
|
|
@@ -288,16 +300,15 @@ Update the shipping details associated to a specific buyer.
|
|
|
288
300
|
|
|
289
301
|
<!-- UsageSnippet language="typescript" operationID="update_buyer_shipping_details" method="put" path="/buyers/{buyer_id}/shipping-details/{shipping_details_id}" -->
|
|
290
302
|
```typescript
|
|
291
|
-
import { Gr4vy
|
|
292
|
-
import fs from "fs";
|
|
303
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
293
304
|
|
|
294
305
|
const gr4vy = new Gr4vy({
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
306
|
+
merchantAccountId: "<id>",
|
|
307
|
+
server: "sandbox",
|
|
308
|
+
id: "example",
|
|
309
|
+
bearerAuth: withToken({
|
|
310
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
311
|
+
}),
|
|
301
312
|
});
|
|
302
313
|
|
|
303
314
|
async function run() {
|
|
@@ -315,13 +326,18 @@ The standalone function version of this method:
|
|
|
315
326
|
|
|
316
327
|
```typescript
|
|
317
328
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
329
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
318
330
|
import { buyersShippingDetailsUpdate } from "@gr4vy/sdk/funcs/buyersShippingDetailsUpdate.js";
|
|
319
331
|
|
|
320
332
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
321
333
|
// You can create one instance of it to use across an application.
|
|
322
334
|
const gr4vy = new Gr4vyCore({
|
|
323
335
|
merchantAccountId: "<id>",
|
|
324
|
-
|
|
336
|
+
server: "sandbox",
|
|
337
|
+
id: "example",
|
|
338
|
+
bearerAuth: withToken({
|
|
339
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
340
|
+
}),
|
|
325
341
|
});
|
|
326
342
|
|
|
327
343
|
async function run() {
|
|
@@ -379,16 +395,15 @@ Delete the shipping details associated to a specific buyer.
|
|
|
379
395
|
|
|
380
396
|
<!-- UsageSnippet language="typescript" operationID="delete_buyer_shipping_details" method="delete" path="/buyers/{buyer_id}/shipping-details/{shipping_details_id}" -->
|
|
381
397
|
```typescript
|
|
382
|
-
import { Gr4vy
|
|
383
|
-
import fs from "fs";
|
|
398
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
384
399
|
|
|
385
400
|
const gr4vy = new Gr4vy({
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
401
|
+
merchantAccountId: "<id>",
|
|
402
|
+
server: "sandbox",
|
|
403
|
+
id: "example",
|
|
404
|
+
bearerAuth: withToken({
|
|
405
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
406
|
+
}),
|
|
392
407
|
});
|
|
393
408
|
|
|
394
409
|
async function run() {
|
|
@@ -406,13 +421,18 @@ The standalone function version of this method:
|
|
|
406
421
|
|
|
407
422
|
```typescript
|
|
408
423
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
424
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
409
425
|
import { buyersShippingDetailsDelete } from "@gr4vy/sdk/funcs/buyersShippingDetailsDelete.js";
|
|
410
426
|
|
|
411
427
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
412
428
|
// You can create one instance of it to use across an application.
|
|
413
429
|
const gr4vy = new Gr4vyCore({
|
|
414
430
|
merchantAccountId: "<id>",
|
|
415
|
-
|
|
431
|
+
server: "sandbox",
|
|
432
|
+
id: "example",
|
|
433
|
+
bearerAuth: withToken({
|
|
434
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
435
|
+
}),
|
|
416
436
|
});
|
|
417
437
|
|
|
418
438
|
async function run() {
|
|
@@ -21,16 +21,15 @@ 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
|
|
25
|
-
import fs from "fs";
|
|
24
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
26
25
|
|
|
27
26
|
const gr4vy = new Gr4vy({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
merchantAccountId: "<id>",
|
|
28
|
+
server: "sandbox",
|
|
29
|
+
id: "example",
|
|
30
|
+
bearerAuth: withToken({
|
|
31
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
32
|
+
}),
|
|
34
33
|
});
|
|
35
34
|
|
|
36
35
|
async function run() {
|
|
@@ -50,13 +49,18 @@ The standalone function version of this method:
|
|
|
50
49
|
|
|
51
50
|
```typescript
|
|
52
51
|
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
|
-
|
|
59
|
+
server: "sandbox",
|
|
60
|
+
id: "example",
|
|
61
|
+
bearerAuth: withToken({
|
|
62
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
63
|
+
}),
|
|
60
64
|
});
|
|
61
65
|
|
|
62
66
|
async function run() {
|
|
@@ -113,16 +117,15 @@ Create a new transaction using a supported payment method. If additional buyer a
|
|
|
113
117
|
|
|
114
118
|
<!-- UsageSnippet language="typescript" operationID="create_transaction" method="post" path="/transactions" -->
|
|
115
119
|
```typescript
|
|
116
|
-
import { Gr4vy
|
|
117
|
-
import fs from "fs";
|
|
120
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
118
121
|
|
|
119
122
|
const gr4vy = new Gr4vy({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
merchantAccountId: "<id>",
|
|
124
|
+
server: "sandbox",
|
|
125
|
+
id: "example",
|
|
126
|
+
bearerAuth: withToken({
|
|
127
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
128
|
+
}),
|
|
126
129
|
});
|
|
127
130
|
|
|
128
131
|
async function run() {
|
|
@@ -148,13 +151,18 @@ The standalone function version of this method:
|
|
|
148
151
|
|
|
149
152
|
```typescript
|
|
150
153
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
154
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
151
155
|
import { transactionsCreate } from "@gr4vy/sdk/funcs/transactionsCreate.js";
|
|
152
156
|
|
|
153
157
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
154
158
|
// You can create one instance of it to use across an application.
|
|
155
159
|
const gr4vy = new Gr4vyCore({
|
|
156
160
|
merchantAccountId: "<id>",
|
|
157
|
-
|
|
161
|
+
server: "sandbox",
|
|
162
|
+
id: "example",
|
|
163
|
+
bearerAuth: withToken({
|
|
164
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
165
|
+
}),
|
|
158
166
|
});
|
|
159
167
|
|
|
160
168
|
async function run() {
|
|
@@ -220,16 +228,15 @@ Retrieve the details of a transaction by its unique identifier.
|
|
|
220
228
|
|
|
221
229
|
<!-- UsageSnippet language="typescript" operationID="get_transaction" method="get" path="/transactions/{transaction_id}" -->
|
|
222
230
|
```typescript
|
|
223
|
-
import { Gr4vy
|
|
224
|
-
import fs from "fs";
|
|
231
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
225
232
|
|
|
226
233
|
const gr4vy = new Gr4vy({
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
234
|
+
merchantAccountId: "<id>",
|
|
235
|
+
server: "sandbox",
|
|
236
|
+
id: "example",
|
|
237
|
+
bearerAuth: withToken({
|
|
238
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
239
|
+
}),
|
|
233
240
|
});
|
|
234
241
|
|
|
235
242
|
async function run() {
|
|
@@ -247,13 +254,18 @@ The standalone function version of this method:
|
|
|
247
254
|
|
|
248
255
|
```typescript
|
|
249
256
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
257
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
250
258
|
import { transactionsGet } from "@gr4vy/sdk/funcs/transactionsGet.js";
|
|
251
259
|
|
|
252
260
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
253
261
|
// You can create one instance of it to use across an application.
|
|
254
262
|
const gr4vy = new Gr4vyCore({
|
|
255
263
|
merchantAccountId: "<id>",
|
|
256
|
-
|
|
264
|
+
server: "sandbox",
|
|
265
|
+
id: "example",
|
|
266
|
+
bearerAuth: withToken({
|
|
267
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
268
|
+
}),
|
|
257
269
|
});
|
|
258
270
|
|
|
259
271
|
async function run() {
|
|
@@ -309,16 +321,15 @@ Manually updates a transaction.
|
|
|
309
321
|
|
|
310
322
|
<!-- UsageSnippet language="typescript" operationID="update_transaction" method="put" path="/transactions/{transaction_id}" -->
|
|
311
323
|
```typescript
|
|
312
|
-
import { Gr4vy
|
|
313
|
-
import fs from "fs";
|
|
324
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
314
325
|
|
|
315
326
|
const gr4vy = new Gr4vy({
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
327
|
+
merchantAccountId: "<id>",
|
|
328
|
+
server: "sandbox",
|
|
329
|
+
id: "example",
|
|
330
|
+
bearerAuth: withToken({
|
|
331
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
332
|
+
}),
|
|
322
333
|
});
|
|
323
334
|
|
|
324
335
|
async function run() {
|
|
@@ -336,13 +347,18 @@ The standalone function version of this method:
|
|
|
336
347
|
|
|
337
348
|
```typescript
|
|
338
349
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
350
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
339
351
|
import { transactionsUpdate } from "@gr4vy/sdk/funcs/transactionsUpdate.js";
|
|
340
352
|
|
|
341
353
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
342
354
|
// You can create one instance of it to use across an application.
|
|
343
355
|
const gr4vy = new Gr4vyCore({
|
|
344
356
|
merchantAccountId: "<id>",
|
|
345
|
-
|
|
357
|
+
server: "sandbox",
|
|
358
|
+
id: "example",
|
|
359
|
+
bearerAuth: withToken({
|
|
360
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
361
|
+
}),
|
|
346
362
|
});
|
|
347
363
|
|
|
348
364
|
async function run() {
|
|
@@ -399,16 +415,15 @@ Captures a previously authorized transaction. You can capture the full or a part
|
|
|
399
415
|
|
|
400
416
|
<!-- UsageSnippet language="typescript" operationID="capture_transaction" method="post" path="/transactions/{transaction_id}/capture" -->
|
|
401
417
|
```typescript
|
|
402
|
-
import { Gr4vy
|
|
403
|
-
import fs from "fs";
|
|
418
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
404
419
|
|
|
405
420
|
const gr4vy = new Gr4vy({
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
421
|
+
merchantAccountId: "<id>",
|
|
422
|
+
server: "sandbox",
|
|
423
|
+
id: "example",
|
|
424
|
+
bearerAuth: withToken({
|
|
425
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
426
|
+
}),
|
|
412
427
|
});
|
|
413
428
|
|
|
414
429
|
async function run() {
|
|
@@ -426,13 +441,18 @@ The standalone function version of this method:
|
|
|
426
441
|
|
|
427
442
|
```typescript
|
|
428
443
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
444
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
429
445
|
import { transactionsCapture } from "@gr4vy/sdk/funcs/transactionsCapture.js";
|
|
430
446
|
|
|
431
447
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
432
448
|
// You can create one instance of it to use across an application.
|
|
433
449
|
const gr4vy = new Gr4vyCore({
|
|
434
450
|
merchantAccountId: "<id>",
|
|
435
|
-
|
|
451
|
+
server: "sandbox",
|
|
452
|
+
id: "example",
|
|
453
|
+
bearerAuth: withToken({
|
|
454
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
455
|
+
}),
|
|
436
456
|
});
|
|
437
457
|
|
|
438
458
|
async function run() {
|
|
@@ -490,16 +510,15 @@ Voids a previously authorized transaction. If the transaction was not yet succes
|
|
|
490
510
|
|
|
491
511
|
<!-- UsageSnippet language="typescript" operationID="void_transaction" method="post" path="/transactions/{transaction_id}/void" -->
|
|
492
512
|
```typescript
|
|
493
|
-
import { Gr4vy
|
|
494
|
-
import fs from "fs";
|
|
513
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
495
514
|
|
|
496
515
|
const gr4vy = new Gr4vy({
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
516
|
+
merchantAccountId: "<id>",
|
|
517
|
+
server: "sandbox",
|
|
518
|
+
id: "example",
|
|
519
|
+
bearerAuth: withToken({
|
|
520
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
521
|
+
}),
|
|
503
522
|
});
|
|
504
523
|
|
|
505
524
|
async function run() {
|
|
@@ -517,13 +536,18 @@ The standalone function version of this method:
|
|
|
517
536
|
|
|
518
537
|
```typescript
|
|
519
538
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
539
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
520
540
|
import { transactionsVoid } from "@gr4vy/sdk/funcs/transactionsVoid.js";
|
|
521
541
|
|
|
522
542
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
523
543
|
// You can create one instance of it to use across an application.
|
|
524
544
|
const gr4vy = new Gr4vyCore({
|
|
525
545
|
merchantAccountId: "<id>",
|
|
526
|
-
|
|
546
|
+
server: "sandbox",
|
|
547
|
+
id: "example",
|
|
548
|
+
bearerAuth: withToken({
|
|
549
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
550
|
+
}),
|
|
527
551
|
});
|
|
528
552
|
|
|
529
553
|
async function run() {
|
|
@@ -580,16 +604,15 @@ Synchronizes the status of a transaction with the underlying payment service pro
|
|
|
580
604
|
|
|
581
605
|
<!-- UsageSnippet language="typescript" operationID="sync_transaction" method="post" path="/transactions/{transaction_id}/sync" -->
|
|
582
606
|
```typescript
|
|
583
|
-
import { Gr4vy
|
|
584
|
-
import fs from "fs";
|
|
607
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
585
608
|
|
|
586
609
|
const gr4vy = new Gr4vy({
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
610
|
+
merchantAccountId: "<id>",
|
|
611
|
+
server: "sandbox",
|
|
612
|
+
id: "example",
|
|
613
|
+
bearerAuth: withToken({
|
|
614
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
615
|
+
}),
|
|
593
616
|
});
|
|
594
617
|
|
|
595
618
|
async function run() {
|
|
@@ -607,13 +630,18 @@ The standalone function version of this method:
|
|
|
607
630
|
|
|
608
631
|
```typescript
|
|
609
632
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
633
|
+
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
610
634
|
import { transactionsSync } from "@gr4vy/sdk/funcs/transactionsSync.js";
|
|
611
635
|
|
|
612
636
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
613
637
|
// You can create one instance of it to use across an application.
|
|
614
638
|
const gr4vy = new Gr4vyCore({
|
|
615
639
|
merchantAccountId: "<id>",
|
|
616
|
-
|
|
640
|
+
server: "sandbox",
|
|
641
|
+
id: "example",
|
|
642
|
+
bearerAuth: withToken({
|
|
643
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
644
|
+
}),
|
|
617
645
|
});
|
|
618
646
|
|
|
619
647
|
async function run() {
|
|
@@ -11,16 +11,11 @@ dotenv.config();
|
|
|
11
11
|
* npm run build && npx tsx accountUpdaterJobsCreate.example.ts
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { Gr4vy
|
|
15
|
-
import fs from "fs";
|
|
14
|
+
import { Gr4vy } from "@gr4vy/sdk";
|
|
16
15
|
|
|
17
16
|
const gr4vy = new Gr4vy({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
merchantAccountId: "default",
|
|
21
|
-
bearerAuth: withToken({
|
|
22
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
23
|
-
}),
|
|
17
|
+
merchantAccountId: "<id>",
|
|
18
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
24
19
|
});
|
|
25
20
|
|
|
26
21
|
async function main() {
|
package/jsr.json
CHANGED
package/lib/config.d.ts
CHANGED
|
@@ -44,8 +44,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
44
44
|
export declare const SDK_METADATA: {
|
|
45
45
|
readonly language: "typescript";
|
|
46
46
|
readonly openapiDocVersion: "1.0.0";
|
|
47
|
-
readonly sdkVersion: "1.1.
|
|
48
|
-
readonly genVersion: "2.
|
|
49
|
-
readonly userAgent: "speakeasy-sdk/typescript 1.1.
|
|
47
|
+
readonly sdkVersion: "1.1.32";
|
|
48
|
+
readonly genVersion: "2.686.7";
|
|
49
|
+
readonly userAgent: "speakeasy-sdk/typescript 1.1.32 2.686.7 1.0.0 @gr4vy/sdk";
|
|
50
50
|
};
|
|
51
51
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/config.js
CHANGED
|
@@ -37,8 +37,8 @@ function serverURLFromOptions(options) {
|
|
|
37
37
|
exports.SDK_METADATA = {
|
|
38
38
|
language: "typescript",
|
|
39
39
|
openapiDocVersion: "1.0.0",
|
|
40
|
-
sdkVersion: "1.1.
|
|
41
|
-
genVersion: "2.
|
|
42
|
-
userAgent: "speakeasy-sdk/typescript 1.1.
|
|
40
|
+
sdkVersion: "1.1.32",
|
|
41
|
+
genVersion: "2.686.7",
|
|
42
|
+
userAgent: "speakeasy-sdk/typescript 1.1.32 2.686.7 1.0.0 @gr4vy/sdk",
|
|
43
43
|
};
|
|
44
44
|
//# sourceMappingURL=config.js.map
|