Options
All
  • Public
  • Public/Protected
  • All
Menu

@jackdbd/stripe-utils

Utility functions that might be useful when working with Stripe.

Index

Functions

  • customerFromPaymentIntentId(__namedParameters: CustomerFromPaymentIntentIdConfig): Promise<{ error: Error; value: undefined } | { error: undefined; value: Customer }>
  • Finds all customers whose email appear more than once in the Stripe account.

    The search is restricted to the time interval [ts_md_begin, ts_md_end].

    Parameters

    Returns Promise<{ customers_by_email: {}; n_total: number; query: string }>

  • Emails that appear more than threshold times in the given Stripe account. The search is restricted to the time range starting from ts_start to ts_stop (both excluded, and both expressed in Unix timestamps in seconds).

    Parameters

    Returns Promise<EmailIds>

  • List of webhook events that the Stripe account stripe is allowed to send to the webhook endpoint url.

    Note: you have to configure the events that Stripe sends to a webhook endpoint when you create/update a webhook endpoint in your Stripe account.

    Parameters

    Returns Promise<string[]>

  • errorFromStripe(err: StripeError): { code: undefined | string; message: string; param: undefined | string; status_code: number }
  • isApiKeyLiveMode(s: string): boolean
  • Checks whether the given string is an API key for a Stripe account in live mode.

    Parameters

    • s: string

    Returns boolean

  • isApiKeyTestMode(s: string): boolean
  • Checks whether the given string is an API key for a Stripe account in test mode.

    Parameters

    • s: string

    Returns boolean

  • stripeAccountMode(api_key: string): "live" | "test"

Generated using TypeDoc