Interface AlipayPaymentTransactionStrategy
-
- All Known Implementing Classes:
DefaultAlipayPaymentTransactionStrategy
public interface AlipayPaymentTransactionStrategy
Deals with payment transaction when the transaction is in process
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
checkCaptureTransactionEntry(OrderModel orderModel, TransactionStatus status)
Checks if the alipay payment transaction exists under an order that has capture entryvoid
createForNewRequest(OrderModel orderModel, java.lang.String requestUrl)
Saves new transaction entry once new direct_pay request is createdjava.util.Optional<AlipayPaymentTransactionEntryModel>
getPaymentTransactionEntry(OrderModel orderModel, TransactionStatus status, PaymentTransactionType paymentTransactionType)
Finds payment transaction entry with given parametersjava.util.Optional<AlipayPaymentTransactionModel>
getPaymentTransactionWithCaptureEntry(OrderModel orderModel, TransactionStatus status)
Finds payment transaction whose type is captureAlipayPaymentTransactionEntryModel
saveForStatusCheck(OrderModel orderModel, AlipayRawPaymentStatus checkTradeResponseData)
Saves alipay payment transaction entry upon the completion of payment status checkvoid
updateForCancelPayment(OrderModel orderModel, AlipayRawCancelPaymentResult alipayRawCancelPaymentResult)
Updates alipay payment transaction and entry upon canceling tradevoid
updateForError(OrderModel orderModel, AlipayRawDirectPayErrorInfo aipayRawDirectPayErrorInfo)
Updates alipay payment transaction and entry upon receiving error data from alipayvoid
updateForNotification(OrderModel orderModel, AlipayRawDirectPayNotification directPayNotifyResponseData)
Updates alipay payment transaction and entry upon receiving notification data from alipayjava.util.Map<OrderModel,java.lang.Boolean>
updateForRefundNotification(java.util.List<AlipayRefundData> alipayRefundData)
Updates transaction for refund notificationvoid
updateTransactionForRefundRequest(OrderModel orderModel, AlipayRefundRequestData alipayRefundRequestData)
Creates a transaction entry when user creates a refund request
-
-
-
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 orderrequestUrl
- accessible URL
-
saveForStatusCheck
AlipayPaymentTransactionEntryModel saveForStatusCheck(OrderModel orderModel, AlipayRawPaymentStatus checkTradeResponseData)
Saves alipay payment transaction entry upon the completion of payment status check- Parameters:
orderModel
- the ordercheckTradeResponseData
- the trade status check- Returns:
- AlipayPaymentTransactionEntryModel
-
updateForNotification
void updateForNotification(OrderModel orderModel, AlipayRawDirectPayNotification directPayNotifyResponseData)
Updates alipay payment transaction and entry upon receiving notification data from alipay- Parameters:
orderModel
- order handled by the notification dataOrderModel
directPayNotifyResponseData
- notification from alipayAlipayRawDirectPayNotification
-
updateForCancelPayment
void updateForCancelPayment(OrderModel orderModel, AlipayRawCancelPaymentResult alipayRawCancelPaymentResult)
Updates alipay payment transaction and entry upon canceling trade- Parameters:
orderModel
- transaction related orderalipayRawCancelPaymentResult
- response from alipay upon canceling tradeAlipayRawCancelPaymentResult
-
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 dataaipayRawDirectPayErrorInfo
- error data from alipayAlipayRawDirectPayErrorInfo
-
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 checkstatus
- transaction statusTransactionStatus
- Returns:
- false if the transaction exists
-
getPaymentTransactionEntry
java.util.Optional<AlipayPaymentTransactionEntryModel> getPaymentTransactionEntry(OrderModel orderModel, TransactionStatus status, PaymentTransactionType paymentTransactionType)
Finds payment transaction entry with given parameters- Parameters:
orderModel
- order needed to checkstatus
- transaction statusTransactionStatus
paymentTransactionType
- payment transaction statusPaymentTransactionType
- Returns:
- an optional describing the result of AlipayPaymentTransactionEntryModel if a value is present, otherwise an empty Optional
-
getPaymentTransactionWithCaptureEntry
java.util.Optional<AlipayPaymentTransactionModel> getPaymentTransactionWithCaptureEntry(OrderModel orderModel, TransactionStatus status)
Finds payment transaction whose type is capture- Parameters:
orderModel
- order needed to checkstatus
- transaction statusTransactionStatus
- 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 dataAlipayRefundData
}- 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 refundalipayRefundRequestData
- request data sent to alipay
-
-