ICashierDeskService.java 1.81 KB
package com.diligrp.cashier.boss.service;

import com.diligrp.cashier.boss.domain.CashierOrderVO;
import com.diligrp.cashier.boss.domain.CashierPaymentUrl;
import com.diligrp.cashier.pipeline.domain.OnlinePaymentResponse;
import com.diligrp.cashier.pipeline.domain.OnlinePaymentStatus;
import com.diligrp.cashier.pipeline.domain.OnlineRefundResponse;
import com.diligrp.cashier.trade.domain.*;
import com.diligrp.cashier.trade.model.OnlinePayment;

public interface ICashierDeskService {
    /**
     * 提交收银台订单
     *
     * @param merchant - 接入商户
     * @param order - 交易订单
     * @return 交易订单
     */
    CashierPaymentUrl doSubmit(Merchant merchant, CashierOrder order);

    /**
     * 根据收银台TOKEN信息获取订单信息
     */
    CashierOrderVO getCashierOrderByToken(String token);

    /**
     * 提交收银台支付
     *
     * @param payment - 支付信息
     * @return 支付状态
     */
    OnlinePaymentStatus doPayment(CashierPayment payment);

    /**
     * 支付结果通知
     *
     * @param payment - 支付订单
     * @param response - 支付结果
     */
    void notifyPaymentResponse(OnlinePayment payment, OnlinePaymentResponse response);

    /**
     * 关闭交易订单
     */
    void closeTradeOrder(String tradeId);

    /**
     * 查询支付状态
     */
    OnlinePaymentResult queryPaymentState(String paymentId, String mode);

    /**
     * 交易退款
     */
    OnlineRefundResult sendRefundRequest(OnlineRefundDTO request);

    /**
     * 退款结果通知
     *
     * @param refund - 退款订单
     * @param response - 退款结果
     */
    void notifyRefundResult(OnlinePayment refund, OnlineRefundResponse response);

    /**
     * 查询退款状态
     */
    OnlineRefundResult queryRefundState(String refundId, String mode);

}