Sudo Platform Virtual Cards client API

All methods should be expected to be able to throw the following errors defined in @sudoplatform/sudo-common:

Throws

NotSignedInError User not signed in. Sign in before performing the operation.

Throws

AccountLockedError Account has been locked. Contact support.

Throws

ServiceError Transient error at the service. Try the operation again

Hierarchy

  • DefaultSudoVirtualCardsClient

Implements

Constructors

Methods

  • Create key pair and secret key for use by the Virtual Cards Client if they have not already been created.

    The key pair is used to register a public key with the service for the encryption of virtual card and transaction details.

    The secret key is used for client side encryption of user specific card metadata.

    Returns Promise<CreateKeysIfAbsentResult>

  • Export the cryptographic keys to a key archive.

    Returns Promise<ArrayBuffer>

    Key archive data.

  • Get a virtual card.

    Parameters

    Returns Promise<undefined | VirtualCard>

    The card that is being queried, or undefined if not found.

  • Imports cryptographic keys from a key archive.

    Parameters

    • archiveData: ArrayBuffer

      Key archive data to import the keys from.

    Returns Promise<void>

  • Get a list of all created funding sources for the signed in user.

    Parameters

    Returns Promise<ListOutput<FundingSource>>

    An array of funding sources or an empty array if no matching funding sources can be found.

  • Removes any cached data maintained by this client.

    Returns Promise<void>

  • Request a review of an unfunded funding source, identified by id. Note that reviewing a funding source which is not unfunded will be a no-op but is not an error.

    Parameters

    • id: string

      The identifier of the funding source to review.

    Returns Promise<FundingSource>

    The funding source that was reviewed.

    Throws

    FundingSourceNotFoundError No funding source matching the specified ID could be found.

  • Sandbox API to obtain data normally returned by full Plaid Link flow. Useful for testing ahead of full Plaid Link integration during application development.

    Parameters

    Returns Promise<SandboxPlaidData>

    Sandbox Plaid data for provisioning new funding source at requested institution and user

  • Initiate provisioning of a new funding source.

    Parameters

    Returns Promise<ProvisionalFundingSource>

    The provisional funding source.

    Throws

    InsufficientEntitlementsError User has insufficient entitlements to setup a new funding source.

    Throws

    VelocityExceededError Configured maximum rate of attempts to add a funding source has been exceeded or too many failed attempts have recently been made. Wait before retrying.

  • Subscribe to changes to funding sources

    Parameters

    • id: string

      unique identifier to differentiate subscriptions; note that specifying a duplicate subscription id will replace the previous subscription.

    • subscriber: FundingSourceChangeSubscriber

      implementation of callback to be invoked when funding source change occurs

    Returns Promise<void>

  • Unsubscribe from changes to funding sources

    Parameters

    • id: string

      unique identifier to differentiate subscription

    Returns void

Generated using TypeDoc