Class DefaultAcceleratorPaymentService

    • Constructor Detail

      • DefaultAcceleratorPaymentService

        public DefaultAcceleratorPaymentService()
    • Method Detail

      • beginHopCreatePaymentSubscription

        public PaymentData beginHopCreatePaymentSubscription​(java.lang.String siteName,
                                                             java.lang.String responseUrl,
                                                             java.lang.String merchantCallbackUrl,
                                                             CustomerModel customer,
                                                             CreditCardPaymentInfoModel cardInfo,
                                                             AddressModel paymentAddress)
        Description copied from interface: PaymentService
        This method generates the Hosted Order Page request data which includes all data required to create a subscription (customer profile). The request data will be sent to the HOP/SOP URL in a POST method.
        Specified by:
        beginHopCreatePaymentSubscription in interface PaymentService
        Parameters:
        siteName - - The name of the current CMS site
        responseUrl - - The URL used by the CMS site to handle responses from the Hosted Order Page or Silent Order Post.
        merchantCallbackUrl - - The URL of the MerchantCallbackController used by the Provider to send validation responses.
        customer - - The Customer details.
        cardInfo - - If available will contain any existing credit card details used to pre-populate the HOP.
        paymentAddress - - If available contains the customer's billing address, used to pre-populate the HOP.
        Returns:
        a PaymentData object which contains all data required to create a subscription.
      • beginSopCreatePaymentSubscription

        public PaymentData beginSopCreatePaymentSubscription​(java.lang.String siteName,
                                                             java.lang.String responseUrl,
                                                             java.lang.String merchantCallbackUrl,
                                                             CustomerModel customer,
                                                             CreditCardPaymentInfoModel cardInfo,
                                                             AddressModel paymentAddress)
        Description copied from interface: PaymentService
        This method generates the Hosted Order Page request data which includes all data required to create a subscription (customer profile). The request data will be sent to the HOP/SOP URL in a POST method.
        Specified by:
        beginSopCreatePaymentSubscription in interface PaymentService
        Parameters:
        siteName - - The name of the current CMS site
        responseUrl - - The URL used by the CMS site to handle responses from the Hosted Order Page or Silent Order Post.
        merchantCallbackUrl - - The URL of the MerchantCallbackController used by the Provider to send validation responses.
        customer - - The Customer details.
        cardInfo - - If available will contain any existing credit card details used to pre-populate the HOP.
        paymentAddress - - If available contains the customer's billing address, used to pre-populate the HOP.
        Returns:
        a PaymentData object which contains all data required to create a subscription.
      • completeHopCreatePaymentSubscription

        public PaymentSubscriptionResultItem completeHopCreatePaymentSubscription​(CustomerModel customerModel,
                                                                                  boolean saveInAccount,
                                                                                  java.util.Map<java.lang.String,​java.lang.String> parameters)
        Description copied from interface: PaymentService
        This method creates a subscription internally with the result parameters obtained from the provider's Hosted Order Page. Only basic customer information and a subscription id is stored internally. All customer information is stored on the provider's system including credit card number and security code. The subscription id is used for future lookup for obtaining the customer's credit card details.
        Specified by:
        completeHopCreatePaymentSubscription in interface PaymentService
        Parameters:
        customerModel - - The Customer details.
        saveInAccount - - Flag indicating if this new payment card will be stored in the customer's profile.
        parameters - - a Map of key-value paired Strings with the result data returned from the Hosted Order Page.
        Returns:
        a PaymentSubscriptionResultItem object which contains the newly created credit card.
      • completeSopCreatePaymentSubscription

        public PaymentSubscriptionResultItem completeSopCreatePaymentSubscription​(CustomerModel customerModel,
                                                                                  boolean saveInAccount,
                                                                                  java.util.Map<java.lang.String,​java.lang.String> parameters)
        Description copied from interface: PaymentService
        This method creates a subscription internally with the result parameters obtained from the provider's Silent Order Post. Only basic customer information and a subscription id is stored internally. All customer information is stored on the provider's system including credit card number and security code. The subscription id is used for future lookup for obtaining the customer's credit card details.
        Specified by:
        completeSopCreatePaymentSubscription in interface PaymentService
        Parameters:
        customerModel - - The Customer details.
        saveInAccount - - Flag indicating if this new payment card will be stored in the customer's profile.
        parameters - - a Map of key-value paired Strings with the result data returned from the Hosted Order Page.
        Returns:
        a PaymentSubscriptionResultItem object which contains the newly created credit card.
      • handleCreateSubscriptionCallback

        public void handleCreateSubscriptionCallback​(java.util.Map<java.lang.String,​java.lang.String> parameters)
        Description copied from interface: PaymentService
        This method attempts to validate the payment info with a given subscriptionId. Validation should only pass if both the payment info and the valid subscription exists for this subscriptionId.
        Specified by:
        handleCreateSubscriptionCallback in interface PaymentService
        Parameters:
        parameters - - a Map of key-value paired Strings with the result data returned from the callback handler.
      • handleFraudUpdateCallback

        public void handleFraudUpdateCallback​(java.util.Map<java.lang.String,​java.lang.String> parameters)
        Description copied from interface: PaymentService
        Uses the fraud call back strategy to handle fraud call back
        Specified by:
        handleFraudUpdateCallback in interface PaymentService
        Parameters:
        parameters - a Map of key-value paired Strings with the result data returned from the callback handler
      • setPaymentTransactionReviewResult

        public void setPaymentTransactionReviewResult​(PaymentTransactionEntryModel reviewDecisionEntry,
                                                      java.lang.String guid)
        This method add new PaymentTransactionEntry of type REVIEW_DECISION to the order. It also send event to allow submitorder proccess to end waitForReviewDecision action.
        Specified by:
        setPaymentTransactionReviewResult in interface PaymentService
        Parameters:
        reviewDecisionEntry - - payment transaction entry of REVIEW_DECISION type
        guid - - AbstractOrderModel.GUID to which PaymentTransaction will be added
      • getUserService

        protected UserService getUserService()
      • setUserService

        public void setUserService​(UserService userService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • getCartService

        protected CartService getCartService()
      • setCartService

        public void setCartService​(CartService cartService)
      • setPaymentFormActionUrlStrategy

        public void setPaymentFormActionUrlStrategy​(PaymentFormActionUrlStrategy paymentFormActionUrlStrategy)
      • setSiteConfigService

        public void setSiteConfigService​(SiteConfigService siteConfigService)
      • setCommonI18NService

        public void setCommonI18NService​(CommonI18NService commonI18NService)
      • setSignatureValidationStrategy

        public void setSignatureValidationStrategy​(SignatureValidationStrategy signatureValidationStrategy)
      • setPaymentTransactionStrategy

        public void setPaymentTransactionStrategy​(PaymentTransactionStrategy paymentTransactionStrategy)
      • setFraudCallbackStrategy

        public void setFraudCallbackStrategy​(FraudCallbackStrategy fraudCallbackStrategy)
      • setClientReferenceLookupStrategy

        public void setClientReferenceLookupStrategy​(ClientReferenceLookupStrategy clientReferenceLookupStrategy)