All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.univapay.sdk.builders.exchangerate.ExchangeRateBuilders Maven / Gradle / Ivy

There is a newer version: 0.2.35
Show newest version
package com.univapay.sdk.builders.exchangerate;

import com.univapay.sdk.builders.exchangerate.AbstractExchangeRateBuilders.AbstractConvertMoneyBuilder;
import com.univapay.sdk.models.common.MoneyLike;
import com.univapay.sdk.models.request.exchangerate.ExchangeRateConversionReq;
import com.univapay.sdk.resources.ExchangeRatesResource;
import retrofit2.Call;
import retrofit2.Retrofit;

public abstract class ExchangeRateBuilders {

  public static class ConvertMoneyBuilder
      extends AbstractConvertMoneyBuilder {

    public ConvertMoneyBuilder(Retrofit retrofit, MoneyLike moneyToConvert, String targetCurrency) {
      super(retrofit, moneyToConvert, targetCurrency);
    }

    @Override
    protected Call getRequest(ExchangeRatesResource resource) {
      return resource.convert(
          new ExchangeRateConversionReq(moneyToConvert, targetCurrency), idempotencyKey);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy