Class IPGApiClient


  • public class IPGApiClient
    extends Object
    IPGApiClient represents the core class of the client package. Transaction or Action instances can be passed to the IPGApiClient#commitTransaction(IPGApiTransactionObject) operation or the IPGApiClient#commitAction(IPGApiActionObject) operation which builds a SOAP message and sends it to the First Data API Web Service.
    • Field Detail

      • client

        protected org.apache.http.impl.client.CloseableHttpClient client
    • Constructor Detail

      • IPGApiClient

        public IPGApiClient()
      • IPGApiClient

        public IPGApiClient​(String ipgApiUrl,
                            String storeId,
                            String password,
                            byte[] keyStore,
                            String keyStorePW)
                     throws IOException,
                            javax.xml.bind.JAXBException,
                            URISyntaxException
        creates an instance of the IPGApiClient taking all parameters which are necessary for communicating with the First Data API Web Service
        Parameters:
        ipgApiUrl - the URL of the First Data API Web Service
        storeId - your store ID
        password - your password
        keyStore - a byte array containing your key store
        keyStorePW - the password with which your key store can be accessed
        Throws:
        IOException
        javax.xml.bind.JAXBException
        URISyntaxException
        GeneralSecurityException
    • Method Detail

      • getURI

        public URI getURI()
      • setProxy

        public void setProxy​(String host,
                             Integer port,
                             String user,
                             String password,
                             String workstation,
                             String domain)
        Sets the proxy. If host or port is null no proxy will be set. If user or password is null no credentials (authorisation) will be set. If workstation and domain are not null a windows credentials will be set otherwise a normal credentials. This method has no effect without calling the method init().
        Parameters:
        host - name or ip of the proxy machine
        port - port of the proxy
        user - authorisated user
        password - of the authorisated user
        workstation - name or ip of the local machine
        domain - windows domain
      • commitTransaction

        public IPGApiResult commitTransaction​(IPGApiTransaction ipgApiTransaction)
                                       throws ServerException,
                                              ClientException,
                                              javax.xml.soap.SOAPException,
                                              org.apache.http.HttpException,
                                              MerchantException,
                                              ProcessingException,
                                              InternalException,
                                              IOException,
                                              javax.xml.bind.JAXBException
        commits a transaction on the First Data API by performing a Web Service call with the transaction data passed
        Parameters:
        ipgApiTransaction - the transaction to be committed
        Returns:
        the transaction result indicating that the transaction has been approved by the credit card processor
        Throws:
        ClientException - thrown when finding problems in processing the transaction data
        MerchantException - thrown in case the First Data API has registered your store as being closed
        ProcessingException - thrown in case the credit card processor has failed to process your transaction due to invalid transaction data - for details check the exception instance's attributes by calling the appropriate getter methods
        javax.xml.soap.SOAPException - thrown when finding problems in building/reading the SOAP request/response message
        IOException - thrown when finding internal problems in processing the request/response data
        ValidationError - thrown in case your transaction data is not valid according to the XML Schema defining the request/response XML structures
        ServerException - thrown when finding problems in processing the returned server response data
        org.apache.http.HttpException - thrown in case the server responds with an HTTP code other than 200 or 500
        InternalException - thrown in case of processing your transaction has resulted in an internal system error - note that you should never receive this exception, however, if so, please contact support
        javax.xml.bind.JAXBException
        TransformerException
      • commitTransaction

        public IPGApiResult commitTransaction​(IPGApiTransaction ipgApiTransaction,
                                              IPGApiMerchantDetailsObject ipgApiMerchantDetails)
                                       throws ServerException,
                                              ClientException,
                                              javax.xml.soap.SOAPException,
                                              org.apache.http.HttpException,
                                              MerchantException,
                                              ProcessingException,
                                              InternalException,
                                              IOException,
                                              javax.xml.bind.JAXBException
        commits a transaction on the First Data API by performing a Web Service call with the transaction data passed
        Parameters:
        ipgApiTransaction - the transaction to be committed
        ipgApiMerchantDetails - the merchant information to be committed
        Returns:
        the transaction result indicating that the transaction has been approved by the credit card processor
        Throws:
        ClientException - thrown when finding problems in processing the transaction data
        MerchantException - thrown in case the First Data API has registered your store as being closed
        ProcessingException - thrown in case the credit card processor has failed to process your transaction due to invalid transaction data - for details check the exception instance's attributes by calling the appropriate getter methods
        javax.xml.soap.SOAPException - thrown when finding problems in building/reading the SOAP request/response message
        IOException - thrown when finding internal problems in processing the request/response data
        ValidationError - thrown in case your transaction data is not valid according to the XML Schema defining the request/response XML structures
        ServerException - thrown when finding problems in processing the returned server response data
        org.apache.http.HttpException - thrown in case the server responds with an HTTP code other than 200 or 500
        InternalException - thrown in case of processing your transaction has resulted in an internal system error - note that you should never receive this exception, however, if so, please contact support
        javax.xml.bind.JAXBException
        TransformerException
      • commitAction

        public de.firstdata.ipg.api.schema.IPGApiActionResponse commitAction​(IPGApiAction ipgApiAction)
                                                                      throws MerchantException,
                                                                             ProcessingException,
                                                                             javax.xml.bind.JAXBException,
                                                                             javax.xml.soap.SOAPException,
                                                                             IOException,
                                                                             ServerException,
                                                                             org.apache.http.HttpException
        commits an action on the First Data API by performing a Web Service call with the action data passed
        Parameters:
        ipgApiAction - the action to be committed
        Returns:
        the action result indicating that the action has been approved
        Throws:
        ClientException - thrown when finding problems in processing the action data
        MerchantException - thrown in case the First Data API has registered your store as being closed
        ProcessingException - thrown in case the credit card processor has failed to process your action due to invalid transaction data - for details check the exception instance's attributes by calling the appropriate getter methods
        javax.xml.soap.SOAPException - thrown when finding problems in building/reading the SOAP request/response message
        IOException - thrown when finding internal problems in processing the request/response data
        ValidationError - thrown in case your action data is not valid according to the XML Schema defining the request/response XML structures
        ServerException - thrown when finding problems in processing the returned server response data
        org.apache.http.HttpException - thrown in case the server responds with an HTTP code other than 200 or 500
        InternalException - thrown in case of processing your action has resulted in an internal system error - note that you should never receive this exception, however, if so, please contact support
        javax.xml.bind.JAXBException
        org.apache.http.HttpException
        TransformerException
      • commitAction

        public de.firstdata.ipg.api.schema.IPGApiActionResponse commitAction​(IPGApiAction ipgApiAction,
                                                                             IPGApiMerchantDetailsObject merchantDetails)
                                                                      throws MerchantException,
                                                                             ProcessingException,
                                                                             javax.xml.bind.JAXBException,
                                                                             javax.xml.soap.SOAPException,
                                                                             IOException,
                                                                             ServerException,
                                                                             org.apache.http.HttpException
        commits an action on the First Data API by performing a Web Service call with the action data passed
        Parameters:
        ipgApiAction - the action to be committed
        ipgApiMerchantDetails - the merchant information to be committed
        Returns:
        the action result indicating that the action has been approved
        Throws:
        ClientException - thrown when finding problems in processing the action data
        MerchantException - thrown in case the First Data API has registered your store as being closed
        ProcessingException - thrown in case the credit card processor has failed to process your action due to invalid transaction data - for details check the exception instance's attributes by calling the appropriate getter methods
        javax.xml.soap.SOAPException - thrown when finding problems in building/reading the SOAP request/response message
        IOException - thrown when finding internal problems in processing the request/response data
        ValidationError - thrown in case your action data is not valid according to the XML Schema defining the request/response XML structures
        ServerException - thrown when finding problems in processing the returned server response data
        org.apache.http.HttpException - thrown in case the server responds with an HTTP code other than 200 or 500
        InternalException - thrown in case of processing your action has resulted in an internal system error - note that you should never receive this exception, however, if so, please contact support
        javax.xml.bind.JAXBException
        org.apache.http.HttpException
        TransformerException
      • setIpgApiUrl

        public void setIpgApiUrl​(String value)
        This method has no effect without calling the method init().
      • getIpgApiUrl

        public String getIpgApiUrl()
      • setKeyStore

        public void setKeyStore​(byte[] value)
        This method has no effect without calling the method init().
      • getKeyStore

        public byte[] getKeyStore()
      • setKeyStorePassword

        public void setKeyStorePassword​(String value)
        This method has no effect without calling the method init().
      • getKeyStorePassword

        public String getKeyStorePassword()
      • setMaxConnectionsPerRoute

        public void setMaxConnectionsPerRoute​(int value)
        This should be set to the numbers of terminal You have. We set this to 2. For detail information see the apache http client 4.0.3 doc. This method has no effect without calling the method init().
      • getMaxConnectionsPerRoute

        public int getMaxConnectionsPerRoute()
      • setPassword

        public void setPassword​(String value)
        The API store password. This method has no effect without calling the method init().
      • getPassword

        public String getPassword()
      • setSocketTimeout

        public void setSocketTimeout​(int value)
        This method sets the CoreConnectionPNames.SO_TIMEOUT. The apache http client waits this time after the message is sent to IPG. We set this to 60 seconds. You should not set this less than 60 seconds. For detail information see the apache http client 4.0.3 doc. This method has no effect without calling the method init().
      • getSocketTimeout

        public int getSocketTimeout()
      • setStoreID

        public void setStoreID​(String value)
        StoreID or technical user. If you use the technical user, than you must put the storeID into the transactions. This method has no effect without calling the method init().
      • getStoreID

        public String getStoreID()
      • setTrustStore

        public void setTrustStore​(byte[] value)
        This method has no effect without calling the method init().
      • getTrustStore

        public byte[] getTrustStore()
      • setTrustStorePassword

        public void setTrustStorePassword​(String value)
        This method has no effect without calling the method init().
      • getTrustStorePassword

        public String getTrustStorePassword()
      • setUserID

        public void setUserID​(String value)
        We set this to 1 This method has no effect without calling the method init().
      • getUserID

        public String getUserID()
      • setUserMidfix

        public void setUserMidfix​(String value)
        We set this to ._. This method has no effect without calling the method init().
      • getUserMidfix

        public String getUserMidfix()
      • setUserPrefix

        public void setUserPrefix​(String value)
        We set this to WS. This method has no effect without calling the method init().
      • getUserPrefix

        public String getUserPrefix()
      • setMaxTotalConnections

        public void setMaxTotalConnections​(int value)
        For detail information see the apache http client 4.0.3 doc. This method has no effect without calling the method init().
      • getMaxTotalConnections

        public int getMaxTotalConnections()
      • setConnectionPoolTimeout

        public void setConnectionPoolTimeout​(int value)
        This method sets the ConnManagerPNames.TIMEOUT. The apache http client waits this time for a connection in the connection pool. We set this to 15 seconds. For detail information see the apache http client 4.0.3 doc. This method has no effect without calling the method init().
      • getTimeout

        public int getTimeout()