UNPKG

1.16 kBJavaScriptView Raw
1'use strict';
2
3var util = require('./util');
4var wrapper = util.wrapper;
5
6/**
7 * 标记客户的投诉处理状态
8 * Examples:
9 * ```
10 * api.updateFeedback(openid, feedbackId, callback);
11 * ```
12 * Callback:
13 *
14 * - `err`, 调用失败时得到的异常
15 * - `result`, 调用正常时得到的对象
16 *
17 * Result:
18 * ```
19 * {
20 * "errcode": 0,
21 * "errmsg": "success"
22 * }
23 * ```
24 * @param {String} openid 用户ID
25 * @param {String} feedbackId 投诉ID
26 * @param {Function} callback 回调函数
27 */
28exports.updateFeedback = function (openid, feedbackId, callback) {
29 this.preRequest(this._updateFeedback, arguments);
30};
31
32exports._updateFeedback = function (openid, feedbackId, callback) {
33 var feedbackUrl = this.endpoint + '/payfeedback/update';
34 // https://api.weixin.qq.com/payfeedback/update?access_token=xxxxx&openid=XXXX&feedbackid=xxxx
35 var data = {
36 'access_token': this.token.accessToken,
37 'openid': openid,
38 'feedbackid': feedbackId
39 };
40 var opts = {
41 dataType: 'json',
42 type: 'GET',
43 data: data,
44 headers: {
45 'Content-Type': 'application/json'
46 }
47 };
48 this.request(feedbackUrl, opts, wrapper(callback));
49};