package com.braintree.facade.impl;

import com.braintree.facade.BraintreeUrlResolutionFacade;
import de.hybris.platform.acceleratorservices.urlresolver.SiteBaseUrlResolutionService;
import de.hybris.platform.site.BaseSiteService;
import org.apache.commons.lang.StringUtils;

public class DefaultBraintreeUrlResolutionFacade implements BraintreeUrlResolutionFacade {
    private SiteBaseUrlResolutionService siteBaseUrlResolutionService;
    private BaseSiteService baseSiteService;

    @Override
    public String buildReturnUrl(String url) {
        return siteBaseUrlResolutionService.getWebsiteUrlForSite(baseSiteService.getCurrentBaseSite(), StringUtils.EMPTY, true, url);
    }

    public void setSiteBaseUrlResolutionService(SiteBaseUrlResolutionService siteBaseUrlResolutionService) {
        this.siteBaseUrlResolutionService = siteBaseUrlResolutionService;
    }

    public void setBaseSiteService(BaseSiteService baseSiteService) {
        this.baseSiteService = baseSiteService;
    }
}
