@gr4vy/sdk 1.1.28 → 1.1.30
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 +9 -9
- package/README.md +91 -61
- 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/gr4vy/README.md +0 -83
- 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 +63 -91
- package/examples/accountUpdaterJobsCreate.example.ts +37 -0
- package/examples/package-lock.json +2716 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/operations/index.d.ts +0 -1
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +0 -1
- package/models/operations/index.js.map +1 -1
- package/package.json +1 -1
- package/sdk/sdk.d.ts +1 -5
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +0 -8
- package/sdk/sdk.js.map +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/operations/index.ts +0 -1
- package/src/sdk/sdk.ts +1 -17
- package/examples/browsePaymentMethodDefinitionsGet.example.ts +0 -27
- package/funcs/browsePaymentMethodDefinitionsGet.d.ts +0 -14
- package/funcs/browsePaymentMethodDefinitionsGet.d.ts.map +0 -1
- package/funcs/browsePaymentMethodDefinitionsGet.js +0 -130
- package/funcs/browsePaymentMethodDefinitionsGet.js.map +0 -1
- package/models/operations/browsepaymentmethoddefinitionsget.d.ts +0 -57
- package/models/operations/browsepaymentmethoddefinitionsget.d.ts.map +0 -1
- package/models/operations/browsepaymentmethoddefinitionsget.js +0 -96
- package/models/operations/browsepaymentmethoddefinitionsget.js.map +0 -1
- package/src/funcs/browsePaymentMethodDefinitionsGet.ts +0 -188
- package/src/models/operations/browsepaymentmethoddefinitionsget.ts +0 -149
|
@@ -5,86 +5,3 @@
|
|
|
5
5
|
Gr4vy: The Gr4vy API.
|
|
6
6
|
|
|
7
7
|
### Available Operations
|
|
8
|
-
|
|
9
|
-
* [browsePaymentMethodDefinitionsGet](#browsepaymentmethoddefinitionsget) - Browse
|
|
10
|
-
|
|
11
|
-
## browsePaymentMethodDefinitionsGet
|
|
12
|
-
|
|
13
|
-
Browse
|
|
14
|
-
|
|
15
|
-
### Example Usage
|
|
16
|
-
|
|
17
|
-
<!-- UsageSnippet language="typescript" operationID="browse_payment_method_definitions_get" method="get" path="/payment-method-definitions" -->
|
|
18
|
-
```typescript
|
|
19
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
20
|
-
|
|
21
|
-
const gr4vy = new Gr4vy({
|
|
22
|
-
merchantAccountId: "<id>",
|
|
23
|
-
server: "sandbox",
|
|
24
|
-
id: "example",
|
|
25
|
-
bearerAuth: withToken({
|
|
26
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
27
|
-
}),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
async function run() {
|
|
31
|
-
const result = await gr4vy.browsePaymentMethodDefinitionsGet();
|
|
32
|
-
|
|
33
|
-
console.log(result);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
run();
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### Standalone function
|
|
40
|
-
|
|
41
|
-
The standalone function version of this method:
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
45
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
46
|
-
import { browsePaymentMethodDefinitionsGet } from "@gr4vy/sdk/funcs/browsePaymentMethodDefinitionsGet.js";
|
|
47
|
-
|
|
48
|
-
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
49
|
-
// You can create one instance of it to use across an application.
|
|
50
|
-
const gr4vy = new Gr4vyCore({
|
|
51
|
-
merchantAccountId: "<id>",
|
|
52
|
-
server: "sandbox",
|
|
53
|
-
id: "example",
|
|
54
|
-
bearerAuth: withToken({
|
|
55
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
56
|
-
}),
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
async function run() {
|
|
60
|
-
const res = await browsePaymentMethodDefinitionsGet(gr4vy);
|
|
61
|
-
if (res.ok) {
|
|
62
|
-
const { value: result } = res;
|
|
63
|
-
console.log(result);
|
|
64
|
-
} else {
|
|
65
|
-
console.log("browsePaymentMethodDefinitionsGet failed:", res.error);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
run();
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Parameters
|
|
73
|
-
|
|
74
|
-
| Parameter | Type | Required | Description |
|
|
75
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
76
|
-
| `merchantAccountId` | *string* | :heavy_minus_sign: | The ID of the merchant account to use for this request. |
|
|
77
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
78
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
79
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
80
|
-
|
|
81
|
-
### Response
|
|
82
|
-
|
|
83
|
-
**Promise\<[any](../../models/.md)\>**
|
|
84
|
-
|
|
85
|
-
### Errors
|
|
86
|
-
|
|
87
|
-
| Error Type | Status Code | Content Type |
|
|
88
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
89
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
90
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
@@ -15,15 +15,16 @@ List all the stored gift cards for a specific buyer.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="list_buyer_gift_cards" method="get" path="/buyers/gift-cards" -->
|
|
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 { buyersGiftCardsList } from "@gr4vy/sdk/funcs/buyersGiftCardsList.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 the stored payment methods for a specific buyer.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="list_buyer_payment_methods" method="get" path="/buyers/payment-methods" -->
|
|
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 { buyersPaymentMethodsList } from "@gr4vy/sdk/funcs/buyersPaymentMethodsList.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,15 +17,16 @@ List refunds for a transaction.
|
|
|
17
17
|
|
|
18
18
|
<!-- UsageSnippet language="typescript" operationID="list_transaction_refunds" method="get" path="/transactions/{transaction_id}/refunds" -->
|
|
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 { transactionsRefundsList } from "@gr4vy/sdk/funcs/transactionsRefundsList.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() {
|
|
@@ -110,15 +106,16 @@ Create a refund for a transaction.
|
|
|
110
106
|
|
|
111
107
|
<!-- UsageSnippet language="typescript" operationID="create_transaction_refund" method="post" path="/transactions/{transaction_id}/refunds" -->
|
|
112
108
|
```typescript
|
|
113
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
109
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
110
|
+
import fs from "fs";
|
|
114
111
|
|
|
115
112
|
const gr4vy = new Gr4vy({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
id: "example",
|
|
114
|
+
server: "sandbox",
|
|
115
|
+
merchantAccountId: "default",
|
|
116
|
+
bearerAuth: withToken({
|
|
117
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
118
|
+
}),
|
|
122
119
|
});
|
|
123
120
|
|
|
124
121
|
async function run() {
|
|
@@ -136,18 +133,13 @@ The standalone function version of this method:
|
|
|
136
133
|
|
|
137
134
|
```typescript
|
|
138
135
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
139
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
140
136
|
import { transactionsRefundsCreate } from "@gr4vy/sdk/funcs/transactionsRefundsCreate.js";
|
|
141
137
|
|
|
142
138
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
143
139
|
// You can create one instance of it to use across an application.
|
|
144
140
|
const gr4vy = new Gr4vyCore({
|
|
145
141
|
merchantAccountId: "<id>",
|
|
146
|
-
|
|
147
|
-
id: "example",
|
|
148
|
-
bearerAuth: withToken({
|
|
149
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
150
|
-
}),
|
|
142
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
151
143
|
});
|
|
152
144
|
|
|
153
145
|
async function run() {
|
|
@@ -204,15 +196,16 @@ Fetch refund for a transaction.
|
|
|
204
196
|
|
|
205
197
|
<!-- UsageSnippet language="typescript" operationID="get_transaction_refund" method="get" path="/transactions/{transaction_id}/refunds/{refund_id}" -->
|
|
206
198
|
```typescript
|
|
207
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
199
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
200
|
+
import fs from "fs";
|
|
208
201
|
|
|
209
202
|
const gr4vy = new Gr4vy({
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
203
|
+
id: "example",
|
|
204
|
+
server: "sandbox",
|
|
205
|
+
merchantAccountId: "default",
|
|
206
|
+
bearerAuth: withToken({
|
|
207
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
208
|
+
}),
|
|
216
209
|
});
|
|
217
210
|
|
|
218
211
|
async function run() {
|
|
@@ -230,18 +223,13 @@ The standalone function version of this method:
|
|
|
230
223
|
|
|
231
224
|
```typescript
|
|
232
225
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
233
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
234
226
|
import { transactionsRefundsGet } from "@gr4vy/sdk/funcs/transactionsRefundsGet.js";
|
|
235
227
|
|
|
236
228
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
237
229
|
// You can create one instance of it to use across an application.
|
|
238
230
|
const gr4vy = new Gr4vyCore({
|
|
239
231
|
merchantAccountId: "<id>",
|
|
240
|
-
|
|
241
|
-
id: "example",
|
|
242
|
-
bearerAuth: withToken({
|
|
243
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
244
|
-
}),
|
|
232
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
245
233
|
});
|
|
246
234
|
|
|
247
235
|
async function run() {
|
package/docs/sdks/jobs/README.md
CHANGED
|
@@ -15,15 +15,16 @@ Schedule one or more stored cards for an account update.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="create_account_updater_job" method="post" path="/account-updater/jobs" -->
|
|
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() {
|
|
@@ -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 { accountUpdaterJobsCreate } from "@gr4vy/sdk/funcs/accountUpdaterJobsCreate.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() {
|
|
@@ -18,14 +18,16 @@ List all merchant accounts in an instance.
|
|
|
18
18
|
|
|
19
19
|
<!-- UsageSnippet language="typescript" operationID="list_merchant_accounts" method="get" path="/merchant-accounts" -->
|
|
20
20
|
```typescript
|
|
21
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
21
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
22
|
+
import fs from "fs";
|
|
22
23
|
|
|
23
24
|
const gr4vy = new Gr4vy({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
id: "example",
|
|
26
|
+
server: "sandbox",
|
|
27
|
+
merchantAccountId: "default",
|
|
28
|
+
bearerAuth: withToken({
|
|
29
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
30
|
+
}),
|
|
29
31
|
});
|
|
30
32
|
|
|
31
33
|
async function run() {
|
|
@@ -45,17 +47,12 @@ The standalone function version of this method:
|
|
|
45
47
|
|
|
46
48
|
```typescript
|
|
47
49
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
48
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
49
50
|
import { merchantAccountsList } from "@gr4vy/sdk/funcs/merchantAccountsList.js";
|
|
50
51
|
|
|
51
52
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
52
53
|
// You can create one instance of it to use across an application.
|
|
53
54
|
const gr4vy = new Gr4vyCore({
|
|
54
|
-
|
|
55
|
-
id: "example",
|
|
56
|
-
bearerAuth: withToken({
|
|
57
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
58
|
-
}),
|
|
55
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
59
56
|
});
|
|
60
57
|
|
|
61
58
|
async function run() {
|
|
@@ -114,14 +111,16 @@ Create a new merchant account in an instance.
|
|
|
114
111
|
|
|
115
112
|
<!-- UsageSnippet language="typescript" operationID="create_merchant_account" method="post" path="/merchant-accounts" -->
|
|
116
113
|
```typescript
|
|
117
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
114
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
115
|
+
import fs from "fs";
|
|
118
116
|
|
|
119
117
|
const gr4vy = new Gr4vy({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
id: "example",
|
|
119
|
+
server: "sandbox",
|
|
120
|
+
merchantAccountId: "default",
|
|
121
|
+
bearerAuth: withToken({
|
|
122
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
123
|
+
}),
|
|
125
124
|
});
|
|
126
125
|
|
|
127
126
|
async function run() {
|
|
@@ -143,17 +142,12 @@ The standalone function version of this method:
|
|
|
143
142
|
|
|
144
143
|
```typescript
|
|
145
144
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
146
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
147
145
|
import { merchantAccountsCreate } from "@gr4vy/sdk/funcs/merchantAccountsCreate.js";
|
|
148
146
|
|
|
149
147
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
150
148
|
// You can create one instance of it to use across an application.
|
|
151
149
|
const gr4vy = new Gr4vyCore({
|
|
152
|
-
|
|
153
|
-
id: "example",
|
|
154
|
-
bearerAuth: withToken({
|
|
155
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
156
|
-
}),
|
|
150
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
157
151
|
});
|
|
158
152
|
|
|
159
153
|
async function run() {
|
|
@@ -212,14 +206,16 @@ Get info about a merchant account in an instance.
|
|
|
212
206
|
|
|
213
207
|
<!-- UsageSnippet language="typescript" operationID="get_merchant_account" method="get" path="/merchant-accounts/{merchant_account_id}" -->
|
|
214
208
|
```typescript
|
|
215
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
209
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
210
|
+
import fs from "fs";
|
|
216
211
|
|
|
217
212
|
const gr4vy = new Gr4vy({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
213
|
+
id: "example",
|
|
214
|
+
server: "sandbox",
|
|
215
|
+
merchantAccountId: "default",
|
|
216
|
+
bearerAuth: withToken({
|
|
217
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
218
|
+
}),
|
|
223
219
|
});
|
|
224
220
|
|
|
225
221
|
async function run() {
|
|
@@ -237,17 +233,12 @@ The standalone function version of this method:
|
|
|
237
233
|
|
|
238
234
|
```typescript
|
|
239
235
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
240
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
241
236
|
import { merchantAccountsGet } from "@gr4vy/sdk/funcs/merchantAccountsGet.js";
|
|
242
237
|
|
|
243
238
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
244
239
|
// You can create one instance of it to use across an application.
|
|
245
240
|
const gr4vy = new Gr4vyCore({
|
|
246
|
-
|
|
247
|
-
id: "example",
|
|
248
|
-
bearerAuth: withToken({
|
|
249
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
250
|
-
}),
|
|
241
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
251
242
|
});
|
|
252
243
|
|
|
253
244
|
async function run() {
|
|
@@ -302,14 +293,16 @@ Update info for a merchant account in an instance.
|
|
|
302
293
|
|
|
303
294
|
<!-- UsageSnippet language="typescript" operationID="update_merchant_account" method="put" path="/merchant-accounts/{merchant_account_id}" -->
|
|
304
295
|
```typescript
|
|
305
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
296
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
297
|
+
import fs from "fs";
|
|
306
298
|
|
|
307
299
|
const gr4vy = new Gr4vy({
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
300
|
+
id: "example",
|
|
301
|
+
server: "sandbox",
|
|
302
|
+
merchantAccountId: "default",
|
|
303
|
+
bearerAuth: withToken({
|
|
304
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
305
|
+
}),
|
|
313
306
|
});
|
|
314
307
|
|
|
315
308
|
async function run() {
|
|
@@ -329,17 +322,12 @@ The standalone function version of this method:
|
|
|
329
322
|
|
|
330
323
|
```typescript
|
|
331
324
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
332
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
333
325
|
import { merchantAccountsUpdate } from "@gr4vy/sdk/funcs/merchantAccountsUpdate.js";
|
|
334
326
|
|
|
335
327
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
336
328
|
// You can create one instance of it to use across an application.
|
|
337
329
|
const gr4vy = new Gr4vyCore({
|
|
338
|
-
|
|
339
|
-
id: "example",
|
|
340
|
-
bearerAuth: withToken({
|
|
341
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
342
|
-
}),
|
|
330
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
343
331
|
});
|
|
344
332
|
|
|
345
333
|
async function run() {
|