coa-wx-isv
Version:
一个轻量的微信SDK服务商版 for Node.js
50 lines (49 loc) • 4.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.WxIsvInsuranceFreightService = void 0;
const coa_helper_1 = require("coa-helper");
const WxIsvServiceBase_1 = require("../libs/WxIsvServiceBase");
class WxIsvInsuranceFreightService extends WxIsvServiceBase_1.WxIsvServiceBase {
// 运费险开通 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async open(accessToken) {
return (await this.request('POST', '/wxa/business/insurance_freight/open', {}, { access_token: accessToken }));
}
// 运费险申请充值订单号 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async createchargeid(accessToken, quota) {
return (await this.requestTransformResponse('POST', '/wxa/business/insurance_freight/createchargeid', { quota }, { access_token: accessToken }, (data) => { return JSON.parse(data.replace(/"(\w+)":(\d{0,})([,}])/g, '"$1":"$2"$3')); }));
}
// 运费险申请支付 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async applypay(accessToken, orderId) {
return (await this.request('POST', '/wxa/business/insurance_freight/applypay', { order_id: orderId }, { access_token: accessToken }));
}
// 拉取充值订单信息 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async getpayorderlist(accessToken, data) {
const params = coa_helper_1.$.snakeCaseKeys(data);
return (await this.request('POST', '/wxa/business/insurance_freight/getpayorderlist', { ...params }, { access_token: accessToken }));
}
// 退款接口 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async refund(accessToken) {
return (await this.request('POST', '/wxa/business/insurance_freight/refund', {}, { access_token: accessToken }));
}
// 拉取摘要 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async getsummary(accessToken, data) {
const params = coa_helper_1.$.snakeCaseKeys(data);
return (await this.request('POST', '/wxa/business/insurance_freight/getsummary', { ...params }, { access_token: accessToken }));
}
// 拉取保单摘要 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async getorderlist(accessToken, data) {
const params = coa_helper_1.$.snakeCaseKeys(data);
return (await this.request('POST', '/wxa/business/insurance_freight/getorderlist', { ...params }, { access_token: accessToken }));
}
// 投保 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async createorder(accessToken, data) {
const params = coa_helper_1.$.snakeCaseKeys(data);
return (await this.request('POST', '/wxa/business/insurance_freight/createorder', { ...params }, { access_token: accessToken }));
}
// 理赔 https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/freight_insurance.html#%E7%90%86%E8%B5%94%E6%8E%A5%E5%8F%A3
async claim(accessToken, data) {
const params = coa_helper_1.$.snakeCaseKeys(data);
return (await this.request('POST', '/wxa/business/insurance_freight/claim', { ...params }, { access_token: accessToken }));
}
}
exports.WxIsvInsuranceFreightService = WxIsvInsuranceFreightService;