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