Class SagePayUtil


  • public final class SagePayUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> buildCardAuthorisationPaymentResponse​(java.lang.Boolean authResult, java.lang.String authCode, java.lang.String authFlag, java.math.BigDecimal processAmount, java.lang.String authRefNum, java.lang.String authAltRefNum, java.lang.String authMessage)  
      static java.util.Map<java.lang.String,​java.lang.Object> buildCardCapturePaymentResponse​(java.lang.Boolean captureResult, java.lang.String captureCode, java.lang.String captureFlag, java.math.BigDecimal captureAmount, java.lang.String captureRefNum, java.lang.String captureAltRefNum, java.lang.String captureMessage)  
      static java.util.Map<java.lang.String,​java.lang.Object> buildCardRefundPaymentResponse​(java.lang.Boolean refundResult, java.lang.String refundCode, java.math.BigDecimal refundAmount, java.lang.String refundRefNum, java.lang.String refundAltRefNum, java.lang.String refundMessage)  
      static java.util.Map<java.lang.String,​java.lang.Object> buildCardReleasePaymentResponse​(java.lang.Boolean releaseResult, java.lang.String releaseCode, java.math.BigDecimal releaseAmount, java.lang.String releaseRefNum, java.lang.String releaseAltRefNum, java.lang.String releaseMessage)  
      static java.util.Map<java.lang.String,​java.lang.Object> buildCardVoidPaymentResponse​(java.lang.Boolean refundResult, java.math.BigDecimal refundAmount, java.lang.String refundRefNum, java.lang.String refundAltRefNum, java.lang.String refundMessage)  
      static org.apache.http.HttpHost getHost​(java.lang.String hostName, int port, java.lang.String scheme)  
      static org.apache.http.HttpHost getHost​(java.util.Map<java.lang.String,​java.lang.String> props)
      Builds HttpHost with the given SagePayProperties.
      static org.apache.http.impl.client.CloseableHttpClient getHttpClient()  
      static org.apache.http.client.methods.HttpPost getHttpPost​(java.lang.String uri, java.util.Map<java.lang.String,​java.lang.String> parameters)  
      static java.util.Map<java.lang.String,​java.lang.String> getResponseData​(org.apache.http.HttpResponse response)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Method Detail

      • buildCardAuthorisationPaymentResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> buildCardAuthorisationPaymentResponse​(java.lang.Boolean authResult,
                                                                                                                   java.lang.String authCode,
                                                                                                                   java.lang.String authFlag,
                                                                                                                   java.math.BigDecimal processAmount,
                                                                                                                   java.lang.String authRefNum,
                                                                                                                   java.lang.String authAltRefNum,
                                                                                                                   java.lang.String authMessage)
      • buildCardCapturePaymentResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> buildCardCapturePaymentResponse​(java.lang.Boolean captureResult,
                                                                                                             java.lang.String captureCode,
                                                                                                             java.lang.String captureFlag,
                                                                                                             java.math.BigDecimal captureAmount,
                                                                                                             java.lang.String captureRefNum,
                                                                                                             java.lang.String captureAltRefNum,
                                                                                                             java.lang.String captureMessage)
      • buildCardReleasePaymentResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> buildCardReleasePaymentResponse​(java.lang.Boolean releaseResult,
                                                                                                             java.lang.String releaseCode,
                                                                                                             java.math.BigDecimal releaseAmount,
                                                                                                             java.lang.String releaseRefNum,
                                                                                                             java.lang.String releaseAltRefNum,
                                                                                                             java.lang.String releaseMessage)
      • buildCardVoidPaymentResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> buildCardVoidPaymentResponse​(java.lang.Boolean refundResult,
                                                                                                          java.math.BigDecimal refundAmount,
                                                                                                          java.lang.String refundRefNum,
                                                                                                          java.lang.String refundAltRefNum,
                                                                                                          java.lang.String refundMessage)
      • buildCardRefundPaymentResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> buildCardRefundPaymentResponse​(java.lang.Boolean refundResult,
                                                                                                            java.lang.String refundCode,
                                                                                                            java.math.BigDecimal refundAmount,
                                                                                                            java.lang.String refundRefNum,
                                                                                                            java.lang.String refundAltRefNum,
                                                                                                            java.lang.String refundMessage)
      • getHost

        public static org.apache.http.HttpHost getHost​(java.util.Map<java.lang.String,​java.lang.String> props)
        Builds HttpHost with the given SagePayProperties.
        Parameters:
        props - SagePay properties
        Returns:
        Throws:
        java.lang.IllegalArgumentException - if neither productionHost nor testingHost found in properties.
      • getHost

        public static org.apache.http.HttpHost getHost​(java.lang.String hostName,
                                                       int port,
                                                       java.lang.String scheme)
      • getResponseData

        public static java.util.Map<java.lang.String,​java.lang.String> getResponseData​(org.apache.http.HttpResponse response)
                                                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • getHttpPost

        public static org.apache.http.client.methods.HttpPost getHttpPost​(java.lang.String uri,
                                                                          java.util.Map<java.lang.String,​java.lang.String> parameters)
                                                                   throws java.io.UnsupportedEncodingException
        Throws:
        java.io.UnsupportedEncodingException
      • getHttpClient

        public static org.apache.http.impl.client.CloseableHttpClient getHttpClient()