@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.
- package/FUNCTIONS.md +1 -6
- package/README.md +32 -37
- 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/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 +72 -104
- package/examples/accountUpdaterJobsCreate.example.ts +8 -3
- package/examples/package-lock.json +620 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
|
@@ -18,14 +18,16 @@ List all merchant accounts in an instance.
|
|
|
18
18
|
|
|
19
19
|
<!-- UsageSnippet language="typescript" operationID="list_merchant_accounts" method="get" path="/merchant-accounts" -->
|
|
20
20
|
```typescript
|
|
21
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
21
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
22
|
+
import fs from "fs";
|
|
22
23
|
|
|
23
24
|
const gr4vy = new Gr4vy({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
id: "example",
|
|
26
|
+
server: "sandbox",
|
|
27
|
+
merchantAccountId: "default",
|
|
28
|
+
bearerAuth: withToken({
|
|
29
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
30
|
+
}),
|
|
29
31
|
});
|
|
30
32
|
|
|
31
33
|
async function run() {
|
|
@@ -45,17 +47,12 @@ The standalone function version of this method:
|
|
|
45
47
|
|
|
46
48
|
```typescript
|
|
47
49
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
48
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
49
50
|
import { merchantAccountsList } from "@gr4vy/sdk/funcs/merchantAccountsList.js";
|
|
50
51
|
|
|
51
52
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
52
53
|
// You can create one instance of it to use across an application.
|
|
53
54
|
const gr4vy = new Gr4vyCore({
|
|
54
|
-
|
|
55
|
-
id: "example",
|
|
56
|
-
bearerAuth: withToken({
|
|
57
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
58
|
-
}),
|
|
55
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
59
56
|
});
|
|
60
57
|
|
|
61
58
|
async function run() {
|
|
@@ -114,14 +111,16 @@ Create a new merchant account in an instance.
|
|
|
114
111
|
|
|
115
112
|
<!-- UsageSnippet language="typescript" operationID="create_merchant_account" method="post" path="/merchant-accounts" -->
|
|
116
113
|
```typescript
|
|
117
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
114
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
115
|
+
import fs from "fs";
|
|
118
116
|
|
|
119
117
|
const gr4vy = new Gr4vy({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
id: "example",
|
|
119
|
+
server: "sandbox",
|
|
120
|
+
merchantAccountId: "default",
|
|
121
|
+
bearerAuth: withToken({
|
|
122
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
123
|
+
}),
|
|
125
124
|
});
|
|
126
125
|
|
|
127
126
|
async function run() {
|
|
@@ -143,17 +142,12 @@ The standalone function version of this method:
|
|
|
143
142
|
|
|
144
143
|
```typescript
|
|
145
144
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
146
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
147
145
|
import { merchantAccountsCreate } from "@gr4vy/sdk/funcs/merchantAccountsCreate.js";
|
|
148
146
|
|
|
149
147
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
150
148
|
// You can create one instance of it to use across an application.
|
|
151
149
|
const gr4vy = new Gr4vyCore({
|
|
152
|
-
|
|
153
|
-
id: "example",
|
|
154
|
-
bearerAuth: withToken({
|
|
155
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
156
|
-
}),
|
|
150
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
157
151
|
});
|
|
158
152
|
|
|
159
153
|
async function run() {
|
|
@@ -212,14 +206,16 @@ Get info about a merchant account in an instance.
|
|
|
212
206
|
|
|
213
207
|
<!-- UsageSnippet language="typescript" operationID="get_merchant_account" method="get" path="/merchant-accounts/{merchant_account_id}" -->
|
|
214
208
|
```typescript
|
|
215
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
209
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
210
|
+
import fs from "fs";
|
|
216
211
|
|
|
217
212
|
const gr4vy = new Gr4vy({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
213
|
+
id: "example",
|
|
214
|
+
server: "sandbox",
|
|
215
|
+
merchantAccountId: "default",
|
|
216
|
+
bearerAuth: withToken({
|
|
217
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
218
|
+
}),
|
|
223
219
|
});
|
|
224
220
|
|
|
225
221
|
async function run() {
|
|
@@ -237,17 +233,12 @@ The standalone function version of this method:
|
|
|
237
233
|
|
|
238
234
|
```typescript
|
|
239
235
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
240
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
241
236
|
import { merchantAccountsGet } from "@gr4vy/sdk/funcs/merchantAccountsGet.js";
|
|
242
237
|
|
|
243
238
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
244
239
|
// You can create one instance of it to use across an application.
|
|
245
240
|
const gr4vy = new Gr4vyCore({
|
|
246
|
-
|
|
247
|
-
id: "example",
|
|
248
|
-
bearerAuth: withToken({
|
|
249
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
250
|
-
}),
|
|
241
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
251
242
|
});
|
|
252
243
|
|
|
253
244
|
async function run() {
|
|
@@ -302,14 +293,16 @@ Update info for a merchant account in an instance.
|
|
|
302
293
|
|
|
303
294
|
<!-- UsageSnippet language="typescript" operationID="update_merchant_account" method="put" path="/merchant-accounts/{merchant_account_id}" -->
|
|
304
295
|
```typescript
|
|
305
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
296
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
297
|
+
import fs from "fs";
|
|
306
298
|
|
|
307
299
|
const gr4vy = new Gr4vy({
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
300
|
+
id: "example",
|
|
301
|
+
server: "sandbox",
|
|
302
|
+
merchantAccountId: "default",
|
|
303
|
+
bearerAuth: withToken({
|
|
304
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
305
|
+
}),
|
|
313
306
|
});
|
|
314
307
|
|
|
315
308
|
async function run() {
|
|
@@ -329,17 +322,12 @@ The standalone function version of this method:
|
|
|
329
322
|
|
|
330
323
|
```typescript
|
|
331
324
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
332
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
333
325
|
import { merchantAccountsUpdate } from "@gr4vy/sdk/funcs/merchantAccountsUpdate.js";
|
|
334
326
|
|
|
335
327
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
336
328
|
// You can create one instance of it to use across an application.
|
|
337
329
|
const gr4vy = new Gr4vyCore({
|
|
338
|
-
|
|
339
|
-
id: "example",
|
|
340
|
-
bearerAuth: withToken({
|
|
341
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
342
|
-
}),
|
|
330
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
343
331
|
});
|
|
344
332
|
|
|
345
333
|
async function run() {
|
|
@@ -19,15 +19,16 @@ List all network tokens stored for a payment method.
|
|
|
19
19
|
|
|
20
20
|
<!-- UsageSnippet language="typescript" operationID="list_payment_method_network_tokens" method="get" path="/payment-methods/{payment_method_id}/network-tokens" -->
|
|
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 { paymentMethodsNetworkTokensList } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensList.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() {
|
|
@@ -112,15 +108,16 @@ Provision a network token for a payment method.
|
|
|
112
108
|
|
|
113
109
|
<!-- UsageSnippet language="typescript" operationID="create_payment_method_network_token" method="post" path="/payment-methods/{payment_method_id}/network-tokens" -->
|
|
114
110
|
```typescript
|
|
115
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
111
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
112
|
+
import fs from "fs";
|
|
116
113
|
|
|
117
114
|
const gr4vy = new Gr4vy({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
115
|
+
id: "example",
|
|
116
|
+
server: "sandbox",
|
|
117
|
+
merchantAccountId: "default",
|
|
118
|
+
bearerAuth: withToken({
|
|
119
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
120
|
+
}),
|
|
124
121
|
});
|
|
125
122
|
|
|
126
123
|
async function run() {
|
|
@@ -141,18 +138,13 @@ The standalone function version of this method:
|
|
|
141
138
|
|
|
142
139
|
```typescript
|
|
143
140
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
144
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
145
141
|
import { paymentMethodsNetworkTokensCreate } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensCreate.js";
|
|
146
142
|
|
|
147
143
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
148
144
|
// You can create one instance of it to use across an application.
|
|
149
145
|
const gr4vy = new Gr4vyCore({
|
|
150
146
|
merchantAccountId: "<id>",
|
|
151
|
-
|
|
152
|
-
id: "example",
|
|
153
|
-
bearerAuth: withToken({
|
|
154
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
155
|
-
}),
|
|
147
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
156
148
|
});
|
|
157
149
|
|
|
158
150
|
async function run() {
|
|
@@ -212,15 +204,16 @@ Suspend a network token for a payment method.
|
|
|
212
204
|
|
|
213
205
|
<!-- UsageSnippet language="typescript" operationID="suspend_payment_method_network_token" method="post" path="/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/suspend" -->
|
|
214
206
|
```typescript
|
|
215
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
207
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
208
|
+
import fs from "fs";
|
|
216
209
|
|
|
217
210
|
const gr4vy = new Gr4vy({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
211
|
+
id: "example",
|
|
212
|
+
server: "sandbox",
|
|
213
|
+
merchantAccountId: "default",
|
|
214
|
+
bearerAuth: withToken({
|
|
215
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
216
|
+
}),
|
|
224
217
|
});
|
|
225
218
|
|
|
226
219
|
async function run() {
|
|
@@ -238,18 +231,13 @@ The standalone function version of this method:
|
|
|
238
231
|
|
|
239
232
|
```typescript
|
|
240
233
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
241
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
242
234
|
import { paymentMethodsNetworkTokensSuspend } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensSuspend.js";
|
|
243
235
|
|
|
244
236
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
245
237
|
// You can create one instance of it to use across an application.
|
|
246
238
|
const gr4vy = new Gr4vyCore({
|
|
247
239
|
merchantAccountId: "<id>",
|
|
248
|
-
|
|
249
|
-
id: "example",
|
|
250
|
-
bearerAuth: withToken({
|
|
251
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
252
|
-
}),
|
|
240
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
253
241
|
});
|
|
254
242
|
|
|
255
243
|
async function run() {
|
|
@@ -306,15 +294,16 @@ Resume a suspended network token for a payment method.
|
|
|
306
294
|
|
|
307
295
|
<!-- UsageSnippet language="typescript" operationID="resume_payment_method_network_token" method="post" path="/payment-methods/{payment_method_id}/network-tokens/{network_token_id}/resume" -->
|
|
308
296
|
```typescript
|
|
309
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
297
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
298
|
+
import fs from "fs";
|
|
310
299
|
|
|
311
300
|
const gr4vy = new Gr4vy({
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
301
|
+
id: "example",
|
|
302
|
+
server: "sandbox",
|
|
303
|
+
merchantAccountId: "default",
|
|
304
|
+
bearerAuth: withToken({
|
|
305
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
306
|
+
}),
|
|
318
307
|
});
|
|
319
308
|
|
|
320
309
|
async function run() {
|
|
@@ -332,18 +321,13 @@ The standalone function version of this method:
|
|
|
332
321
|
|
|
333
322
|
```typescript
|
|
334
323
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
335
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
336
324
|
import { paymentMethodsNetworkTokensResume } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensResume.js";
|
|
337
325
|
|
|
338
326
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
339
327
|
// You can create one instance of it to use across an application.
|
|
340
328
|
const gr4vy = new Gr4vyCore({
|
|
341
329
|
merchantAccountId: "<id>",
|
|
342
|
-
|
|
343
|
-
id: "example",
|
|
344
|
-
bearerAuth: withToken({
|
|
345
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
346
|
-
}),
|
|
330
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
347
331
|
});
|
|
348
332
|
|
|
349
333
|
async function run() {
|
|
@@ -400,15 +384,16 @@ Delete a network token for a payment method.
|
|
|
400
384
|
|
|
401
385
|
<!-- UsageSnippet language="typescript" operationID="delete_payment_method_network_token" method="delete" path="/payment-methods/{payment_method_id}/network-tokens/{network_token_id}" -->
|
|
402
386
|
```typescript
|
|
403
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
387
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
388
|
+
import fs from "fs";
|
|
404
389
|
|
|
405
390
|
const gr4vy = new Gr4vy({
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
391
|
+
id: "example",
|
|
392
|
+
server: "sandbox",
|
|
393
|
+
merchantAccountId: "default",
|
|
394
|
+
bearerAuth: withToken({
|
|
395
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
396
|
+
}),
|
|
412
397
|
});
|
|
413
398
|
|
|
414
399
|
async function run() {
|
|
@@ -426,18 +411,13 @@ The standalone function version of this method:
|
|
|
426
411
|
|
|
427
412
|
```typescript
|
|
428
413
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
429
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
430
414
|
import { paymentMethodsNetworkTokensDelete } from "@gr4vy/sdk/funcs/paymentMethodsNetworkTokensDelete.js";
|
|
431
415
|
|
|
432
416
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
433
417
|
// You can create one instance of it to use across an application.
|
|
434
418
|
const gr4vy = new Gr4vyCore({
|
|
435
419
|
merchantAccountId: "<id>",
|
|
436
|
-
|
|
437
|
-
id: "example",
|
|
438
|
-
bearerAuth: withToken({
|
|
439
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
440
|
-
}),
|
|
420
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
441
421
|
});
|
|
442
422
|
|
|
443
423
|
async function run() {
|
|
@@ -18,15 +18,16 @@ Create a new payment link.
|
|
|
18
18
|
|
|
19
19
|
<!-- UsageSnippet language="typescript" operationID="add_payment_link" method="post" path="/payment-links" -->
|
|
20
20
|
```typescript
|
|
21
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
21
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
22
|
+
import fs from "fs";
|
|
22
23
|
|
|
23
24
|
const gr4vy = new Gr4vy({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
id: "example",
|
|
26
|
+
server: "sandbox",
|
|
27
|
+
merchantAccountId: "default",
|
|
28
|
+
bearerAuth: withToken({
|
|
29
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
30
|
+
}),
|
|
30
31
|
});
|
|
31
32
|
|
|
32
33
|
async function run() {
|
|
@@ -48,18 +49,13 @@ The standalone function version of this method:
|
|
|
48
49
|
|
|
49
50
|
```typescript
|
|
50
51
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
51
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
52
52
|
import { paymentLinksCreate } from "@gr4vy/sdk/funcs/paymentLinksCreate.js";
|
|
53
53
|
|
|
54
54
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
55
55
|
// You can create one instance of it to use across an application.
|
|
56
56
|
const gr4vy = new Gr4vyCore({
|
|
57
57
|
merchantAccountId: "<id>",
|
|
58
|
-
|
|
59
|
-
id: "example",
|
|
60
|
-
bearerAuth: withToken({
|
|
61
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
62
|
-
}),
|
|
58
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
63
59
|
});
|
|
64
60
|
|
|
65
61
|
async function run() {
|
|
@@ -119,15 +115,16 @@ List all created payment links.
|
|
|
119
115
|
|
|
120
116
|
<!-- UsageSnippet language="typescript" operationID="list_payment_links" method="get" path="/payment-links" -->
|
|
121
117
|
```typescript
|
|
122
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
118
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
119
|
+
import fs from "fs";
|
|
123
120
|
|
|
124
121
|
const gr4vy = new Gr4vy({
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
id: "example",
|
|
123
|
+
server: "sandbox",
|
|
124
|
+
merchantAccountId: "default",
|
|
125
|
+
bearerAuth: withToken({
|
|
126
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
127
|
+
}),
|
|
131
128
|
});
|
|
132
129
|
|
|
133
130
|
async function run() {
|
|
@@ -147,18 +144,13 @@ The standalone function version of this method:
|
|
|
147
144
|
|
|
148
145
|
```typescript
|
|
149
146
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
150
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
151
147
|
import { paymentLinksList } from "@gr4vy/sdk/funcs/paymentLinksList.js";
|
|
152
148
|
|
|
153
149
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
154
150
|
// You can create one instance of it to use across an application.
|
|
155
151
|
const gr4vy = new Gr4vyCore({
|
|
156
152
|
merchantAccountId: "<id>",
|
|
157
|
-
|
|
158
|
-
id: "example",
|
|
159
|
-
bearerAuth: withToken({
|
|
160
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
161
|
-
}),
|
|
153
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
162
154
|
});
|
|
163
155
|
|
|
164
156
|
async function run() {
|
|
@@ -218,15 +210,16 @@ Expire an existing payment link.
|
|
|
218
210
|
|
|
219
211
|
<!-- UsageSnippet language="typescript" operationID="expire_payment_link" method="post" path="/payment-links/{payment_link_id}/expire" -->
|
|
220
212
|
```typescript
|
|
221
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
213
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
214
|
+
import fs from "fs";
|
|
222
215
|
|
|
223
216
|
const gr4vy = new Gr4vy({
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
217
|
+
id: "example",
|
|
218
|
+
server: "sandbox",
|
|
219
|
+
merchantAccountId: "default",
|
|
220
|
+
bearerAuth: withToken({
|
|
221
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
222
|
+
}),
|
|
230
223
|
});
|
|
231
224
|
|
|
232
225
|
async function run() {
|
|
@@ -244,18 +237,13 @@ The standalone function version of this method:
|
|
|
244
237
|
|
|
245
238
|
```typescript
|
|
246
239
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
247
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
248
240
|
import { paymentLinksExpire } from "@gr4vy/sdk/funcs/paymentLinksExpire.js";
|
|
249
241
|
|
|
250
242
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
251
243
|
// You can create one instance of it to use across an application.
|
|
252
244
|
const gr4vy = new Gr4vyCore({
|
|
253
245
|
merchantAccountId: "<id>",
|
|
254
|
-
|
|
255
|
-
id: "example",
|
|
256
|
-
bearerAuth: withToken({
|
|
257
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
258
|
-
}),
|
|
246
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
259
247
|
});
|
|
260
248
|
|
|
261
249
|
async function run() {
|
|
@@ -311,15 +299,16 @@ Fetch the details for a payment link.
|
|
|
311
299
|
|
|
312
300
|
<!-- UsageSnippet language="typescript" operationID="get_payment_link" method="get" path="/payment-links/{payment_link_id}" -->
|
|
313
301
|
```typescript
|
|
314
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
302
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
303
|
+
import fs from "fs";
|
|
315
304
|
|
|
316
305
|
const gr4vy = new Gr4vy({
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
306
|
+
id: "example",
|
|
307
|
+
server: "sandbox",
|
|
308
|
+
merchantAccountId: "default",
|
|
309
|
+
bearerAuth: withToken({
|
|
310
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
311
|
+
}),
|
|
323
312
|
});
|
|
324
313
|
|
|
325
314
|
async function run() {
|
|
@@ -337,18 +326,13 @@ The standalone function version of this method:
|
|
|
337
326
|
|
|
338
327
|
```typescript
|
|
339
328
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
340
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
341
329
|
import { paymentLinksGet } from "@gr4vy/sdk/funcs/paymentLinksGet.js";
|
|
342
330
|
|
|
343
331
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
344
332
|
// You can create one instance of it to use across an application.
|
|
345
333
|
const gr4vy = new Gr4vyCore({
|
|
346
334
|
merchantAccountId: "<id>",
|
|
347
|
-
|
|
348
|
-
id: "example",
|
|
349
|
-
bearerAuth: withToken({
|
|
350
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
351
|
-
}),
|
|
335
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
352
336
|
});
|
|
353
337
|
|
|
354
338
|
async function run() {
|