/*
 * @Date: 2023-02-25 16:21:00
 * @LastEditors: JinxChen
 * @LastEditTime: 2023-02-26 10:17:38
 * @FilePath: \TelpoH5FrontendWeb\src\api\pay.js
 * @description:
 */
import javaRequest from '@/http/java_api';

export const APIPay = {
    getToken, //获取token
    getOpenId, // 获取openId
    getPolAlipayForm, //获取聚合码支付宝form
    getPolWx, //获取聚合码微信
    getWxPayResult, //获取微信支付结果
    getAlipayResult,
};
export default APIPay;

function getToken(manufacturerNo) {
    return javaRequest({
        url: '/authorization/get/token',
        method: 'get',
        params: {manufacturerNo},
    });
}
function getOpenId(code) {
    return javaRequest({
        url: '/polymerization/get/openid',
        method: 'get',
        params: {code},
    });
}

function getPolAlipayForm(params) {
    return javaRequest({
        url: '/polymerization/alipay',
        method: 'post',
        data: params,
    });
}

function getPolWx(params) {
    return javaRequest({
        url: '/polymerization/wxpay',
        method: 'post',
        data: params,
    });
}

function getWxPayResult(params) {
    return javaRequest({
        url: '/api/wx/order/callback',
        method: 'post',
        data: params,
    });
}
function getAlipayResult(params) {
    return javaRequest({
        url: '/api/order/detail/callback',
        method: 'post',
        data: params,
    });
}