Class DefaultCisClientPaymentService

    • Constructor Detail

      • DefaultCisClientPaymentService

        public DefaultCisClientPaymentService()
    • Method Detail

      • pspUrl

        public com.hybris.charon.RawResponse<java.lang.String> pspUrl​(java.lang.String xCisClientRef,
                                                                      java.lang.String tenantId)
        Description copied from interface: CisClientPaymentService
        Retrieves the payment service url for a given client and tenant
        Specified by:
        pspUrl in interface CisClientPaymentService
        Parameters:
        xCisClientRef - the client reference
        tenantId - the tenant identifier
        Returns:
        a raw response with the psp url in the location attribute of the header
      • authorizeWithProfile

        public CisPaymentTransactionResult authorizeWithProfile​(java.lang.String xCisClientRef,
                                                                java.lang.String tenantId,
                                                                java.net.URI profileLocation,
                                                                CisPaymentAuthorization cisPaymentAuthorization)
        Description copied from interface: CisClientPaymentService
        Requests an authorization of a payment
        Specified by:
        authorizeWithProfile in interface CisClientPaymentService
        Parameters:
        xCisClientRef - the client reference
        tenantId - the tenant identifier
        profileLocation - the URI of the profile to be authorized
        cisPaymentAuthorization - the payment authorization to be authorized
        Returns:
      • capture

        public CisPaymentTransactionResult capture​(java.lang.String xCisClientRef,
                                                   java.lang.String tenantId,
                                                   java.net.URI authorizationLocation,
                                                   java.lang.String transactionId,
                                                   CisPaymentRequest paymentRequest)
        Description copied from interface: CisClientPaymentService
        Captures a payment based on the given properties
        Specified by:
        capture in interface CisClientPaymentService
        Parameters:
        xCisClientRef - the client reference
        tenantId - the tenant identifier
        transactionId - the transaction identifier to be captured
        paymentRequest - the corresponding payment request
        Returns:
        the payment transaction result
      • reverse

        public CisPaymentTransactionResult reverse​(java.lang.String xCisClientRef,
                                                   java.lang.String tenantId,
                                                   java.net.URI authorizationLocation,
                                                   java.lang.String transactionId,
                                                   CisPaymentRequest paymentRequest)
        Description copied from interface: CisClientPaymentService
        Reverses a payment based on the given properties
        Specified by:
        reverse in interface CisClientPaymentService
        Parameters:
        xCisClientRef - the client reference
        tenantId - the tenant identifier
        authorizationLocation - the location of the granted authorization
        transactionId - the transaction identifier to be reversed
        paymentRequest - the corresponding payment request
        Returns:
        the reversal payment transaction result
      • refund

        public CisPaymentTransactionResult refund​(java.lang.String xCisClientRef,
                                                  java.lang.String tenantId,
                                                  java.net.URI captureLocation,
                                                  java.lang.String transactionId,
                                                  CisPaymentRequest paymentRequest)
        Description copied from interface: CisClientPaymentService
        Refunds a payment transaction
        Specified by:
        refund in interface CisClientPaymentService
        Parameters:
        xCisClientRef - the client reference
        tenantId - the tenant identifier
        captureLocation - the URI of the captured location
        transactionId - the transaction identifier to be reversed
        paymentRequest - the corresponding payment request
        Returns:
        the result of the refund payment transaction
      • addCustomerProfile

        public com.hybris.charon.RawResponse<CisPaymentProfileResult> addCustomerProfile​(java.lang.String xCisClientRef,
                                                                                         java.lang.String tenantId,
                                                                                         java.lang.String documentId,
                                                                                         CisExternalPaymentRequest cisExternalPayment)
        Description copied from interface: CisClientPaymentService
        Add a customer profile
        Specified by:
        addCustomerProfile in interface CisClientPaymentService
        Parameters:
        xCisClientRef - the client reference
        tenantId - the tenant identifier
        documentId - the document identifier
        cisExternalPayment - the external payment request
        Returns:
        a raw response with the payment profile created
      • updateCustomerProfile

        public CisPaymentProfileResult updateCustomerProfile​(java.lang.String xCisClientRef,
                                                             java.lang.String tenantId,
                                                             java.net.URI profileLocation,
                                                             CisPaymentProfileRequest cisPaymentProfileRequest)
        Description copied from interface: CisClientPaymentService
        Updates a customer profile
        Specified by:
        updateCustomerProfile in interface CisClientPaymentService
        Parameters:
        xCisClientRef - the client reference
        tenantId - the tenant identifier
        profileLocation - the URI of the profile location
        cisPaymentProfileRequest - the payment profile request
        Returns:
        the profile payment updated
      • deleteCustomerProfile

        public java.lang.String deleteCustomerProfile​(java.lang.String xCisClientRef,
                                                      java.lang.String tenantId,
                                                      java.net.URI profileLocation)
        Description copied from interface: CisClientPaymentService
        Deletes a given customer profile
        Specified by:
        deleteCustomerProfile in interface CisClientPaymentService
        Parameters:
        xCisClientRef - the client reference
        tenantId - the tenant identifier
        profileLocation - the URI of the profile to delete
        Returns:
      • ping

        public boolean ping​(java.lang.String xCisClientRef,
                            java.lang.String tenantId)
        Description copied from interface: CisClientService
        Checks if service is functioning and connecting with current credentials.
        Specified by:
        ping in interface CisClientService
        Parameters:
        xCisClientRef - client ref to pass in the header
        tenantId - tenantId to pass in the header
        Returns:
        flag if the service is accessible or not
      • extractLastUriParam

        protected java.lang.String extractLastUriParam​(java.net.URI uri)
        Extracts the last part of the URI
        Parameters:
        uri - the URI for which we want to extract the last parameter
        Returns:
        the last parameter of the URI
      • getCisPaymentClient

        protected PaymentClient getCisPaymentClient()
        Returns:
        the cisPaymentClient
      • setCisPaymentClient

        public void setCisPaymentClient​(PaymentClient cisPaymentClient)
        Parameters:
        cisPaymentClient - the cisPaymentClient to set