Ejemplo n.º 1
0
 /**
  * Construct a PayeezyClientHelper specifying the configuration.
  * Properties that must be set are:
  * url
  * apikey
  * secret
  * token
  * proxyHost --> if behind a proxy
  * proxyPort --> proxy port, defaults to 80 if the proxyHost is provided, but no proxyPort set      *
  */
 public PayeezyClientHelper(NameValueCollection appSettings)
 {
     //jsonHelper = new JSONHelper();
     //if (appSettings == null || appSettings.isEmpty())
     //{
     //    throw new ApplicationRuntimeException("SDK Properties should be configured to use the Client. Please provide the required properties based on the type of transaction.");
     //}
     this.appSettings = appSettings;
     payeezyClient    = new PayeezyClient(appSettings);
 }
Ejemplo n.º 2
0
        //private JSONHelper jsonHelper;

        /**
         * Loads the Configuration properties from ~HOME/.payeez.properties
         * throws ApplicationRuntimeException if Configuration file is not found
         * @throws ApplicationRuntimeException
         */
        public PayeezyClientHelper()
        {
            //jsonHelper = new JSONHelper();
            try
            {
                //properties = new Properties();
                //properties.load(new FileInputStream(new PayeezyConfiguration().load()));
            }
            catch (FileNotFoundException e)
            {
                throw new ApplicationException("Configuration file not found." +
                                               " If you are not using the .payeezt.properties file," +
                                               //" please use the " + PayeezyClientHelper.class.getSimpleName() + "(Properties) constructor." +
                                               " If you are using .payeezy.properties, you can generate one using java -jar payeezy-sdk-for-java-x.xx.jar", e);
            } catch (IOException e) {
                throw new ApplicationException("Configuration file could not be loaded.  Check to see if the user running this has permission to access the file", e);
            }
            payeezyClient = new PayeezyClient(appSettings);
        }