Interface ChinesePaymentService

All Superinterfaces:
PaymentService
All Known Implementing Classes:
DefaultAlipayPaymentService, DefaultWeChatPayPaymentService

public interface ChinesePaymentService extends PaymentService
The interface to be implemented by the 3rd part payment service provider
  • Method Details

    • handleAsyncResponse

      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

      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(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

      String getPaymentRequestUrl(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(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

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

      Optional<String> getRefundRequestUrl(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(String orderCode)
      Update payment info after place order
      Parameters:
      orderCode - The code of the order