@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,15 +18,16 @@ List all stored payment method.
|
|
|
18
18
|
|
|
19
19
|
<!-- UsageSnippet language="typescript" operationID="list_payment_methods" method="get" path="/payment-methods" -->
|
|
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() {
|
|
@@ -46,18 +47,13 @@ The standalone function version of this method:
|
|
|
46
47
|
|
|
47
48
|
```typescript
|
|
48
49
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
49
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
50
50
|
import { paymentMethodsList } from "@gr4vy/sdk/funcs/paymentMethodsList.js";
|
|
51
51
|
|
|
52
52
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
53
53
|
// You can create one instance of it to use across an application.
|
|
54
54
|
const gr4vy = new Gr4vyCore({
|
|
55
55
|
merchantAccountId: "<id>",
|
|
56
|
-
|
|
57
|
-
id: "example",
|
|
58
|
-
bearerAuth: withToken({
|
|
59
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
60
|
-
}),
|
|
56
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
61
57
|
});
|
|
62
58
|
|
|
63
59
|
async function run() {
|
|
@@ -114,15 +110,16 @@ Store a new payment method.
|
|
|
114
110
|
|
|
115
111
|
<!-- UsageSnippet language="typescript" operationID="create_payment_method" method="post" path="/payment-methods" -->
|
|
116
112
|
```typescript
|
|
117
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
113
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
114
|
+
import fs from "fs";
|
|
118
115
|
|
|
119
116
|
const gr4vy = new Gr4vy({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
id: "example",
|
|
118
|
+
server: "sandbox",
|
|
119
|
+
merchantAccountId: "default",
|
|
120
|
+
bearerAuth: withToken({
|
|
121
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
122
|
+
}),
|
|
126
123
|
});
|
|
127
124
|
|
|
128
125
|
async function run() {
|
|
@@ -143,18 +140,13 @@ The standalone function version of this method:
|
|
|
143
140
|
|
|
144
141
|
```typescript
|
|
145
142
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
146
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
147
143
|
import { paymentMethodsCreate } from "@gr4vy/sdk/funcs/paymentMethodsCreate.js";
|
|
148
144
|
|
|
149
145
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
150
146
|
// You can create one instance of it to use across an application.
|
|
151
147
|
const gr4vy = new Gr4vyCore({
|
|
152
148
|
merchantAccountId: "<id>",
|
|
153
|
-
|
|
154
|
-
id: "example",
|
|
155
|
-
bearerAuth: withToken({
|
|
156
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
157
|
-
}),
|
|
149
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
158
150
|
});
|
|
159
151
|
|
|
160
152
|
async function run() {
|
|
@@ -213,15 +205,16 @@ Retrieve a payment method.
|
|
|
213
205
|
|
|
214
206
|
<!-- UsageSnippet language="typescript" operationID="get_payment_method" method="get" path="/payment-methods/{payment_method_id}" -->
|
|
215
207
|
```typescript
|
|
216
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
208
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
209
|
+
import fs from "fs";
|
|
217
210
|
|
|
218
211
|
const gr4vy = new Gr4vy({
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
212
|
+
id: "example",
|
|
213
|
+
server: "sandbox",
|
|
214
|
+
merchantAccountId: "default",
|
|
215
|
+
bearerAuth: withToken({
|
|
216
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
217
|
+
}),
|
|
225
218
|
});
|
|
226
219
|
|
|
227
220
|
async function run() {
|
|
@@ -239,18 +232,13 @@ The standalone function version of this method:
|
|
|
239
232
|
|
|
240
233
|
```typescript
|
|
241
234
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
242
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
243
235
|
import { paymentMethodsGet } from "@gr4vy/sdk/funcs/paymentMethodsGet.js";
|
|
244
236
|
|
|
245
237
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
246
238
|
// You can create one instance of it to use across an application.
|
|
247
239
|
const gr4vy = new Gr4vyCore({
|
|
248
240
|
merchantAccountId: "<id>",
|
|
249
|
-
|
|
250
|
-
id: "example",
|
|
251
|
-
bearerAuth: withToken({
|
|
252
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
253
|
-
}),
|
|
241
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
254
242
|
});
|
|
255
243
|
|
|
256
244
|
async function run() {
|
|
@@ -306,15 +294,16 @@ Delete a payment method.
|
|
|
306
294
|
|
|
307
295
|
<!-- UsageSnippet language="typescript" operationID="delete_payment_method" method="delete" path="/payment-methods/{payment_method_id}" -->
|
|
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 { paymentMethodsDelete } from "@gr4vy/sdk/funcs/paymentMethodsDelete.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() {
|
|
@@ -15,15 +15,16 @@ List the payment options available at checkout. filtering by country, currency,
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="list_payment_options" method="post" path="/payment-options" -->
|
|
17
17
|
```typescript
|
|
18
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
18
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
19
|
+
import fs from "fs";
|
|
19
20
|
|
|
20
21
|
const gr4vy = new Gr4vy({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
id: "example",
|
|
23
|
+
server: "sandbox",
|
|
24
|
+
merchantAccountId: "default",
|
|
25
|
+
bearerAuth: withToken({
|
|
26
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
27
|
+
}),
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
async function run() {
|
|
@@ -41,18 +42,13 @@ The standalone function version of this method:
|
|
|
41
42
|
|
|
42
43
|
```typescript
|
|
43
44
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
44
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
45
45
|
import { paymentOptionsList } from "@gr4vy/sdk/funcs/paymentOptionsList.js";
|
|
46
46
|
|
|
47
47
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
48
48
|
// You can create one instance of it to use across an application.
|
|
49
49
|
const gr4vy = new Gr4vyCore({
|
|
50
50
|
merchantAccountId: "<id>",
|
|
51
|
-
|
|
52
|
-
id: "example",
|
|
53
|
-
bearerAuth: withToken({
|
|
54
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
55
|
-
}),
|
|
51
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
56
52
|
});
|
|
57
53
|
|
|
58
54
|
async function run() {
|
|
@@ -17,14 +17,16 @@ List the definitions of each payment service that can be configured.
|
|
|
17
17
|
|
|
18
18
|
<!-- UsageSnippet language="typescript" operationID="list_payment_service_definitions" method="get" path="/payment-service-definitions" -->
|
|
19
19
|
```typescript
|
|
20
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
20
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
21
|
+
import fs from "fs";
|
|
21
22
|
|
|
22
23
|
const gr4vy = new Gr4vy({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
id: "example",
|
|
25
|
+
server: "sandbox",
|
|
26
|
+
merchantAccountId: "default",
|
|
27
|
+
bearerAuth: withToken({
|
|
28
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
29
|
+
}),
|
|
28
30
|
});
|
|
29
31
|
|
|
30
32
|
async function run() {
|
|
@@ -44,17 +46,12 @@ The standalone function version of this method:
|
|
|
44
46
|
|
|
45
47
|
```typescript
|
|
46
48
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
47
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
48
49
|
import { paymentServiceDefinitionsList } from "@gr4vy/sdk/funcs/paymentServiceDefinitionsList.js";
|
|
49
50
|
|
|
50
51
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
51
52
|
// You can create one instance of it to use across an application.
|
|
52
53
|
const gr4vy = new Gr4vyCore({
|
|
53
|
-
|
|
54
|
-
id: "example",
|
|
55
|
-
bearerAuth: withToken({
|
|
56
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
57
|
-
}),
|
|
54
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
58
55
|
});
|
|
59
56
|
|
|
60
57
|
async function run() {
|
|
@@ -112,14 +109,16 @@ Get the definition of a payment service that can be configured.
|
|
|
112
109
|
|
|
113
110
|
<!-- UsageSnippet language="typescript" operationID="get_payment_service_definition" method="get" path="/payment-service-definitions/{payment_service_definition_id}" -->
|
|
114
111
|
```typescript
|
|
115
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
112
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
113
|
+
import fs from "fs";
|
|
116
114
|
|
|
117
115
|
const gr4vy = new Gr4vy({
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
id: "example",
|
|
117
|
+
server: "sandbox",
|
|
118
|
+
merchantAccountId: "default",
|
|
119
|
+
bearerAuth: withToken({
|
|
120
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
121
|
+
}),
|
|
123
122
|
});
|
|
124
123
|
|
|
125
124
|
async function run() {
|
|
@@ -137,17 +136,12 @@ The standalone function version of this method:
|
|
|
137
136
|
|
|
138
137
|
```typescript
|
|
139
138
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
140
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
141
139
|
import { paymentServiceDefinitionsGet } from "@gr4vy/sdk/funcs/paymentServiceDefinitionsGet.js";
|
|
142
140
|
|
|
143
141
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
144
142
|
// You can create one instance of it to use across an application.
|
|
145
143
|
const gr4vy = new Gr4vyCore({
|
|
146
|
-
|
|
147
|
-
id: "example",
|
|
148
|
-
bearerAuth: withToken({
|
|
149
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
150
|
-
}),
|
|
144
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
151
145
|
});
|
|
152
146
|
|
|
153
147
|
async function run() {
|
|
@@ -202,14 +196,16 @@ Creates a session for a payment service that supports sessions.
|
|
|
202
196
|
|
|
203
197
|
<!-- UsageSnippet language="typescript" operationID="create_payment_service_definition_session" method="post" path="/payment-service-definitions/{payment_service_definition_id}/sessions" -->
|
|
204
198
|
```typescript
|
|
205
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
199
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
200
|
+
import fs from "fs";
|
|
206
201
|
|
|
207
202
|
const gr4vy = new Gr4vy({
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
203
|
+
id: "example",
|
|
204
|
+
server: "sandbox",
|
|
205
|
+
merchantAccountId: "default",
|
|
206
|
+
bearerAuth: withToken({
|
|
207
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
208
|
+
}),
|
|
213
209
|
});
|
|
214
210
|
|
|
215
211
|
async function run() {
|
|
@@ -229,17 +225,12 @@ The standalone function version of this method:
|
|
|
229
225
|
|
|
230
226
|
```typescript
|
|
231
227
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
232
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
233
228
|
import { paymentServiceDefinitionsSession } from "@gr4vy/sdk/funcs/paymentServiceDefinitionsSession.js";
|
|
234
229
|
|
|
235
230
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
236
231
|
// You can create one instance of it to use across an application.
|
|
237
232
|
const gr4vy = new Gr4vyCore({
|
|
238
|
-
|
|
239
|
-
id: "example",
|
|
240
|
-
bearerAuth: withToken({
|
|
241
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
242
|
-
}),
|
|
233
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
243
234
|
});
|
|
244
235
|
|
|
245
236
|
async function run() {
|
|
@@ -21,15 +21,16 @@ List the configured payment services.
|
|
|
21
21
|
|
|
22
22
|
<!-- UsageSnippet language="typescript" operationID="list_payment_services" method="get" path="/payment-services" -->
|
|
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 { paymentServicesList } from "@gr4vy/sdk/funcs/paymentServicesList.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 @@ Updates the configuration of a payment service.
|
|
|
117
113
|
|
|
118
114
|
<!-- UsageSnippet language="typescript" operationID="update_payment_service" method="post" path="/payment-services" -->
|
|
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() {
|
|
@@ -168,18 +165,13 @@ The standalone function version of this method:
|
|
|
168
165
|
|
|
169
166
|
```typescript
|
|
170
167
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
171
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
172
168
|
import { paymentServicesCreate } from "@gr4vy/sdk/funcs/paymentServicesCreate.js";
|
|
173
169
|
|
|
174
170
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
175
171
|
// You can create one instance of it to use across an application.
|
|
176
172
|
const gr4vy = new Gr4vyCore({
|
|
177
173
|
merchantAccountId: "<id>",
|
|
178
|
-
|
|
179
|
-
id: "example",
|
|
180
|
-
bearerAuth: withToken({
|
|
181
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
182
|
-
}),
|
|
174
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
183
175
|
});
|
|
184
176
|
|
|
185
177
|
async function run() {
|
|
@@ -260,15 +252,16 @@ Get the details of a configured payment service.
|
|
|
260
252
|
|
|
261
253
|
<!-- UsageSnippet language="typescript" operationID="get_payment_service" method="get" path="/payment-services/{payment_service_id}" -->
|
|
262
254
|
```typescript
|
|
263
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
255
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
256
|
+
import fs from "fs";
|
|
264
257
|
|
|
265
258
|
const gr4vy = new Gr4vy({
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
259
|
+
id: "example",
|
|
260
|
+
server: "sandbox",
|
|
261
|
+
merchantAccountId: "default",
|
|
262
|
+
bearerAuth: withToken({
|
|
263
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
264
|
+
}),
|
|
272
265
|
});
|
|
273
266
|
|
|
274
267
|
async function run() {
|
|
@@ -286,18 +279,13 @@ The standalone function version of this method:
|
|
|
286
279
|
|
|
287
280
|
```typescript
|
|
288
281
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
289
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
290
282
|
import { paymentServicesGet } from "@gr4vy/sdk/funcs/paymentServicesGet.js";
|
|
291
283
|
|
|
292
284
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
293
285
|
// You can create one instance of it to use across an application.
|
|
294
286
|
const gr4vy = new Gr4vyCore({
|
|
295
287
|
merchantAccountId: "<id>",
|
|
296
|
-
|
|
297
|
-
id: "example",
|
|
298
|
-
bearerAuth: withToken({
|
|
299
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
300
|
-
}),
|
|
288
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
301
289
|
});
|
|
302
290
|
|
|
303
291
|
async function run() {
|
|
@@ -353,15 +341,16 @@ Configures a new payment service for use by merchants.
|
|
|
353
341
|
|
|
354
342
|
<!-- UsageSnippet language="typescript" operationID="create_payment_service" method="put" path="/payment-services/{payment_service_id}" -->
|
|
355
343
|
```typescript
|
|
356
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
344
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
345
|
+
import fs from "fs";
|
|
357
346
|
|
|
358
347
|
const gr4vy = new Gr4vy({
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
348
|
+
id: "example",
|
|
349
|
+
server: "sandbox",
|
|
350
|
+
merchantAccountId: "default",
|
|
351
|
+
bearerAuth: withToken({
|
|
352
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
353
|
+
}),
|
|
365
354
|
});
|
|
366
355
|
|
|
367
356
|
async function run() {
|
|
@@ -381,18 +370,13 @@ The standalone function version of this method:
|
|
|
381
370
|
|
|
382
371
|
```typescript
|
|
383
372
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
384
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
385
373
|
import { paymentServicesUpdate } from "@gr4vy/sdk/funcs/paymentServicesUpdate.js";
|
|
386
374
|
|
|
387
375
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
388
376
|
// You can create one instance of it to use across an application.
|
|
389
377
|
const gr4vy = new Gr4vyCore({
|
|
390
378
|
merchantAccountId: "<id>",
|
|
391
|
-
|
|
392
|
-
id: "example",
|
|
393
|
-
bearerAuth: withToken({
|
|
394
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
395
|
-
}),
|
|
379
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
396
380
|
});
|
|
397
381
|
|
|
398
382
|
async function run() {
|
|
@@ -451,15 +435,16 @@ Deletes all the configuration of a payment service.
|
|
|
451
435
|
|
|
452
436
|
<!-- UsageSnippet language="typescript" operationID="delete_payment_service" method="delete" path="/payment-services/{payment_service_id}" -->
|
|
453
437
|
```typescript
|
|
454
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
438
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
439
|
+
import fs from "fs";
|
|
455
440
|
|
|
456
441
|
const gr4vy = new Gr4vy({
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
442
|
+
id: "example",
|
|
443
|
+
server: "sandbox",
|
|
444
|
+
merchantAccountId: "default",
|
|
445
|
+
bearerAuth: withToken({
|
|
446
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
447
|
+
}),
|
|
463
448
|
});
|
|
464
449
|
|
|
465
450
|
async function run() {
|
|
@@ -477,18 +462,13 @@ The standalone function version of this method:
|
|
|
477
462
|
|
|
478
463
|
```typescript
|
|
479
464
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
480
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
481
465
|
import { paymentServicesDelete } from "@gr4vy/sdk/funcs/paymentServicesDelete.js";
|
|
482
466
|
|
|
483
467
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
484
468
|
// You can create one instance of it to use across an application.
|
|
485
469
|
const gr4vy = new Gr4vyCore({
|
|
486
470
|
merchantAccountId: "<id>",
|
|
487
|
-
|
|
488
|
-
id: "example",
|
|
489
|
-
bearerAuth: withToken({
|
|
490
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
491
|
-
}),
|
|
471
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
492
472
|
});
|
|
493
473
|
|
|
494
474
|
async function run() {
|
|
@@ -544,15 +524,16 @@ Verify the credentials of a configured payment service
|
|
|
544
524
|
|
|
545
525
|
<!-- UsageSnippet language="typescript" operationID="verify_payment_service_credentials" method="post" path="/payment-services/verify" -->
|
|
546
526
|
```typescript
|
|
547
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
527
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
528
|
+
import fs from "fs";
|
|
548
529
|
|
|
549
530
|
const gr4vy = new Gr4vy({
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
531
|
+
id: "example",
|
|
532
|
+
server: "sandbox",
|
|
533
|
+
merchantAccountId: "default",
|
|
534
|
+
bearerAuth: withToken({
|
|
535
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
536
|
+
}),
|
|
556
537
|
});
|
|
557
538
|
|
|
558
539
|
async function run() {
|
|
@@ -573,18 +554,13 @@ The standalone function version of this method:
|
|
|
573
554
|
|
|
574
555
|
```typescript
|
|
575
556
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
576
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
577
557
|
import { paymentServicesVerify } from "@gr4vy/sdk/funcs/paymentServicesVerify.js";
|
|
578
558
|
|
|
579
559
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
580
560
|
// You can create one instance of it to use across an application.
|
|
581
561
|
const gr4vy = new Gr4vyCore({
|
|
582
562
|
merchantAccountId: "<id>",
|
|
583
|
-
|
|
584
|
-
id: "example",
|
|
585
|
-
bearerAuth: withToken({
|
|
586
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
587
|
-
}),
|
|
563
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
588
564
|
});
|
|
589
565
|
|
|
590
566
|
async function run() {
|
|
@@ -643,15 +619,16 @@ Creates a session for a payment service that supports sessions.
|
|
|
643
619
|
|
|
644
620
|
<!-- UsageSnippet language="typescript" operationID="create_payment_service_session" method="post" path="/payment-services/{payment_service_id}/sessions" -->
|
|
645
621
|
```typescript
|
|
646
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
622
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
623
|
+
import fs from "fs";
|
|
647
624
|
|
|
648
625
|
const gr4vy = new Gr4vy({
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
626
|
+
id: "example",
|
|
627
|
+
server: "sandbox",
|
|
628
|
+
merchantAccountId: "default",
|
|
629
|
+
bearerAuth: withToken({
|
|
630
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
631
|
+
}),
|
|
655
632
|
});
|
|
656
633
|
|
|
657
634
|
async function run() {
|
|
@@ -671,18 +648,13 @@ The standalone function version of this method:
|
|
|
671
648
|
|
|
672
649
|
```typescript
|
|
673
650
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
674
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
675
651
|
import { paymentServicesSession } from "@gr4vy/sdk/funcs/paymentServicesSession.js";
|
|
676
652
|
|
|
677
653
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
678
654
|
// You can create one instance of it to use across an application.
|
|
679
655
|
const gr4vy = new Gr4vyCore({
|
|
680
656
|
merchantAccountId: "<id>",
|
|
681
|
-
|
|
682
|
-
id: "example",
|
|
683
|
-
bearerAuth: withToken({
|
|
684
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
685
|
-
}),
|
|
657
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
686
658
|
});
|
|
687
659
|
|
|
688
660
|
async function run() {
|