Skip to content

Files

Latest commit

618e2d1 · Jun 4, 2025

History

History
480 lines (377 loc) · 42 KB

File metadata and controls

480 lines (377 loc) · 42 KB

DigitalWallets

(digitalWallets)

Overview

Available Operations

  • create - Register digital wallet
  • list - List digital wallets
  • get - Get digital wallet
  • delete - Delete digital wallet
  • update - Update digital wallet

create

Register a digital wallet like Apple Pay, Google Pay, or Click to Pay.

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DigitalWallet>

Errors

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

List configured digital wallets.

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DigitalWallets>

Errors

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 */*

get

Fetch the details a digital wallet.

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DigitalWallet>

Errors

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

Delete a configured digital wallet.

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<any>

Errors

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

Update a digital wallet.

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.DigitalWallet>

Errors

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 */*