Class PaymentGatewayServices


  • public class PaymentGatewayServices
    extends java.lang.Object
    PaymentGatewayServices
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> alwaysApproveProcessor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Always approve processor.
      static java.util.Map<java.lang.String,​java.lang.Object> alwaysApproveWithCapture​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> alwaysBadCardNumberProcessor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Always bad card number processor
      static java.util.Map<java.lang.String,​java.lang.Object> alwaysBadExpireProcessor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Always fail/bad expire date processor
      static java.util.Map<java.lang.String,​java.lang.Object> alwaysDeclineProcessor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Always decline processor
      static java.util.Map<java.lang.String,​java.lang.Object> alwaysFailProcessor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Always fail (error) processor
      static java.util.Map<java.lang.String,​java.lang.Object> alwaysNsfProcessor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Always NSF (not sufficient funds) processor
      static java.util.Map<java.lang.String,​java.lang.Object> authOrderPaymentPreference​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Authorizes a single order preference with an option to specify an amount.
      static java.util.Map<java.lang.String,​java.lang.Object> authOrderPayments​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Processes payments through service calls to the defined processing service for the ProductStore/PaymentMethodType
      static java.util.Map<java.lang.String,​java.lang.Object> badExpireEvenProcessor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Fail/bad expire date when year is even processor
      static java.util.Map<java.lang.String,​java.lang.Object> captureBillingAccountPayment​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> captureBillingAccountPayments​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> captureOrderPayments​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodType
      static java.util.Map<java.lang.String,​java.lang.Object> capturePaymentsByInvoice​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodType
      static boolean checkAuthValidity​(GenericValue orderPaymentPreference, java.lang.String paymentConfig)  
      static java.sql.Timestamp getAuthTime​(GenericValue orderPaymentPreference)  
      static GenericValue getAuthTransaction​(GenericValue orderPaymentPreference)
      Gets the chronologically latest PaymentGatewayResponse from an OrderPaymentPreference which is either a PRDS_PAY_AUTH or PRDS_PAY_REAUTH.
      static java.util.List<GenericValue> getAuthTransactions​(GenericValue orderPaymentPreference)
      Gets a chronologically ordered list of PaymentGatewayResponses from an OrderPaymentPreference which is either a PRDS_PAY_AUTH or PRDS_PAY_REAUTH.
      static GenericValue getCaptureTransaction​(GenericValue orderPaymentPreference)  
      static java.lang.String getPaymentCustomMethod​(Delegator delegator, java.lang.String customMethodId)  
      static boolean isReplacementOrder​(GenericValue orderHeader)  
      static java.util.Map<java.lang.String,​java.lang.Object> processAuthResult​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processCaptureResult​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processCaptureSplitPayment​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processCreditResult​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processManualCcAuth​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processManualCcTx​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processRefundResult​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> processReleaseResult​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> refundOrderPaymentPreference​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> refundPayment​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> releaseOrderPaymentPreference​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Releases authorization for a single OrderPaymentPreference through service calls to the defined processing service for the ProductStore/PaymentMethodType
      static java.util.Map<java.lang.String,​java.lang.Object> releaseOrderPayments​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Releases authorizations through service calls to the defined processing service for the ProductStore/PaymentMethodType
      static java.util.Map<java.lang.String,​java.lang.Object> retryFailedAuthNsfs​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> retryFailedAuths​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> retryFailedOrderAuth​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> savePaymentGatewayResponse​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> savePaymentGatewayResponseAndMessages​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> storePaymentErrorMessage​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> testCapture​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Test capture service (returns true)
      static java.util.Map<java.lang.String,​java.lang.Object> testCaptureWithReAuth​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> testCCProcessorCaptureAlwaysDecline​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Always decline processor
      static java.util.Map<java.lang.String,​java.lang.Object> testProcessor​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Simple test processor; declines all orders < 100.00; approves all orders >= 100.00
      static java.util.Map<java.lang.String,​java.lang.Object> testProcessorWithCapture​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Simple test processor; declines all orders < 100.00; approves all orders > 100.00
      static java.util.Map<java.lang.String,​java.lang.Object> testRandomAuthorize​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Test authorize - does random declines
      static java.util.Map<java.lang.String,​java.lang.Object> testRefund​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      Test refund service (returns true)
      static java.util.Map<java.lang.String,​java.lang.Object> testRefundFailure​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> testRelease​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      static java.util.Map<java.lang.String,​java.lang.Object> verifyCreditCard​(DispatchContext dctx, java.util.Map<java.lang.String,​? extends java.lang.Object> context)  
      • 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
      • AUTH_SERVICE_TYPE

        public static final java.lang.String AUTH_SERVICE_TYPE
        See Also:
        Constant Field Values
      • REAUTH_SERVICE_TYPE

        public static final java.lang.String REAUTH_SERVICE_TYPE
        See Also:
        Constant Field Values
      • RELEASE_SERVICE_TYPE

        public static final java.lang.String RELEASE_SERVICE_TYPE
        See Also:
        Constant Field Values
      • CAPTURE_SERVICE_TYPE

        public static final java.lang.String CAPTURE_SERVICE_TYPE
        See Also:
        Constant Field Values
      • REFUND_SERVICE_TYPE

        public static final java.lang.String REFUND_SERVICE_TYPE
        See Also:
        Constant Field Values
      • CREDIT_SERVICE_TYPE

        public static final java.lang.String CREDIT_SERVICE_TYPE
        See Also:
        Constant Field Values
      • decimals

        public static final int decimals
      • rounding

        public static final java.math.RoundingMode rounding
      • ZERO

        public static final java.math.BigDecimal ZERO
    • Constructor Detail

      • PaymentGatewayServices

        public PaymentGatewayServices()
    • Method Detail

      • authOrderPaymentPreference

        public static java.util.Map<java.lang.String,​java.lang.Object> authOrderPaymentPreference​(DispatchContext dctx,
                                                                                                        java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Authorizes a single order preference with an option to specify an amount. The result map has the Booleans "errors" and "finished" which notify the user if there were any errors and if the authorization was finished. There is also a List "messages" for the authorization response messages and a BigDecimal, "processAmount" as the amount processed. TODO: it might be nice to return the paymentGatewayResponseId
      • authOrderPayments

        public static java.util.Map<java.lang.String,​java.lang.Object> authOrderPayments​(DispatchContext dctx,
                                                                                               java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Processes payments through service calls to the defined processing service for the ProductStore/PaymentMethodType
        Returns:
        APPROVED|FAILED|ERROR for complete processing of ALL payment methods.
      • releaseOrderPayments

        public static java.util.Map<java.lang.String,​java.lang.Object> releaseOrderPayments​(DispatchContext dctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Releases authorizations through service calls to the defined processing service for the ProductStore/PaymentMethodType
        Returns:
        COMPLETE|FAILED|ERROR for complete processing of ALL payments.
      • processCreditResult

        public static java.util.Map<java.lang.String,​java.lang.Object> processCreditResult​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • releaseOrderPaymentPreference

        public static java.util.Map<java.lang.String,​java.lang.Object> releaseOrderPaymentPreference​(DispatchContext dctx,
                                                                                                           java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Releases authorization for a single OrderPaymentPreference through service calls to the defined processing service for the ProductStore/PaymentMethodType
        Returns:
        SUCCESS|FAILED|ERROR for complete processing of payment.
      • processReleaseResult

        public static java.util.Map<java.lang.String,​java.lang.Object> processReleaseResult​(DispatchContext dctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • capturePaymentsByInvoice

        public static java.util.Map<java.lang.String,​java.lang.Object> capturePaymentsByInvoice​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodType
        Returns:
        COMPLETE|FAILED|ERROR for complete processing of ALL payment methods.
      • captureOrderPayments

        public static java.util.Map<java.lang.String,​java.lang.Object> captureOrderPayments​(DispatchContext dctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodType
        Returns:
        COMPLETE|FAILED|ERROR for complete processing of ALL payment methods.
      • processCaptureSplitPayment

        public static java.util.Map<java.lang.String,​java.lang.Object> processCaptureSplitPayment​(DispatchContext dctx,
                                                                                                        java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • captureBillingAccountPayment

        public static java.util.Map<java.lang.String,​java.lang.Object> captureBillingAccountPayment​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • captureBillingAccountPayments

        public static java.util.Map<java.lang.String,​java.lang.Object> captureBillingAccountPayments​(DispatchContext dctx,
                                                                                                           java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • storePaymentErrorMessage

        public static java.util.Map<java.lang.String,​java.lang.Object> storePaymentErrorMessage​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processAuthResult

        public static java.util.Map<java.lang.String,​java.lang.Object> processAuthResult​(DispatchContext dctx,
                                                                                               java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processCaptureResult

        public static java.util.Map<java.lang.String,​java.lang.Object> processCaptureResult​(DispatchContext dctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • refundOrderPaymentPreference

        public static java.util.Map<java.lang.String,​java.lang.Object> refundOrderPaymentPreference​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • refundPayment

        public static java.util.Map<java.lang.String,​java.lang.Object> refundPayment​(DispatchContext dctx,
                                                                                           java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processRefundResult

        public static java.util.Map<java.lang.String,​java.lang.Object> processRefundResult​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • retryFailedOrderAuth

        public static java.util.Map<java.lang.String,​java.lang.Object> retryFailedOrderAuth​(DispatchContext dctx,
                                                                                                  java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • retryFailedAuths

        public static java.util.Map<java.lang.String,​java.lang.Object> retryFailedAuths​(DispatchContext dctx,
                                                                                              java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • retryFailedAuthNsfs

        public static java.util.Map<java.lang.String,​java.lang.Object> retryFailedAuthNsfs​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getAuthTransaction

        public static GenericValue getAuthTransaction​(GenericValue orderPaymentPreference)
        Gets the chronologically latest PaymentGatewayResponse from an OrderPaymentPreference which is either a PRDS_PAY_AUTH or PRDS_PAY_REAUTH. Used for capturing.
        Parameters:
        orderPaymentPreference - GenericValue object of the order payment preference
        Returns:
        return the first authorization of the order payment preference
      • getAuthTransactions

        public static java.util.List<GenericValue> getAuthTransactions​(GenericValue orderPaymentPreference)
        Gets a chronologically ordered list of PaymentGatewayResponses from an OrderPaymentPreference which is either a PRDS_PAY_AUTH or PRDS_PAY_REAUTH.
        Parameters:
        orderPaymentPreference - GenericValue object of the order payment preference
        Returns:
        return the authorizations of the order payment preference
      • getAuthTime

        public static java.sql.Timestamp getAuthTime​(GenericValue orderPaymentPreference)
      • checkAuthValidity

        public static boolean checkAuthValidity​(GenericValue orderPaymentPreference,
                                                java.lang.String paymentConfig)
      • savePaymentGatewayResponse

        public static java.util.Map<java.lang.String,​java.lang.Object> savePaymentGatewayResponse​(DispatchContext dctx,
                                                                                                        java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • savePaymentGatewayResponseAndMessages

        public static java.util.Map<java.lang.String,​java.lang.Object> savePaymentGatewayResponseAndMessages​(DispatchContext dctx,
                                                                                                                   java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processManualCcAuth

        public static java.util.Map<java.lang.String,​java.lang.Object> processManualCcAuth​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • processManualCcTx

        public static java.util.Map<java.lang.String,​java.lang.Object> processManualCcTx​(DispatchContext dctx,
                                                                                               java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • verifyCreditCard

        public static java.util.Map<java.lang.String,​java.lang.Object> verifyCreditCard​(DispatchContext dctx,
                                                                                              java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • testProcessor

        public static java.util.Map<java.lang.String,​java.lang.Object> testProcessor​(DispatchContext dctx,
                                                                                           java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Simple test processor; declines all orders < 100.00; approves all orders >= 100.00
      • testProcessorWithCapture

        public static java.util.Map<java.lang.String,​java.lang.Object> testProcessorWithCapture​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Simple test processor; declines all orders < 100.00; approves all orders > 100.00
      • testRandomAuthorize

        public static java.util.Map<java.lang.String,​java.lang.Object> testRandomAuthorize​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Test authorize - does random declines
      • alwaysApproveProcessor

        public static java.util.Map<java.lang.String,​java.lang.Object> alwaysApproveProcessor​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Always approve processor.
      • alwaysApproveWithCapture

        public static java.util.Map<java.lang.String,​java.lang.Object> alwaysApproveWithCapture​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • alwaysDeclineProcessor

        public static java.util.Map<java.lang.String,​java.lang.Object> alwaysDeclineProcessor​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Always decline processor
      • alwaysNsfProcessor

        public static java.util.Map<java.lang.String,​java.lang.Object> alwaysNsfProcessor​(DispatchContext dctx,
                                                                                                java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Always NSF (not sufficient funds) processor
      • alwaysBadExpireProcessor

        public static java.util.Map<java.lang.String,​java.lang.Object> alwaysBadExpireProcessor​(DispatchContext dctx,
                                                                                                      java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Always fail/bad expire date processor
      • badExpireEvenProcessor

        public static java.util.Map<java.lang.String,​java.lang.Object> badExpireEvenProcessor​(DispatchContext dctx,
                                                                                                    java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Fail/bad expire date when year is even processor
      • alwaysBadCardNumberProcessor

        public static java.util.Map<java.lang.String,​java.lang.Object> alwaysBadCardNumberProcessor​(DispatchContext dctx,
                                                                                                          java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Always bad card number processor
      • alwaysFailProcessor

        public static java.util.Map<java.lang.String,​java.lang.Object> alwaysFailProcessor​(DispatchContext dctx,
                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Always fail (error) processor
      • testRelease

        public static java.util.Map<java.lang.String,​java.lang.Object> testRelease​(DispatchContext dctx,
                                                                                         java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • testCapture

        public static java.util.Map<java.lang.String,​java.lang.Object> testCapture​(DispatchContext dctx,
                                                                                         java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Test capture service (returns true)
      • testCCProcessorCaptureAlwaysDecline

        public static java.util.Map<java.lang.String,​java.lang.Object> testCCProcessorCaptureAlwaysDecline​(DispatchContext dctx,
                                                                                                                 java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Always decline processor
      • testCaptureWithReAuth

        public static java.util.Map<java.lang.String,​java.lang.Object> testCaptureWithReAuth​(DispatchContext dctx,
                                                                                                   java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • testRefund

        public static java.util.Map<java.lang.String,​java.lang.Object> testRefund​(DispatchContext dctx,
                                                                                        java.util.Map<java.lang.String,​? extends java.lang.Object> context)
        Test refund service (returns true)
      • testRefundFailure

        public static java.util.Map<java.lang.String,​java.lang.Object> testRefundFailure​(DispatchContext dctx,
                                                                                               java.util.Map<java.lang.String,​? extends java.lang.Object> context)
      • getPaymentCustomMethod

        public static java.lang.String getPaymentCustomMethod​(Delegator delegator,
                                                              java.lang.String customMethodId)
      • isReplacementOrder

        public static boolean isReplacementOrder​(GenericValue orderHeader)