Class VoucherifyProxy

java.lang.Object
org.bhn.promotion.voucherify.clients.VoucherifyProxy

@Component public class VoucherifyProxy extends Object
A proxy class for interacting with the Voucherify API. This class provides methods to download export data from the Voucherify service.
  • Constructor Details

    • VoucherifyProxy

      public VoucherifyProxy()
  • Method Details

    • downloadExport

      public String downloadExport(String exportId, String token)
      Downloads an export using the specified export ID and token. This method constructs a URI with the provided export ID and token, and then performs a GET request to retrieve the export data as a String.
      Parameters:
      exportId - the ID of the export to download
      token - the authorization token for the request
      Returns:
      a String representation of the downloaded export data
      Throws:
      IllegalArgumentException - if the exportId or token is null
      org.springframework.web.reactive.function.client.WebClientResponseException - if the response status code is not 2xx