package com.rf.psychological.wxpay.service;

import com.alibaba.fastjson.JSONObject;
import com.rf.psychological.utils.Result;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.util.Map;

/**
 * @Description:微信支付接口
 * @Author: zsf
 * @Date: 2022/6/21
 */
public interface WxPayService {

     String GET_ACCESS_TOKEN_URL= "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";

     String GENERATE_SHORT_LINK_URL = "https://api.weixin.qq.com/wxa/generate_urllink";

     String GENERATE_WX_CODE_URL = "https://api.weixin.qq.com/wxa/getwxacodeunlimit";
    /**
     * 调用native支付接口
     * @param paramJson
     * @return
     * @throws Exception
     */
    public Map<String,Object> nativePay(JSONObject paramJson) throws Exception;



    /**
     * 处理订单
     * @param bodyMap 密文数据
     * @throws GeneralSecurityException
     */
    void processOrder(Map<String, Object> bodyMap) throws GeneralSecurityException;

    /**
     * 取消订单
     * @param orderNo 订单号
     */
    void cancelOrder(String orderNo) throws Exception;

    /**
     * 查询订单
     * @param orderNo
     * @return
     */
    Map queryOrder(String orderNo) throws IOException;

    /**
     * 定时检查未支付订单
     */
    void checkOrderStatus() throws Exception;

    /**
     * h5下单
     * @param paramData
     * @return
     */
    Map<String,Object> h5Pay(JSONObject paramData) throws Exception;


    Map refund(String orderNo) throws IOException;

    Map aspiPay(JSONObject paramObject) throws Exception;

    String getAccessToken() throws IOException;

    /**
     * 获取到分享链接
     * @param path
     * @return
     */
    String generateLink(String path,String query) throws Exception;

    String generateWxCode(String page, String scene, String envVersion);
}
