@paysafe/paysafe-wallet-saas-web
    Preparing search index...

    Class CurrencyExchangeService

    Service class for managing currency exchange related operations.

    Hierarchy

    • ApiService
      • CurrencyExchangeService
    Index

    Methods

    • Requests an fxRate creation.

      Parameters

      Returns Promise<FxRate>

      A promise that resolves to the created fxRate.

      If the HTTP request fails.

      // Example usage:
      currencyExchangeService.createQuote(request)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error creating fxRate`);
      });
    • Retrieves an fxRate.

      Parameters

      • quoteId: string

        The id of the fxRate.

      Returns Promise<FxRate>

      A promise that resolves to the created fxRate.

      If the HTTP request fails.

      // Example usage:
      currencyExchangeService.getQuote(quoteId)
      .then((response) => {
      console.log(response);
      })
      .catch((error) => {
      console.error(`Error fetching fxRate`);
      });
    • Function

      Retrieves the singleton instance of the CurrencyExchangeService class.

      Returns CurrencyExchangeService

      The singleton instance of the CurrencyExchangeService class.

      // Usage:
      const currencyExchangeService = CurrencyExchangeService.getInstance();