(digitalWallets)
- create - Register digital wallet
- list - List digital wallets
- get - Get digital wallet
- delete - Delete digital wallet
- update - Update digital wallet
Register a digital wallet like Apple Pay, Google Pay, or Click to Pay.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.digitalWallets.create({
provider: "click-to-pay",
merchantName: "<value>",
acceptTermsAndConditions: false,
});
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { digitalWalletsCreate } from "@gr4vy/sdk/funcs/digitalWalletsCreate.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await digitalWalletsCreate(gr4vy, {
provider: "click-to-pay",
merchantName: "<value>",
acceptTermsAndConditions: false,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("digitalWalletsCreate failed:", res.error);
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
digitalWalletCreate |
components.DigitalWalletCreate | ✔️ | N/A |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.DigitalWallet>
Error Type | Status Code | Content Type |
---|---|---|
errors.Error400 | 400 | application/json |
errors.Error401 | 401 | application/json |
errors.Error403 | 403 | application/json |
errors.Error404 | 404 | application/json |
errors.Error405 | 405 | application/json |
errors.Error409 | 409 | application/json |
errors.HTTPValidationError | 422 | application/json |
errors.Error425 | 425 | application/json |
errors.Error429 | 429 | application/json |
errors.Error500 | 500 | application/json |
errors.Error502 | 502 | application/json |
errors.Error504 | 504 | application/json |
errors.SDKError | 4XX, 5XX | */* |
List configured digital wallets.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.digitalWallets.list();
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { digitalWalletsList } from "@gr4vy/sdk/funcs/digitalWalletsList.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await digitalWalletsList(gr4vy);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("digitalWalletsList failed:", res.error);
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.DigitalWallets>
Error Type | Status Code | Content Type |
---|---|---|
errors.Error400 | 400 | application/json |
errors.Error401 | 401 | application/json |
errors.Error403 | 403 | application/json |
errors.Error404 | 404 | application/json |
errors.Error405 | 405 | application/json |
errors.Error409 | 409 | application/json |
errors.HTTPValidationError | 422 | application/json |
errors.Error425 | 425 | application/json |
errors.Error429 | 429 | application/json |
errors.Error500 | 500 | application/json |
errors.Error502 | 502 | application/json |
errors.Error504 | 504 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Fetch the details a digital wallet.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.digitalWallets.get("1808f5e6-b49c-4db9-94fa-22371ea352f5");
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { digitalWalletsGet } from "@gr4vy/sdk/funcs/digitalWalletsGet.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await digitalWalletsGet(gr4vy, "1808f5e6-b49c-4db9-94fa-22371ea352f5");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("digitalWalletsGet failed:", res.error);
}
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
digitalWalletId |
string | ✔️ | The ID of the digital wallet to read. | [object Object] |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | 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. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.DigitalWallet>
Error Type | Status Code | Content Type |
---|---|---|
errors.Error400 | 400 | application/json |
errors.Error401 | 401 | application/json |
errors.Error403 | 403 | application/json |
errors.Error404 | 404 | application/json |
errors.Error405 | 405 | application/json |
errors.Error409 | 409 | application/json |
errors.HTTPValidationError | 422 | application/json |
errors.Error425 | 425 | application/json |
errors.Error429 | 429 | application/json |
errors.Error500 | 500 | application/json |
errors.Error502 | 502 | application/json |
errors.Error504 | 504 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Delete a configured digital wallet.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.digitalWallets.delete("1808f5e6-b49c-4db9-94fa-22371ea352f5");
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { digitalWalletsDelete } from "@gr4vy/sdk/funcs/digitalWalletsDelete.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await digitalWalletsDelete(gr4vy, "1808f5e6-b49c-4db9-94fa-22371ea352f5");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("digitalWalletsDelete failed:", res.error);
}
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
digitalWalletId |
string | ✔️ | The ID of the digital wallet to delete. | [object Object] |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | 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. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<any>
Error Type | Status Code | Content Type |
---|---|---|
errors.Error400 | 400 | application/json |
errors.Error401 | 401 | application/json |
errors.Error403 | 403 | application/json |
errors.Error404 | 404 | application/json |
errors.Error405 | 405 | application/json |
errors.Error409 | 409 | application/json |
errors.HTTPValidationError | 422 | application/json |
errors.Error425 | 425 | application/json |
errors.Error429 | 429 | application/json |
errors.Error500 | 500 | application/json |
errors.Error502 | 502 | application/json |
errors.Error504 | 504 | application/json |
errors.SDKError | 4XX, 5XX | */* |
Update a digital wallet.
import { Gr4vy } from "@gr4vy/sdk";
const gr4vy = new Gr4vy({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const result = await gr4vy.digitalWallets.update({}, "1808f5e6-b49c-4db9-94fa-22371ea352f5");
console.log(result);
}
run();
The standalone function version of this method:
import { Gr4vyCore } from "@gr4vy/sdk/core.js";
import { withToken } from "@gr4vy/sdk/lib/auth.js";
import { digitalWalletsUpdate } from "@gr4vy/sdk/funcs/digitalWalletsUpdate.js";
// Use `Gr4vyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const gr4vy = new Gr4vyCore({
merchantAccountId: "<id>",
server: "sandbox",
id: "example",
bearerAuth: withToken({
privateKey: fs.readFileSync("private_key.pem", "utf8"),
}),
});
async function run() {
const res = await digitalWalletsUpdate(gr4vy, {}, "1808f5e6-b49c-4db9-94fa-22371ea352f5");
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("digitalWalletsUpdate failed:", res.error);
}
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
digitalWalletId |
string | ✔️ | The ID of the digital wallet to edit. | [object Object] |
digitalWalletUpdate |
components.DigitalWalletUpdate | ✔️ | N/A | |
merchantAccountId |
string | ➖ | The ID of the merchant account to use for this request. | |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. | |
options.fetchOptions |
RequestInit | ➖ | 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. |
|
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.DigitalWallet>
Error Type | Status Code | Content Type |
---|---|---|
errors.Error400 | 400 | application/json |
errors.Error401 | 401 | application/json |
errors.Error403 | 403 | application/json |
errors.Error404 | 404 | application/json |
errors.Error405 | 405 | application/json |
errors.Error409 | 409 | application/json |
errors.HTTPValidationError | 422 | application/json |
errors.Error425 | 425 | application/json |
errors.Error429 | 429 | application/json |
errors.Error500 | 500 | application/json |
errors.Error502 | 502 | application/json |
errors.Error504 | 504 | application/json |
errors.SDKError | 4XX, 5XX | */* |