
com.placetopay.java_placetopay.Contracts.Configuration Maven / Gradle / Ivy
/*
* The MIT License
*
* Copyright 2017 EGM Ingenieria sin fronteras S.A.S.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.placetopay.java_placetopay.Contracts;
import com.placetopay.java_placetopay.Carrier.Authentication;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author hernan_saldarriaga
*/
public class Configuration {
public static final int SOAP_1_1 = 1;
public static final int SOAP_1_2 = 2;
private String login;
private String tranKey;
private URL url;
private String type;
private Map additional;
private Authentication.Parameter authParameter;
//for SOAP
private String wsdl;
private String location;
private int soapVersion = SOAP_1_1;
public Configuration(String login, String tranKey, URL url, String type, Map additional, Authentication.Parameter authParameter) {
this.login = login;
this.tranKey = tranKey;
if (url.toString().endsWith("/"))
this.url = url;
else
try {
this.url = new URL(url.toString() + "/");
} catch (MalformedURLException ex) {
Logger.getLogger(Configuration.class.getName()).log(Level.SEVERE, null, ex);
}
this.type = type;
this.additional = additional;
this.authParameter = authParameter;
}
public String getWsdl() {
return wsdl;
}
public void setWsdl(String wsdl) {
this.wsdl = wsdl;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public int getSoapVersion() {
return soapVersion;
}
public void setSoapVersion(int soapVersion) {
this.soapVersion = soapVersion;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getTranKey() {
return tranKey;
}
public void setTranKey(String tranKey) {
this.tranKey = tranKey;
}
public URL getUrl() {
return url;
}
public void setUrl(URL url) {
this.url = url;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Map getAdditional() {
return additional;
}
public void setAdditional(Map additional) {
this.additional = additional;
}
public Authentication.Parameter getAuthParameter() {
return authParameter;
}
public void setAuthParameter(Authentication.Parameter authParameter) {
this.authParameter = authParameter;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy