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

com.buyexpressly.api.ExpresslyFactory Maven / Gradle / Ivy

Go to download

Expressly Java SDK to integrate e-commerce platforms with the Expressly Network API

There is a newer version: 2.3.1
Show newest version
package com.buyexpressly.api;

import com.buyexpressly.api.providers.ExpresslyProviderImpl;
import com.buyexpressly.api.util.Builders;

public final class ExpresslyFactory {
    private static final String PROD_XLY_URL = "https://prod.expresslyapp.com/api";

    private final String expresslyApiKey;
    private final String expresslyEndpoint;
    private final MerchantServiceProvider merchantServiceProvider;

    private ExpresslyFactory(String expresslyApiKey, MerchantServiceProvider provider, String expresslyEndpoint) {
        this.expresslyApiKey = expresslyApiKey;
        this.merchantServiceProvider = provider;
        this.expresslyEndpoint = expresslyEndpoint;
    }

    public static ExpresslyFactory createFactory(String expresslyApiKey, MerchantServiceProvider provider) {
        return createFactory(expresslyApiKey, provider, PROD_XLY_URL);
    }

    public static ExpresslyFactory createFactory(String expresslyApiKey, MerchantServiceProvider provider, String expresslyEndpoint) {
        Builders.validateApiKey(expresslyApiKey);
        return new ExpresslyFactory(expresslyApiKey, provider, expresslyEndpoint);
    }

    public ExpresslyProvider buildExpresslyProvider() {
        return ExpresslyProviderImpl.create(expresslyEndpoint, expresslyApiKey);
    }

    public MerchantServiceRouter buildRouter() {
        return new MerchantServiceRouter(expresslyApiKey, merchantServiceProvider, buildExpresslyProvider());
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy