@gr4vy/sdk 1.1.28 → 1.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +9 -9
- package/README.md +91 -61
- package/docs/sdks/all/README.md +9 -13
- package/docs/sdks/auditlogs/README.md +9 -13
- package/docs/sdks/balances/README.md +9 -13
- package/docs/sdks/buyers/README.md +45 -65
- package/docs/sdks/cardschemedefinitions/README.md +9 -13
- package/docs/sdks/checkoutsessions/README.md +36 -52
- package/docs/sdks/cryptogram/README.md +9 -13
- package/docs/sdks/digitalwallets/README.md +45 -65
- package/docs/sdks/domains/README.md +18 -26
- package/docs/sdks/events/README.md +9 -13
- package/docs/sdks/executions/README.md +27 -39
- package/docs/sdks/giftcards/README.md +36 -52
- package/docs/sdks/gr4vy/README.md +0 -83
- package/docs/sdks/gr4vygiftcards/README.md +9 -13
- package/docs/sdks/gr4vypaymentmethods/README.md +9 -13
- package/docs/sdks/gr4vyrefunds/README.md +27 -39
- package/docs/sdks/jobs/README.md +9 -13
- package/docs/sdks/merchantaccounts/README.md +36 -48
- package/docs/sdks/networktokens/README.md +45 -65
- package/docs/sdks/paymentlinks/README.md +36 -52
- package/docs/sdks/paymentmethods/README.md +36 -52
- package/docs/sdks/paymentoptions/README.md +9 -13
- package/docs/sdks/paymentservicedefinitions/README.md +27 -36
- package/docs/sdks/paymentservices/README.md +63 -91
- package/docs/sdks/paymentservicetokens/README.md +27 -39
- package/docs/sdks/payouts/README.md +27 -39
- package/docs/sdks/refunds/README.md +9 -13
- package/docs/sdks/reportexecutions/README.md +9 -13
- package/docs/sdks/reports/README.md +36 -52
- package/docs/sdks/sessions/README.md +27 -38
- package/docs/sdks/settlements/README.md +18 -26
- package/docs/sdks/shippingdetails/README.md +45 -65
- package/docs/sdks/transactions/README.md +63 -91
- package/examples/accountUpdaterJobsCreate.example.ts +37 -0
- package/examples/package-lock.json +2716 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/operations/index.d.ts +0 -1
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +0 -1
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/sdk.d.ts +1 -5
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +0 -8
- package/sdk/sdk.js.map +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/operations/index.ts +0 -1
- package/src/sdk/sdk.ts +1 -17
- package/examples/browsePaymentMethodDefinitionsGet.example.ts +0 -27
- package/funcs/browsePaymentMethodDefinitionsGet.d.ts +0 -14
- package/funcs/browsePaymentMethodDefinitionsGet.d.ts.map +0 -1
- package/funcs/browsePaymentMethodDefinitionsGet.js +0 -130
- package/funcs/browsePaymentMethodDefinitionsGet.js.map +0 -1
- package/models/operations/browsepaymentmethoddefinitionsget.d.ts +0 -57
- package/models/operations/browsepaymentmethoddefinitionsget.d.ts.map +0 -1
- package/models/operations/browsepaymentmethoddefinitionsget.js +0 -96
- package/models/operations/browsepaymentmethoddefinitionsget.js.map +0 -1
- package/src/funcs/browsePaymentMethodDefinitionsGet.ts +0 -188
- package/src/models/operations/browsepaymentmethoddefinitionsget.ts +0 -149
|
@@ -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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
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
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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
|
-
|
|
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
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
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
|
-
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
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
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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
|
-
|
|
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
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
-
|
|
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
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
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
|
-
|
|
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
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
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
|
-
|
|
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() {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import dotenv from "dotenv";
|
|
6
|
+
dotenv.config();
|
|
7
|
+
/**
|
|
8
|
+
* Example usage of the @gr4vy/sdk SDK
|
|
9
|
+
*
|
|
10
|
+
* To run this example from the examples directory:
|
|
11
|
+
* npm run build && npx tsx accountUpdaterJobsCreate.example.ts
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
15
|
+
import fs from "fs";
|
|
16
|
+
|
|
17
|
+
const gr4vy = new Gr4vy({
|
|
18
|
+
id: "example",
|
|
19
|
+
server: "sandbox",
|
|
20
|
+
merchantAccountId: "default",
|
|
21
|
+
bearerAuth: withToken({
|
|
22
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
23
|
+
}),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
async function main() {
|
|
27
|
+
const result = await gr4vy.create({
|
|
28
|
+
paymentMethodIds: [
|
|
29
|
+
"ef9496d8-53a5-4aad-8ca2-00eb68334389",
|
|
30
|
+
"f29e886e-93cc-4714-b4a3-12b7a718e595",
|
|
31
|
+
],
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
console.log(result);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
main().catch(console.error);
|