Interface AlipayPaymentTransactionStrategy
- All Known Implementing Classes:
DefaultAlipayPaymentTransactionStrategy
public interface AlipayPaymentTransactionStrategy
Deals with payment transaction when the transaction is in process
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckCaptureTransactionEntry(OrderModel orderModel, TransactionStatus status) Checks if the alipay payment transaction exists under an order that has capture entryvoidcreateForNewRequest(OrderModel orderModel, String requestUrl) Saves new transaction entry once new direct_pay request is createdgetPaymentTransactionEntry(OrderModel orderModel, TransactionStatus status, PaymentTransactionType paymentTransactionType) Finds payment transaction entry with given parametersgetPaymentTransactionWithCaptureEntry(OrderModel orderModel, TransactionStatus status) Finds payment transaction whose type is capturesaveForStatusCheck(OrderModel orderModel, AlipayRawPaymentStatus checkTradeResponseData) Saves alipay payment transaction entry upon the completion of payment status checkvoidupdateForCancelPayment(OrderModel orderModel, AlipayRawCancelPaymentResult alipayRawCancelPaymentResult) Updates alipay payment transaction and entry upon canceling tradevoidupdateForError(OrderModel orderModel, AlipayRawDirectPayErrorInfo aipayRawDirectPayErrorInfo) Updates alipay payment transaction and entry upon receiving error data from alipayvoidupdateForNotification(OrderModel orderModel, AlipayRawDirectPayNotification directPayNotifyResponseData) Updates alipay payment transaction and entry upon receiving notification data from alipayupdateForRefundNotification(List<AlipayRefundData> alipayRefundData) Updates transaction for refund notificationvoidupdateTransactionForRefundRequest(OrderModel orderModel, AlipayRefundRequestData alipayRefundRequestData) Creates a transaction entry when user creates a refund request
-
Method Details
-
createForNewRequest
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 dataOrderModeldirectPayNotifyResponseData- 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
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
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
Optional<AlipayPaymentTransactionEntryModel> getPaymentTransactionEntry(OrderModel orderModel, TransactionStatus status, PaymentTransactionType paymentTransactionType) Finds payment transaction entry with given parameters- Parameters:
orderModel- order needed to checkstatus- transaction statusTransactionStatuspaymentTransactionType- payment transaction statusPaymentTransactionType- Returns:
- an optional describing the result of AlipayPaymentTransactionEntryModel if a value is present, otherwise an empty Optional
-
getPaymentTransactionWithCaptureEntry
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
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
-