Skip to content

Latest commit

 

History

History
92 lines (68 loc) · 7.09 KB

File metadata and controls

92 lines (68 loc) · 7.09 KB

ExchangeSessions

Overview

Available Operations

  • get - Retrieve exchange session

get

Returns details of a previously created exchange session. Response varies by partner:

  • MX: _links.external-provider-session.href (redirect URL for verification).
  • Plaid: externalProviderSessionToken (token to initialize Plaid Link).
  • Checkout.com: externalProviderSessionData with id, payment_session_secret, and payment_session_token to initialize the Checkout.com Flow component for debit card capture (Push to Card).

Example Usage

import { Dwolla } from "dwolla";

const dwolla = new Dwolla({
  security: {
    clientID: process.env["DWOLLA_CLIENT_ID"] ?? "",
    clientSecret: process.env["DWOLLA_CLIENT_SECRET"] ?? "",
  },
});

async function run() {
  const result = await dwolla.exchangeSessions.get({
    id: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { DwollaCore } from "dwolla/core.js";
import { exchangeSessionsGet } from "dwolla/funcs/exchangeSessionsGet.js";

// Use `DwollaCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const dwolla = new DwollaCore({
  security: {
    clientID: process.env["DWOLLA_CLIENT_ID"] ?? "",
    clientSecret: process.env["DWOLLA_CLIENT_SECRET"] ?? "",
  },
});

async function run() {
  const res = await exchangeSessionsGet(dwolla, {
    id: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("exchangeSessionsGet failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.RetrieveCustomerExchangeSessionRequest ✔️ The request object to use for the 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<models.ExchangeSession>

Errors

Error Type Status Code Content Type
errors.RetrieveCustomerExchangeSessionForbiddenDwollaV1HalJSONError 403 application/vnd.dwolla.v1.hal+json
errors.RetrieveCustomerExchangeSessionNotFoundDwollaV1HalJSONError 404 application/vnd.dwolla.v1.hal+json
errors.APIError 4XX, 5XX */*