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