Interface ChinesePaymentService

    • Method Detail

      • handleAsyncResponse

        java.lang.String handleAsyncResponse​(javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
        Handling the Asyn-response of the 3rd part payment service provider server
        Parameters:
        request - The HttpServletRequest
        response - The HttpServletResponse
        Returns:
        the code of the order
      • handleSyncResponse

        java.lang.String handleSyncResponse​(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response)
        Handling the Sync-response of the 3rd part payment service provider server
        Parameters:
        request - The HttpServletRequest
        response - The HttpServletResponse
        Returns:
        the code of the order
      • cancelPayment

        boolean cancelPayment​(java.lang.String orderCode)
        Canceling the payment with the 3rd part payment service provider server
        Parameters:
        orderCode - The code of the order
        Returns:
        true when canceling payment is successful
      • getPaymentRequestUrl

        java.lang.String getPaymentRequestUrl​(java.lang.String orderCode)
        Getting the PaymentRequestUrl to be send to the 3rd part payment service provider server
        Parameters:
        orderCode - The code of the order
        Returns:
        the payment request Url of the 3rd part payment service provider
      • syncPaymentStatus

        void syncPaymentStatus​(java.lang.String orderCode)
        Synchronizing the PaymentStatus with the 3rd part payment service provider server
        Parameters:
        orderCode - The code of the order
      • setPaymentInfo

        boolean setPaymentInfo​(CartModel cartModel,
                               ChinesePaymentInfoModel chinesePaymentInfoModel)
        Saving the PaymentInfo
        Parameters:
        cartModel - The current cart
        chinesePaymentInfoModel - The ChinesePaymentInfo of the cart
        Returns:
        true when setting PaymentInfo is successful
      • getPspLogoUrl

        java.lang.String getPspLogoUrl()
        Getting the Logo of the 3rd part payment service providers
        Returns:
        the url of the payment service provider logo
      • getRefundRequestUrl

        java.util.Optional<java.lang.String> getRefundRequestUrl​(java.lang.String orderCode)
        Getting the RefundRequestUrl to be send to the 3rd part payment service provider server
        Parameters:
        orderCode - The code of the order
        Returns:
        the refund request Url of the 3rd part payment service provider if order can be refunded, otherwise return an empty Optional
      • updatePaymentInfoForPlaceOrder

        default void updatePaymentInfoForPlaceOrder​(java.lang.String orderCode)
        Update payment info after place order
        Parameters:
        orderCode - The code of the order