package cn.common.service;


import cn.common.common.alipay.AliPayUniTransferParam;
import cn.common.interaction.req.alipay.AliPaySignReq;
import com.alipay.api.CertAlipayRequest;
import com.alipay.api.response.AlipayFundTransUniTransferResponse;

/**
 * @author Singer create by singer email:singer-coder@qq.com
 * @projectName health-platform-api
 * @Description: 支付宝相关服务方法
 * @date 2020-07-03
 */
public interface AliPayService {


    /**
     * 支付宝回调
     * JAVA服务端验证异步通知信息参数示例（证书）
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2020-07-01
     */
    void aliPayCallBack();

    /**
     * APP内支付签名 JAVA服务端 SDK 生成 APP支付订单信息示例（证书）
     * 访问地址 https://opendocs.alipay.com/open/54/106370/
     *
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2020-07-01
     * @param aliPaySignReq APP内支付签名
     * @return String
     */
    String appTradeSign(AliPaySignReq aliPaySignReq);

    /**
     * 对指定的字符串进行签名
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2020-06-30
     * @param aliPaySignReq 签名所需参数
     * @return String
     */
    String aliPaySign(AliPaySignReq aliPaySignReq);

    /**
     * 返回支付宝的CertAlipayRequest对象
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2020-05-09
     * @return CertAlipayRequest
     */
    CertAlipayRequest returnCertAliPayRequest();


    /**
     * 调用阿里单笔转账请求接口
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2020-04-27
     * @param aliPayUniTransferParam 支付宝单笔转账请求参数
     * @return
     */
    AlipayFundTransUniTransferResponse aliPayUniTransfer(AliPayUniTransferParam aliPayUniTransferParam);

    /**
     * 通过支付宝授权认证码拿到支付宝的UserId
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2020-05-09
     * @param authCode 支付宝授权认证码
     * @return 支付宝的用户ID
     */
    String getAliPayUserId(String authCode);
}
