@gr4vy/sdk 1.1.39 → 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 +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/models/components/settlement.d.ts +15 -15
- package/models/components/settlement.d.ts.map +1 -1
- package/models/components/settlement.js +2 -2
- package/models/components/settlement.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/settlement.ts +17 -17
package/FUNCTIONS.md
CHANGED
|
@@ -20,18 +20,13 @@ specific category of applications.
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
23
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
24
23
|
import { accountUpdaterJobsCreate } from "@gr4vy/sdk/funcs/accountUpdaterJobsCreate.js";
|
|
25
24
|
|
|
26
25
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
27
26
|
// You can create one instance of it to use across an application.
|
|
28
27
|
const gr4vy = new Gr4vyCore({
|
|
29
28
|
merchantAccountId: "<id>",
|
|
30
|
-
|
|
31
|
-
id: "example",
|
|
32
|
-
bearerAuth: withToken({
|
|
33
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
34
|
-
}),
|
|
29
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
35
30
|
});
|
|
36
31
|
|
|
37
32
|
async function run() {
|
package/README.md
CHANGED
|
@@ -451,13 +451,14 @@ try {
|
|
|
451
451
|
|
|
452
452
|
### Example
|
|
453
453
|
```typescript
|
|
454
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
454
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
455
455
|
import * as errors from "@gr4vy/sdk/models/errors";
|
|
456
|
+
import fs from "fs";
|
|
456
457
|
|
|
457
458
|
const gr4vy = new Gr4vy({
|
|
458
|
-
merchantAccountId: "<id>",
|
|
459
|
-
server: "sandbox",
|
|
460
459
|
id: "example",
|
|
460
|
+
server: "sandbox",
|
|
461
|
+
merchantAccountId: "default",
|
|
461
462
|
bearerAuth: withToken({
|
|
462
463
|
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
463
464
|
}),
|
|
@@ -554,14 +555,13 @@ If the selected server has variables, you may override its default values throug
|
|
|
554
555
|
#### Example
|
|
555
556
|
|
|
556
557
|
```typescript
|
|
557
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
558
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
559
|
+
import fs from "fs";
|
|
558
560
|
|
|
559
561
|
const gr4vy = new Gr4vy({
|
|
560
|
-
server: "production",
|
|
561
|
-
id: "<id>",
|
|
562
|
-
merchantAccountId: "<id>",
|
|
563
|
-
server: "sandbox",
|
|
564
562
|
id: "example",
|
|
563
|
+
server: "sandbox",
|
|
564
|
+
merchantAccountId: "default",
|
|
565
565
|
bearerAuth: withToken({
|
|
566
566
|
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
567
567
|
}),
|
|
@@ -586,13 +586,13 @@ run();
|
|
|
586
586
|
|
|
587
587
|
The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
|
|
588
588
|
```typescript
|
|
589
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
589
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
590
|
+
import fs from "fs";
|
|
590
591
|
|
|
591
592
|
const gr4vy = new Gr4vy({
|
|
592
|
-
serverURL: "https://api.sandbox.example.gr4vy.app",
|
|
593
|
-
merchantAccountId: "<id>",
|
|
594
|
-
server: "sandbox",
|
|
595
593
|
id: "example",
|
|
594
|
+
server: "sandbox",
|
|
595
|
+
merchantAccountId: "default",
|
|
596
596
|
bearerAuth: withToken({
|
|
597
597
|
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
598
598
|
}),
|
|
@@ -676,15 +676,16 @@ This SDK supports the following security scheme globally:
|
|
|
676
676
|
|
|
677
677
|
To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example:
|
|
678
678
|
```typescript
|
|
679
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
679
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
680
|
+
import fs from "fs";
|
|
680
681
|
|
|
681
682
|
const gr4vy = new Gr4vy({
|
|
682
|
-
server: "sandbox",
|
|
683
683
|
id: "example",
|
|
684
|
+
server: "sandbox",
|
|
685
|
+
merchantAccountId: "default",
|
|
684
686
|
bearerAuth: withToken({
|
|
685
687
|
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
686
688
|
}),
|
|
687
|
-
merchantAccountId: "<id>",
|
|
688
689
|
});
|
|
689
690
|
|
|
690
691
|
async function run() {
|
|
@@ -742,12 +743,13 @@ yarn add @gr4vy/sdk zod
|
|
|
742
743
|
### Example
|
|
743
744
|
|
|
744
745
|
```typescript
|
|
745
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
746
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
747
|
+
import fs from "fs";
|
|
746
748
|
|
|
747
749
|
const gr4vy = new Gr4vy({
|
|
748
|
-
merchantAccountId: "<id>",
|
|
749
|
-
server: "sandbox",
|
|
750
750
|
id: "example",
|
|
751
|
+
server: "sandbox",
|
|
752
|
+
merchantAccountId: "default",
|
|
751
753
|
bearerAuth: withToken({
|
|
752
754
|
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
753
755
|
}),
|
|
@@ -782,12 +784,13 @@ syntax.
|
|
|
782
784
|
Here's an example of one such pagination call:
|
|
783
785
|
|
|
784
786
|
```typescript
|
|
785
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
787
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
788
|
+
import fs from "fs";
|
|
786
789
|
|
|
787
790
|
const gr4vy = new Gr4vy({
|
|
788
|
-
merchantAccountId: "<id>",
|
|
789
|
-
server: "sandbox",
|
|
790
791
|
id: "example",
|
|
792
|
+
server: "sandbox",
|
|
793
|
+
merchantAccountId: "default",
|
|
791
794
|
bearerAuth: withToken({
|
|
792
795
|
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
793
796
|
}),
|
|
@@ -813,12 +816,13 @@ Some of the endpoints in this SDK support retries. If you use the SDK without a
|
|
|
813
816
|
|
|
814
817
|
To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
|
|
815
818
|
```typescript
|
|
816
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
819
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
820
|
+
import fs from "fs";
|
|
817
821
|
|
|
818
822
|
const gr4vy = new Gr4vy({
|
|
819
|
-
merchantAccountId: "<id>",
|
|
820
|
-
server: "sandbox",
|
|
821
823
|
id: "example",
|
|
824
|
+
server: "sandbox",
|
|
825
|
+
merchantAccountId: "default",
|
|
822
826
|
bearerAuth: withToken({
|
|
823
827
|
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
824
828
|
}),
|
|
@@ -852,22 +856,13 @@ run();
|
|
|
852
856
|
|
|
853
857
|
If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
|
|
854
858
|
```typescript
|
|
855
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
859
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
860
|
+
import fs from "fs";
|
|
856
861
|
|
|
857
862
|
const gr4vy = new Gr4vy({
|
|
858
|
-
retryConfig: {
|
|
859
|
-
strategy: "backoff",
|
|
860
|
-
backoff: {
|
|
861
|
-
initialInterval: 1,
|
|
862
|
-
maxInterval: 50,
|
|
863
|
-
exponent: 1.1,
|
|
864
|
-
maxElapsedTime: 100,
|
|
865
|
-
},
|
|
866
|
-
retryConnectionErrors: false,
|
|
867
|
-
},
|
|
868
|
-
merchantAccountId: "<id>",
|
|
869
|
-
server: "sandbox",
|
|
870
863
|
id: "example",
|
|
864
|
+
server: "sandbox",
|
|
865
|
+
merchantAccountId: "default",
|
|
871
866
|
bearerAuth: withToken({
|
|
872
867
|
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
873
868
|
}),
|
package/docs/sdks/all/README.md
CHANGED
|
@@ -15,15 +15,16 @@ Create a refund for all instruments on a transaction.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="create_full_transaction_refund" method="post" path="/transactions/{transaction_id}/refunds/all" -->
|
|
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 { transactionsRefundsAllCreate } from "@gr4vy/sdk/funcs/transactionsRefundsAllCreate.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 @@ Returns a list of activity by dashboard users.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="list_audit_logs" method="get" path="/audit-logs" -->
|
|
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 { auditLogsList } from "@gr4vy/sdk/funcs/auditLogsList.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() {
|
|
@@ -15,15 +15,16 @@ Fetch the balances for one or more gift cards.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="list_gift_card_balances" method="post" path="/gift-cards/balances" -->
|
|
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() {
|
|
@@ -54,18 +55,13 @@ The standalone function version of this method:
|
|
|
54
55
|
|
|
55
56
|
```typescript
|
|
56
57
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
57
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
58
58
|
import { giftCardsBalancesList } from "@gr4vy/sdk/funcs/giftCardsBalancesList.js";
|
|
59
59
|
|
|
60
60
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
61
61
|
// You can create one instance of it to use across an application.
|
|
62
62
|
const gr4vy = new Gr4vyCore({
|
|
63
63
|
merchantAccountId: "<id>",
|
|
64
|
-
|
|
65
|
-
id: "example",
|
|
66
|
-
bearerAuth: withToken({
|
|
67
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
68
|
-
}),
|
|
64
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
69
65
|
});
|
|
70
66
|
|
|
71
67
|
async function run() {
|
|
@@ -19,15 +19,16 @@ List all buyers or search for a specific buyer.
|
|
|
19
19
|
|
|
20
20
|
<!-- UsageSnippet language="typescript" operationID="list_buyers" method="get" path="/buyers" -->
|
|
21
21
|
```typescript
|
|
22
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
22
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
23
|
+
import fs from "fs";
|
|
23
24
|
|
|
24
25
|
const gr4vy = new Gr4vy({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
id: "example",
|
|
27
|
+
server: "sandbox",
|
|
28
|
+
merchantAccountId: "default",
|
|
29
|
+
bearerAuth: withToken({
|
|
30
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
31
|
+
}),
|
|
31
32
|
});
|
|
32
33
|
|
|
33
34
|
async function run() {
|
|
@@ -47,18 +48,13 @@ The standalone function version of this method:
|
|
|
47
48
|
|
|
48
49
|
```typescript
|
|
49
50
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
50
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
51
51
|
import { buyersList } from "@gr4vy/sdk/funcs/buyersList.js";
|
|
52
52
|
|
|
53
53
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
54
54
|
// You can create one instance of it to use across an application.
|
|
55
55
|
const gr4vy = new Gr4vyCore({
|
|
56
56
|
merchantAccountId: "<id>",
|
|
57
|
-
|
|
58
|
-
id: "example",
|
|
59
|
-
bearerAuth: withToken({
|
|
60
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
61
|
-
}),
|
|
57
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
62
58
|
});
|
|
63
59
|
|
|
64
60
|
async function run() {
|
|
@@ -115,15 +111,16 @@ Create a new buyer record.
|
|
|
115
111
|
|
|
116
112
|
<!-- UsageSnippet language="typescript" operationID="add_buyer" method="post" path="/buyers" -->
|
|
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() {
|
|
@@ -141,18 +138,13 @@ The standalone function version of this method:
|
|
|
141
138
|
|
|
142
139
|
```typescript
|
|
143
140
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
144
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
145
141
|
import { buyersCreate } from "@gr4vy/sdk/funcs/buyersCreate.js";
|
|
146
142
|
|
|
147
143
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
148
144
|
// You can create one instance of it to use across an application.
|
|
149
145
|
const gr4vy = new Gr4vyCore({
|
|
150
146
|
merchantAccountId: "<id>",
|
|
151
|
-
|
|
152
|
-
id: "example",
|
|
153
|
-
bearerAuth: withToken({
|
|
154
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
155
|
-
}),
|
|
147
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
156
148
|
});
|
|
157
149
|
|
|
158
150
|
async function run() {
|
|
@@ -208,15 +200,16 @@ Fetches a buyer by its ID.
|
|
|
208
200
|
|
|
209
201
|
<!-- UsageSnippet language="typescript" operationID="get_buyer" method="get" path="/buyers/{buyer_id}" -->
|
|
210
202
|
```typescript
|
|
211
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
203
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
204
|
+
import fs from "fs";
|
|
212
205
|
|
|
213
206
|
const gr4vy = new Gr4vy({
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
207
|
+
id: "example",
|
|
208
|
+
server: "sandbox",
|
|
209
|
+
merchantAccountId: "default",
|
|
210
|
+
bearerAuth: withToken({
|
|
211
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
212
|
+
}),
|
|
220
213
|
});
|
|
221
214
|
|
|
222
215
|
async function run() {
|
|
@@ -234,18 +227,13 @@ The standalone function version of this method:
|
|
|
234
227
|
|
|
235
228
|
```typescript
|
|
236
229
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
237
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
238
230
|
import { buyersGet } from "@gr4vy/sdk/funcs/buyersGet.js";
|
|
239
231
|
|
|
240
232
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
241
233
|
// You can create one instance of it to use across an application.
|
|
242
234
|
const gr4vy = new Gr4vyCore({
|
|
243
235
|
merchantAccountId: "<id>",
|
|
244
|
-
|
|
245
|
-
id: "example",
|
|
246
|
-
bearerAuth: withToken({
|
|
247
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
248
|
-
}),
|
|
236
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
249
237
|
});
|
|
250
238
|
|
|
251
239
|
async function run() {
|
|
@@ -301,15 +289,16 @@ Updates a buyer record.
|
|
|
301
289
|
|
|
302
290
|
<!-- UsageSnippet language="typescript" operationID="update_buyer" method="put" path="/buyers/{buyer_id}" -->
|
|
303
291
|
```typescript
|
|
304
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
292
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
293
|
+
import fs from "fs";
|
|
305
294
|
|
|
306
295
|
const gr4vy = new Gr4vy({
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
296
|
+
id: "example",
|
|
297
|
+
server: "sandbox",
|
|
298
|
+
merchantAccountId: "default",
|
|
299
|
+
bearerAuth: withToken({
|
|
300
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
301
|
+
}),
|
|
313
302
|
});
|
|
314
303
|
|
|
315
304
|
async function run() {
|
|
@@ -327,18 +316,13 @@ The standalone function version of this method:
|
|
|
327
316
|
|
|
328
317
|
```typescript
|
|
329
318
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
330
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
331
319
|
import { buyersUpdate } from "@gr4vy/sdk/funcs/buyersUpdate.js";
|
|
332
320
|
|
|
333
321
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
334
322
|
// You can create one instance of it to use across an application.
|
|
335
323
|
const gr4vy = new Gr4vyCore({
|
|
336
324
|
merchantAccountId: "<id>",
|
|
337
|
-
|
|
338
|
-
id: "example",
|
|
339
|
-
bearerAuth: withToken({
|
|
340
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
341
|
-
}),
|
|
325
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
342
326
|
});
|
|
343
327
|
|
|
344
328
|
async function run() {
|
|
@@ -395,15 +379,16 @@ Permanently removes a buyer record.
|
|
|
395
379
|
|
|
396
380
|
<!-- UsageSnippet language="typescript" operationID="delete_buyer" method="delete" path="/buyers/{buyer_id}" -->
|
|
397
381
|
```typescript
|
|
398
|
-
import { Gr4vy } from "@gr4vy/sdk";
|
|
382
|
+
import { Gr4vy, withToken } from "@gr4vy/sdk";
|
|
383
|
+
import fs from "fs";
|
|
399
384
|
|
|
400
385
|
const gr4vy = new Gr4vy({
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
386
|
+
id: "example",
|
|
387
|
+
server: "sandbox",
|
|
388
|
+
merchantAccountId: "default",
|
|
389
|
+
bearerAuth: withToken({
|
|
390
|
+
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
391
|
+
}),
|
|
407
392
|
});
|
|
408
393
|
|
|
409
394
|
async function run() {
|
|
@@ -421,18 +406,13 @@ The standalone function version of this method:
|
|
|
421
406
|
|
|
422
407
|
```typescript
|
|
423
408
|
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
|
|
424
|
-
import { withToken } from "@gr4vy/sdk/lib/auth.js";
|
|
425
409
|
import { buyersDelete } from "@gr4vy/sdk/funcs/buyersDelete.js";
|
|
426
410
|
|
|
427
411
|
// Use `Gr4vyCore` for best tree-shaking performance.
|
|
428
412
|
// You can create one instance of it to use across an application.
|
|
429
413
|
const gr4vy = new Gr4vyCore({
|
|
430
414
|
merchantAccountId: "<id>",
|
|
431
|
-
|
|
432
|
-
id: "example",
|
|
433
|
-
bearerAuth: withToken({
|
|
434
|
-
privateKey: fs.readFileSync("private_key.pem", "utf8"),
|
|
435
|
-
}),
|
|
415
|
+
bearerAuth: process.env["GR4VY_BEARER_AUTH"] ?? "",
|
|
436
416
|
});
|
|
437
417
|
|
|
438
418
|
async function run() {
|
|
@@ -15,15 +15,16 @@ Fetch a list of the definitions of each card scheme.
|
|
|
15
15
|
|
|
16
16
|
<!-- UsageSnippet language="typescript" operationID="list_card_scheme_definitions" method="get" path="/card-scheme-definitions" -->
|
|
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 { cardSchemeDefinitionsList } from "@gr4vy/sdk/funcs/cardSchemeDefinitionsList.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() {
|