@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
|
@@ -17,15 +17,16 @@ List all gateway tokens stored for a payment method.
|
|
|
17
17
|
|
|
18
18
|
<!-- UsageSnippet language="typescript" operationID="list_payment_method_payment_service_tokens" method="get" path="/payment-methods/{payment_method_id}/payment-service-tokens" -->
|
|
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
|
-
|
|
28
|
-
|
|
24
|
+
id: "example",
|
|
25
|
+
server: "sandbox",
|
|
26
|
+
merchantAccountId: "default",
|
|
27
|
+
bearerAuth: withToken({
|
|
28
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
29
|
+
}),
|
|
29
30
|
});
|
|
30
31
|
|
|
31
32
|
async function run() {
|
|
@@ -43,18 +44,13 @@ The standalone function version of this method:
|
|
|
43
44
|
|
|
44
45
|
```typescript
|
|
45
46
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
46
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
47
47
|
import { paymentMethodsPaymentServiceTokensList } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensList.js";
|
|
48
48
|
|
|
49
49
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
50
50
|
// You can create one instance of it to use across an application.
|
|
51
51
|
const gr4vy = new Gr4vyCore({
|
|
52
52
|
merchantAccountId: "<id>",
|
|
53
|
-
|
|
54
|
-
id: "example",
|
|
55
|
-
bearerAuth: withToken({
|
|
56
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
57
|
-
}),
|
|
53
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
58
54
|
});
|
|
59
55
|
|
|
60
56
|
async function run() {
|
|
@@ -111,15 +107,16 @@ Create a gateway tokens for a payment method.
|
|
|
111
107
|
|
|
112
108
|
<!-- UsageSnippet language="typescript" operationID="create_payment_method_payment_service_token" method="post" path="/payment-methods/{payment_method_id}/payment-service-tokens" -->
|
|
113
109
|
```typescript
|
|
114
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
110
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
111
|
+
import fs from "fs";
|
|
115
112
|
|
|
116
113
|
const gr4vy = new Gr4vy({
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
id: "example",
|
|
115
|
+
server: "sandbox",
|
|
116
|
+
merchantAccountId: "default",
|
|
117
|
+
bearerAuth: withToken({
|
|
118
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
119
|
+
}),
|
|
123
120
|
});
|
|
124
121
|
|
|
125
122
|
async function run() {
|
|
@@ -140,18 +137,13 @@ The standalone function version of this method:
|
|
|
140
137
|
|
|
141
138
|
```typescript
|
|
142
139
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
143
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
144
140
|
import { paymentMethodsPaymentServiceTokensCreate } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensCreate.js";
|
|
145
141
|
|
|
146
142
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
147
143
|
// You can create one instance of it to use across an application.
|
|
148
144
|
const gr4vy = new Gr4vyCore({
|
|
149
145
|
merchantAccountId: "<id>",
|
|
150
|
-
|
|
151
|
-
id: "example",
|
|
152
|
-
bearerAuth: withToken({
|
|
153
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
154
|
-
}),
|
|
146
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
155
147
|
});
|
|
156
148
|
|
|
157
149
|
async function run() {
|
|
@@ -211,15 +203,16 @@ Delete a gateway tokens for a payment method.
|
|
|
211
203
|
|
|
212
204
|
<!-- UsageSnippet language="typescript" operationID="delete_payment_method_payment_service_token" method="delete" path="/payment-methods/{payment_method_id}/payment-service-tokens/{payment_service_token_id}" -->
|
|
213
205
|
```typescript
|
|
214
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
206
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
207
|
+
import fs from "fs";
|
|
215
208
|
|
|
216
209
|
const gr4vy = new Gr4vy({
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
210
|
+
id: "example",
|
|
211
|
+
server: "sandbox",
|
|
212
|
+
merchantAccountId: "default",
|
|
213
|
+
bearerAuth: withToken({
|
|
214
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
215
|
+
}),
|
|
223
216
|
});
|
|
224
217
|
|
|
225
218
|
async function run() {
|
|
@@ -237,18 +230,13 @@ The standalone function version of this method:
|
|
|
237
230
|
|
|
238
231
|
```typescript
|
|
239
232
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
240
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
241
233
|
import { paymentMethodsPaymentServiceTokensDelete } from "@gr4vy/sdk/funcs/paymentMethodsPaymentServiceTokensDelete.js";
|
|
242
234
|
|
|
243
235
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
244
236
|
// You can create one instance of it to use across an application.
|
|
245
237
|
const gr4vy = new Gr4vyCore({
|
|
246
238
|
merchantAccountId: "<id>",
|
|
247
|
-
|
|
248
|
-
id: "example",
|
|
249
|
-
bearerAuth: withToken({
|
|
250
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
251
|
-
}),
|
|
239
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
252
240
|
});
|
|
253
241
|
|
|
254
242
|
async function run() {
|
|
@@ -17,15 +17,16 @@ Returns a list of payouts made.
|
|
|
17
17
|
|
|
18
18
|
<!-- UsageSnippet language="typescript" operationID="list_payouts" method="get" path="/payouts" -->
|
|
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
|
-
|
|
28
|
-
|
|
24
|
+
id: "example",
|
|
25
|
+
server: "sandbox",
|
|
26
|
+
merchantAccountId: "default",
|
|
27
|
+
bearerAuth: withToken({
|
|
28
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
29
|
+
}),
|
|
29
30
|
});
|
|
30
31
|
|
|
31
32
|
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 { payoutsList } from "@gr4vy/sdk/funcs/payoutsList.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() {
|
|
@@ -115,15 +111,16 @@ Creates a new payout.
|
|
|
115
111
|
|
|
116
112
|
<!-- UsageSnippet language="typescript" operationID="create_payout" method="post" path="/payouts" -->
|
|
117
113
|
```typescript
|
|
118
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
114
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
115
|
+
import fs from "fs";
|
|
119
116
|
|
|
120
117
|
const gr4vy = new Gr4vy({
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
id: "example",
|
|
119
|
+
server: "sandbox",
|
|
120
|
+
merchantAccountId: "default",
|
|
121
|
+
bearerAuth: withToken({
|
|
122
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
123
|
+
}),
|
|
127
124
|
});
|
|
128
125
|
|
|
129
126
|
async function run() {
|
|
@@ -149,18 +146,13 @@ The standalone function version of this method:
|
|
|
149
146
|
|
|
150
147
|
```typescript
|
|
151
148
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
152
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
153
149
|
import { payoutsCreate } from "@gr4vy/sdk/funcs/payoutsCreate.js";
|
|
154
150
|
|
|
155
151
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
156
152
|
// You can create one instance of it to use across an application.
|
|
157
153
|
const gr4vy = new Gr4vyCore({
|
|
158
154
|
merchantAccountId: "<id>",
|
|
159
|
-
|
|
160
|
-
id: "example",
|
|
161
|
-
bearerAuth: withToken({
|
|
162
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
163
|
-
}),
|
|
155
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
164
156
|
});
|
|
165
157
|
|
|
166
158
|
async function run() {
|
|
@@ -224,15 +216,16 @@ Retrieves a payout.
|
|
|
224
216
|
|
|
225
217
|
<!-- UsageSnippet language="typescript" operationID="get_payout" method="get" path="/payouts/{payout_id}" -->
|
|
226
218
|
```typescript
|
|
227
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
219
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
220
|
+
import fs from "fs";
|
|
228
221
|
|
|
229
222
|
const gr4vy = new Gr4vy({
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
223
|
+
id: "example",
|
|
224
|
+
server: "sandbox",
|
|
225
|
+
merchantAccountId: "default",
|
|
226
|
+
bearerAuth: withToken({
|
|
227
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
228
|
+
}),
|
|
236
229
|
});
|
|
237
230
|
|
|
238
231
|
async function run() {
|
|
@@ -250,18 +243,13 @@ The standalone function version of this method:
|
|
|
250
243
|
|
|
251
244
|
```typescript
|
|
252
245
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
253
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
254
246
|
import { payoutsGet } from "@gr4vy/sdk/funcs/payoutsGet.js";
|
|
255
247
|
|
|
256
248
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
257
249
|
// You can create one instance of it to use across an application.
|
|
258
250
|
const gr4vy = new Gr4vyCore({
|
|
259
251
|
merchantAccountId: "<id>",
|
|
260
|
-
|
|
261
|
-
id: "example",
|
|
262
|
-
bearerAuth: withToken({
|
|
263
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
264
|
-
}),
|
|
252
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
265
253
|
});
|
|
266
254
|
|
|
267
255
|
async function run() {
|
|
@@ -15,15 +15,16 @@ Fetch a refund.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="get_refund" method="get" path="/refunds/{refund_id}" -->
|
|
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 { refundsGet } from "@gr4vy/sdk/funcs/refundsGet.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() {
|
|
@@ -15,15 +15,16 @@ List all executed reports that have been generated.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="list_all_report_executions" method="get" path="/report-executions" -->
|
|
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() {
|
|
@@ -43,18 +44,13 @@ The standalone function version of this method:
|
|
|
43
44
|
|
|
44
45
|
```typescript
|
|
45
46
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
46
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
47
47
|
import { reportExecutionsList } from "@gr4vy/sdk/funcs/reportExecutionsList.js";
|
|
48
48
|
|
|
49
49
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
50
50
|
// You can create one instance of it to use across an application.
|
|
51
51
|
const gr4vy = new Gr4vyCore({
|
|
52
52
|
merchantAccountId: "<id>",
|
|
53
|
-
|
|
54
|
-
id: "example",
|
|
55
|
-
bearerAuth: withToken({
|
|
56
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
57
|
-
}),
|
|
53
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
58
54
|
});
|
|
59
55
|
|
|
60
56
|
async function run() {
|
|
@@ -18,15 +18,16 @@ List all configured reports that can be generated.
|
|
|
18
18
|
|
|
19
19
|
<!-- UsageSnippet language="typescript" operationID="list_reports" method="get" path="/reports" -->
|
|
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 { reportsList } from "@gr4vy/sdk/funcs/reportsList.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 @@ Create a new report.
|
|
|
114
110
|
|
|
115
111
|
<!-- UsageSnippet language="typescript" operationID="add_report" method="post" path="/reports" -->
|
|
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() {
|
|
@@ -156,18 +153,13 @@ The standalone function version of this method:
|
|
|
156
153
|
|
|
157
154
|
```typescript
|
|
158
155
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
159
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
160
156
|
import { reportsCreate } from "@gr4vy/sdk/funcs/reportsCreate.js";
|
|
161
157
|
|
|
162
158
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
163
159
|
// You can create one instance of it to use across an application.
|
|
164
160
|
const gr4vy = new Gr4vyCore({
|
|
165
161
|
merchantAccountId: "<id>",
|
|
166
|
-
|
|
167
|
-
id: "example",
|
|
168
|
-
bearerAuth: withToken({
|
|
169
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
170
|
-
}),
|
|
162
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
171
163
|
});
|
|
172
164
|
|
|
173
165
|
async function run() {
|
|
@@ -239,15 +231,16 @@ Fetches a report by its ID.
|
|
|
239
231
|
|
|
240
232
|
<!-- UsageSnippet language="typescript" operationID="get_report" method="get" path="/reports/{report_id}" -->
|
|
241
233
|
```typescript
|
|
242
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
234
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
235
|
+
import fs from "fs";
|
|
243
236
|
|
|
244
237
|
const gr4vy = new Gr4vy({
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
238
|
+
id: "example",
|
|
239
|
+
server: "sandbox",
|
|
240
|
+
merchantAccountId: "default",
|
|
241
|
+
bearerAuth: withToken({
|
|
242
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
243
|
+
}),
|
|
251
244
|
});
|
|
252
245
|
|
|
253
246
|
async function run() {
|
|
@@ -265,18 +258,13 @@ The standalone function version of this method:
|
|
|
265
258
|
|
|
266
259
|
```typescript
|
|
267
260
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
268
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
269
261
|
import { reportsGet } from "@gr4vy/sdk/funcs/reportsGet.js";
|
|
270
262
|
|
|
271
263
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
272
264
|
// You can create one instance of it to use across an application.
|
|
273
265
|
const gr4vy = new Gr4vyCore({
|
|
274
266
|
merchantAccountId: "<id>",
|
|
275
|
-
|
|
276
|
-
id: "example",
|
|
277
|
-
bearerAuth: withToken({
|
|
278
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
279
|
-
}),
|
|
267
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
280
268
|
});
|
|
281
269
|
|
|
282
270
|
async function run() {
|
|
@@ -332,15 +320,16 @@ Updates the configuration of a report.
|
|
|
332
320
|
|
|
333
321
|
<!-- UsageSnippet language="typescript" operationID="update_report" method="put" path="/reports/{report_id}" -->
|
|
334
322
|
```typescript
|
|
335
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
323
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
324
|
+
import fs from "fs";
|
|
336
325
|
|
|
337
326
|
const gr4vy = new Gr4vy({
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
327
|
+
id: "example",
|
|
328
|
+
server: "sandbox",
|
|
329
|
+
merchantAccountId: "default",
|
|
330
|
+
bearerAuth: withToken({
|
|
331
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
332
|
+
}),
|
|
344
333
|
});
|
|
345
334
|
|
|
346
335
|
async function run() {
|
|
@@ -358,18 +347,13 @@ The standalone function version of this method:
|
|
|
358
347
|
|
|
359
348
|
```typescript
|
|
360
349
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
361
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
362
350
|
import { reportsPut } from "@gr4vy/sdk/funcs/reportsPut.js";
|
|
363
351
|
|
|
364
352
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
365
353
|
// You can create one instance of it to use across an application.
|
|
366
354
|
const gr4vy = new Gr4vyCore({
|
|
367
355
|
merchantAccountId: "<id>",
|
|
368
|
-
|
|
369
|
-
id: "example",
|
|
370
|
-
bearerAuth: withToken({
|
|
371
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
372
|
-
}),
|
|
356
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
373
357
|
});
|
|
374
358
|
|
|
375
359
|
async function run() {
|
|
@@ -17,15 +17,16 @@ Create a session for use with Google Pay.
|
|
|
17
17
|
|
|
18
18
|
<!-- UsageSnippet language="typescript" operationID="create_google_pay_digital_wallet_session" method="post" path="/digital-wallets/google/session" -->
|
|
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
|
-
|
|
28
|
-
|
|
24
|
+
id: "example",
|
|
25
|
+
server: "sandbox",
|
|
26
|
+
merchantAccountId: "default",
|
|
27
|
+
bearerAuth: withToken({
|
|
28
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
29
|
+
}),
|
|
29
30
|
});
|
|
30
31
|
|
|
31
32
|
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 { digitalWalletsSessionsGooglePay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsGooglePay.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() {
|
|
@@ -114,15 +110,16 @@ Create a session for use with Apple Pay.
|
|
|
114
110
|
|
|
115
111
|
<!-- UsageSnippet language="typescript" operationID="create_apple_pay_digital_wallet_session" method="post" path="/digital-wallets/apple/session" -->
|
|
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 { digitalWalletsSessionsApplePay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsApplePay.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,14 +205,16 @@ Create a session for use with Click to Pay.
|
|
|
213
205
|
|
|
214
206
|
<!-- UsageSnippet language="typescript" operationID="create_click_to_pay_digital_wallet_session" method="post" path="/digital-wallets/click-to-pay/session" -->
|
|
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
|
-
|
|
212
|
+
id: "example",
|
|
213
|
+
server: "sandbox",
|
|
214
|
+
merchantAccountId: "default",
|
|
215
|
+
bearerAuth: withToken({
|
|
216
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
217
|
+
}),
|
|
224
218
|
});
|
|
225
219
|
|
|
226
220
|
async function run() {
|
|
@@ -240,17 +234,12 @@ The standalone function version of this method:
|
|
|
240
234
|
|
|
241
235
|
```typescript
|
|
242
236
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
243
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
244
237
|
import { digitalWalletsSessionsClickToPay } from "@gr4vy/sdk/funcs/digitalWalletsSessionsClickToPay.js";
|
|
245
238
|
|
|
246
239
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
247
240
|
// You can create one instance of it to use across an application.
|
|
248
241
|
const gr4vy = new Gr4vyCore({
|
|
249
|
-
|
|
250
|
-
id: "example",
|
|
251
|
-
bearerAuth: withToken({
|
|
252
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
253
|
-
}),
|
|
242
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
254
243
|
});
|
|
255
244
|
|
|
256
245
|
async function run() {
|