The main entry point for communicating with the Worldline Connect Client API.

Hierarchy

  • Session

Constructors

Properties

defaultCryptoEngine?: CryptoEngine = webCryptoCryptoEngine

The default ctypto engine to use. By default this will be webCryptoCryptoEngine if available, or undefined otherwise.

Methods

  • Returns a helper for working with Apple Pay.
    Note that Apple Pay needs to be enabled in the device. Furthermore, the current payment context must contain the Apple Pay specific input. Otherwise, the returned promise will be rejected. This should not occur if this method is called with a product retrieved using the same payment context though.

    Parameters

    Returns Promise<ApplePayHelper>

    A promise containing a helper for working with Apple Pay.

    Throws

    If the given product does not have the correct ID, or is missing the Apple Pay (302) specific data.

  • Returns a helper for working with Google Pay.
    Note that Google Pay needs to be enabled in the device. Furthermore, the current payment context must contain the Google Pay specific input. Otherwise, the returned promise will be rejected. This should not occur if this method is called with a product retrieved using the same payment context though.

    Parameters

    Returns Promise<GooglePayHelper>

    A promise containing a helper for working with Google Pay.

    Throws

    If the given product does not have the correct ID, or is missing the Google Pay (320) specific data.

  • Retrieves the payment items available for the current payment context.
    Note that for Apple Pay and Google Pay to possibly be part of the result, these need to be enabled in the device. Furthermore, the current payment context must contain the necessary payment product specific inputs. Otherwise, both products will be filtered out if they are returned by the Worldline Connect Client API.

    Parameters

    • useGroups: boolean = true

      True to include payment product groups, or false to only include payment products.

    Returns Promise<BasicPaymentItems>

    A promise containing the available payment items.

  • Retrieves the payment productss available for the current payment context.
    Note that for Apple Pay and Google Pay to possibly be part of the result, these need to be enabled in the device. Furthermore, the current payment context must contain the necessary payment product specific inputs. Otherwise, both products will be filtered out if they are returned by the Worldline Connect Client API.

    Returns Promise<BasicPaymentProducts>

    A promise containing the available payment products.

  • Retrieves customer details for a payment product.

    Parameters

    • paymentProductId: number

      The ID of the payment product.

    • request: CustomerDetailsRequest

      The customer details request containing the country code and field values.

    Returns Promise<CustomerDetailsResult>

    A promise containing the customer detauls result.

  • Retrieves IIN details for a (partial) credit card number. There can be four possible outcomes:

    • status === "NOT_ENOUGH_DIGITS": the card number contains fewer than 6 digits.
    • status === "SUPPORTED": the card number is recognized and supported for the current payment context.
      The result will contain the payment product ID and if available the cobrands.
    • status === "NOT_ALLOWED": the card number is recognized but not supported for the current payment context.
      The result will contain the payment product ID and if available the cobrands.
    • status === "UKNOWN": the card number is not recognized.
      The result will not contain a payment product ID or any cobrands, but instead the error response returned by the Worldline Connect Client API.

    Parameters

    • partialCreditCardNumber: string

      The (partial) credit card number. Only its first 6 or 8 characters will be used.

    Returns Promise<IINDetailsResult>

    A promise containing the IIN details result.

    Throws

    If the given partial credit card number does not have at least 6 digits.

  • Retrieves a specific payment product using the current payment context.
    Note that for Apple Pay and Google Pay, these need to be enabled in the device. Furthermore, the current payment context must contain the necessary payment product specific inputs. Otherwise, the returned promise will be rejected.

    Parameters

    • paymentProductId: number

      The ID of the payment product.

    Returns Promise<PaymentProduct>

    A promise containing the payment product. It will be rejected if the payment product is not available for the current context.

  • Retrieves a session specific JavaScript snippet for device fingerprinting for a payment product.

    Parameters

    Returns Promise<DeviceFingerprintResult>

    A promise containing the device fingerprint result.

  • Retrieves the directory for a payment product.

    Parameters

    • paymentProductId: number

      The ID of the payment product.

    Returns Promise<Directory>

    A promise containing the directory for the payment product.

  • Retrieves the display hints for a specific payment product using the current payment context.
    This method can be used to retrieve the display hints for rendering cobrands as returned by getIINDetails. It will behave the same as calling getPaymentProduct and retrieving the display hints from the result, but may be more performant if the product has not been retrieved yet.

    Parameters

    • paymentProductId: number

      The ID of the payment product.

    Returns Promise<PaymentProductDisplayHints>

    A promise containing the payment product's display hints. It will be rejected if the payment product is not available for the current context.

  • Retrieves a specific payment product group using the current payment context.

    Parameters

    • paymentProductGroupId: string

      The ID of the payment product group.

    Returns Promise<PaymentProductGroup>

    A promise containing the payment product group. It will be rejected if the payment product group is not available for the current context.

  • Retrieves a session specific JavaScript snippet for device fingerprinting for a payment product group.

    Parameters

    • paymentProductGroupId: string

      The ID of the payment product group.

    • request: DeviceFingerprintRequest

      The device fingerprint request to use.

    Returns Promise<DeviceFingerprintResult>

    A promise containing the device fingerprint result.

  • Retrieves the networks for a payment product.

    Parameters

    • paymentProductId: number

      The ID of the payment product.

    Returns Promise<PaymentProductNetworks>

    A promise containing the networks for the payment product.

  • Retrieves the privacy policy for a specific or all payment products. This method will use the locale from the current payment context.

    Parameters

    • Optional paymentProductId: number

      The optional ID of a specific payment product.

    Returns Promise<PrivacyPolicyResult>

    A promise containing the privacy policy.

  • Retrieves the session specific public key.

    Returns Promise<PublicKey>

    A promise containing the session specific public key.

  • Polls a third party for the status of a payment.

    Parameters

    • paymentId: string

      The ID of the payment.

    Returns Promise<ThirdPartyStatus>

    A promise containing the third party status.

  • Sets the crypto engine to use.
    This method can be used to provide a crypto engine that's different from defaultCryptoEngine.

    Parameters

    • Optional cryptoEngine: CryptoEngine

      The crypto engine to set.

    Returns void

  • Sets a provided payment product or payment product group.
    This can be used for server-side rendering, where the server has already retrieved the payment item, to prevent unnecessarily retrieving it again. Note that the payment product or payment product group should have all necessary properties set, including fields.

    Parameters

    Returns void

  • Updates the current payment context.
    The given context can contain only those fields that need to be updated. Any other value will remain as-is. This makes it easy to overwrite only specific fields like the locale or amount.

    Parameters

    Returns void