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