Interface AlipayPaymentTransactionStrategy

    • Method Detail

      • createForNewRequest

        void createForNewRequest​(OrderModel orderModel,
                                 java.lang.String requestUrl)
        Saves new transaction entry once new direct_pay request is created
        Parameters:
        orderModel - the order
        requestUrl - accessible URL
      • saveForStatusCheck

        AlipayPaymentTransactionEntryModel saveForStatusCheck​(OrderModel orderModel,
                                                              AlipayRawPaymentStatus checkTradeResponseData)
        Saves alipay payment transaction entry upon the completion of payment status check
        Parameters:
        orderModel - the order
        checkTradeResponseData - the trade status check
        Returns:
        AlipayPaymentTransactionEntryModel
      • updateForCancelPayment

        void updateForCancelPayment​(OrderModel orderModel,
                                    AlipayRawCancelPaymentResult alipayRawCancelPaymentResult)
        Updates alipay payment transaction and entry upon canceling trade
        Parameters:
        orderModel - transaction related order
        alipayRawCancelPaymentResult - response from alipay upon canceling trade AlipayRawCancelPaymentResult
      • updateForError

        void updateForError​(OrderModel orderModel,
                            AlipayRawDirectPayErrorInfo aipayRawDirectPayErrorInfo)
        Updates alipay payment transaction and entry upon receiving error data from alipay
        Parameters:
        orderModel - order handled by the error data
        aipayRawDirectPayErrorInfo - error data from alipay AlipayRawDirectPayErrorInfo
      • checkCaptureTransactionEntry

        boolean checkCaptureTransactionEntry​(OrderModel orderModel,
                                             TransactionStatus status)
        Checks if the alipay payment transaction exists under an order that has capture entry
        Parameters:
        orderModel - order needed to check
        status - transaction status TransactionStatus
        Returns:
        false if the transaction exists
      • getPaymentTransactionWithCaptureEntry

        java.util.Optional<AlipayPaymentTransactionModel> getPaymentTransactionWithCaptureEntry​(OrderModel orderModel,
                                                                                                TransactionStatus status)
        Finds payment transaction whose type is capture
        Parameters:
        orderModel - order needed to check
        status - transaction status TransactionStatus
        Returns:
        an Optional describing the result of AlipayPaymentTransactionEntryModel if a value is present, otherwise an empty Optional
      • updateForRefundNotification

        java.util.Map<OrderModel,​java.lang.Boolean> updateForRefundNotification​(java.util.List<AlipayRefundData> alipayRefundData)
        Updates transaction for refund notification
        Parameters:
        alipayRefundDatas - refund data AlipayRefundData}
        Returns:
        refund order payment status map
      • updateTransactionForRefundRequest

        void updateTransactionForRefundRequest​(OrderModel orderModel,
                                               AlipayRefundRequestData alipayRefundRequestData)
        Creates a transaction entry when user creates a refund request
        Parameters:
        orderModel - order needed to refund
        alipayRefundRequestData - request data sent to alipay