Options
All
  • Public
  • Public/Protected
  • All
Menu

Utility to centralize endpoints.

This simplifies building urls to contact services. If there is a need to add a call to a service on the server, it should be added here.

Hierarchy

  • Endpoints

Index

Properties

Static ACCESS_TOKEN_KEY

ACCESS_TOKEN_KEY: string = "axsTkn"

Static ACCESS_TOKEN_SUFFIX

ACCESS_TOKEN_SUFFIX: string = "?access_token={"+Endpoints.ACCESS_TOKEN_KEY+"}"

Static ACCOUNT_V3_KEY

ACCOUNT_V3_KEY: string = "acntId"

Static ACCOUNT_V3_PATH

ACCOUNT_V3_PATH: string = "v3/accounts/{"+Endpoints.ACCOUNT_V3_KEY+"}"

Static APPS_V3_KEY

APPS_V3_KEY: string = "appId"

Static APPS_V3_PATH

APPS_V3_PATH: string = "v3/apps/{"+Endpoints.APPS_V3_KEY+"}"

Static DEVELOPER_V3_KEY

DEVELOPER_V3_KEY: string = "dId"

Static DEVELOPER_V3_PATH

DEVELOPER_V3_PATH: string = "v3/developers/{"+Endpoints.DEVELOPER_V3_KEY+"}"

Static DEVICE_ID_KEY

DEVICE_ID_KEY: string = "devId"

Static DEVICE_ID_PATH

DEVICE_ID_PATH: string = Endpoints.DEVICE_PATH + "/{"+Endpoints.DEVICE_ID_KEY+"}"

Static DEVICE_PATH

DEVICE_PATH: string = Endpoints.MERCHANT_V3_PATH + "/devices"

Static DOMAIN_KEY

DOMAIN_KEY: string = "server_url"

Static DOMAIN_PATH

DOMAIN_PATH: string = "{server_url}"

Static LINE_ITEM_ID_KEY

LINE_ITEM_ID_KEY: string = "lniId"

Static LINE_ITEM_ID_PATH

LINE_ITEM_ID_PATH: string = Endpoints.LINE_ITEM_PATH + "/{"+Endpoints.LINE_ITEM_ID_KEY+"}"

Static LINE_ITEM_PATH

LINE_ITEM_PATH: string = Endpoints.ORDER_ID_PATH + "/line_items"

Static MERCHANT_V2_KEY

MERCHANT_V2_KEY: string = "mId"

Static MERCHANT_V2_PATH

MERCHANT_V2_PATH: string = "v2/merchant/{"+Endpoints.MERCHANT_V2_KEY +"}"

Static MERCHANT_V3_KEY

MERCHANT_V3_KEY: string = "mId"

Static MERCHANT_V3_PATH

MERCHANT_V3_PATH: string = "v3/merchants/{"+Endpoints.MERCHANT_V3_KEY +"}"

Static OAUTH_CLIENT_ID_KEY

OAUTH_CLIENT_ID_KEY: string = "client_id"

Static OAUTH_CLIENT_ID_SUFFIX

OAUTH_CLIENT_ID_SUFFIX: string = "&client_id={"+Endpoints.OAUTH_CLIENT_ID_KEY+"}"

Static OAUTH_MERCHANT_ID_KEY

OAUTH_MERCHANT_ID_KEY: string = "merchant_id"

Static OAUTH_MERCHANT_ID_SUFFIX

OAUTH_MERCHANT_ID_SUFFIX: string = "&merchant_id={"+Endpoints.OAUTH_MERCHANT_ID_KEY+"}"

Static OAUTH_PATH

OAUTH_PATH: string = "/oauth/authorize?response_type=token"

Static OAUTH_REDIRECT_URI_KEY

OAUTH_REDIRECT_URI_KEY: string = "redirect_uri"

Static OAUTH_REDIRECT_URI_SUFFIX

OAUTH_REDIRECT_URI_SUFFIX: string = "&redirect_uri={"+Endpoints.OAUTH_REDIRECT_URI_KEY+"}"

Static ORDER_ID_KEY

ORDER_ID_KEY: string = "appId"

Static ORDER_ID_PATH

ORDER_ID_PATH: string = Endpoints.ORDER_PATH + "/{"+Endpoints.ORDER_ID_KEY+"}"

Static ORDER_PATH

ORDER_PATH: string = Endpoints.MERCHANT_V3_PATH + "/orders"

Static REMOTE_PAY_PATH

REMOTE_PAY_PATH: string = Endpoints.MERCHANT_V2_PATH + "/remote_pay"

Static RESELLER_V3_KEY

RESELLER_V3_KEY: string = "rId"

Static RESELLER_V3_PATH

RESELLER_V3_PATH: string = "v3/resellers/{"+Endpoints.RESELLER_V3_KEY+"}"

Static WEBSOCKET_FORCE_CONNECT_ID_KEY

WEBSOCKET_FORCE_CONNECT_ID_KEY: string = "wsForceConnect"

Static WEBSOCKET_FORCE_CONNECT_ID_SUFFIX

WEBSOCKET_FORCE_CONNECT_ID_SUFFIX: string = "&forceConnect={"+Endpoints.WEBSOCKET_FORCE_CONNECT_ID_KEY+"}"

Static WEBSOCKET_FRIENDLY_ID_KEY

WEBSOCKET_FRIENDLY_ID_KEY: string = "wsFriendlyId"

Static WEBSOCKET_FRIENDLY_ID_SUFFIX

WEBSOCKET_FRIENDLY_ID_SUFFIX: string = "&friendlyId={"+Endpoints.WEBSOCKET_FRIENDLY_ID_KEY+"}"

Static WEBSOCKET_PATH

WEBSOCKET_PATH: string = "/support/remote_pay/cs"

Static WEBSOCKET_TOKEN_KEY

WEBSOCKET_TOKEN_KEY: string = "wsTkn"

Static WEBSOCKET_TOKEN_SUFFIX

WEBSOCKET_TOKEN_SUFFIX: string = "?token={"+Endpoints.WEBSOCKET_TOKEN_KEY+"}"

Methods

Static Private escapeRegExp

  • escapeRegExp(stringToGoIntoTheRegex: string): string
  • Does simple escaping to facilitate string replacement in a url

    Parameters

    • stringToGoIntoTheRegex: string

      the unescaped regex

    Returns string

    • the escaped regex

Static getAlertDeviceEndpoint

  • getAlertDeviceEndpoint(domain: string, merchantId: string, accessToken: string): string
  • Builds the endpoint to send the message to the server to let the device know we want to talk to it.

    Parameters

    • domain: string
    • merchantId: string

      the id of the merchant to use when getting the merchant.

    • accessToken: string

      the OAuth token used when accessing the server

    Returns string

    endpoint - the url to use alert a device that we want to communicate with it

Static getDeviceWebSocketEndpoint

  • getDeviceWebSocketEndpoint(domain: string, wsToken: string, friendlyId: string, forceConnect: boolean): string
  • The endpoint used to connect to a websocket on the server that will proxy to a device. Used by remote-pay cloud connectors.

    Parameters

    • domain: string
    • wsToken: string

      the token used to contact the device.

    • friendlyId: string

      an id used to identify the POS.

    • forceConnect: boolean

      if true, then the attempt will overtake any existing connection

    Returns string

    The endpoint used to connect to a websocket on the server that will proxy to a device

Static getDevicesEndpoint

  • getDevicesEndpoint(domain: string, merchantId: string, accessToken: string): string
  • The endpoint used to obtain a list of devices

    Parameters

    • domain: string
    • merchantId: string

      the id of the merchant to use when getting the merchant.

    • accessToken: string

      the OAuth token used when accessing the server

    Returns string

Static getMerchantEndpoint

  • getMerchantEndpoint(domain: string, merchantId: string, accessToken: string): string
  • The endpoint used to obtain a merchant

    Parameters

    • domain: string
    • merchantId: string

      the id of the merchant to use when getting the merchant.

    • accessToken: string

      the OAuth token used when accessing the server

    Returns string

    endpoint - the url to use to retrieve the merchant

Static getOAuthURL

  • getOAuthURL(domain: string, clientId: string, merchantId?: string, redirectUri?: string): string

Static Private setVariables

  • setVariables(template: string, variableMap: any): string
  • Does variable replacement on a template

    Parameters

    • template: string

      a template string that will have tags replaced

    • variableMap: any

      a named map of tag to value for the replacement process

    Returns string

Generated using TypeDoc