TheLordBaski / Amazon-mws-nodejs-sdk

Apache License 2.0
12 stars 13 forks source link

finances module authentication failed #19

Open Xyifeng opened 7 years ago

Xyifeng commented 7 years ago

I wrote the "finances ListFinancialEventGroups" module according to your logic, but there was an error in authentication failure ` ListFinancialEventGroups: function(config, params, xml, cb) { if (typeof xml == 'function') { cb = xml; xml = false; } else if (typeof xml == 'undefined') { console.warn("No callback provided. Throwing the request"); return; } //必传参数检测 if (!_.has(params, 'FinancialEventGroupStartedAfter')) { cb({ "Error": "You need to pass parameter FinancialEventGroupStartedBefore" }, null); return; }

    var parameters = {            
        //开始日期
        'FinancialEventGroupStartedAfter': params['FinancialEventGroupStartedAfter']
    };

    if (_.has(params, 'FinancialEventGroupStartedBefore')) {
        //结束日期
        parameters['FinancialEventGroupStartedBefore'] = params['FinancialEventGroupStartedBefore'];
    }

    if (_.has(params, 'MaxResultsPerPage')) {
        //每页返回的最大结果数
        parameters['MaxResultsPerPage'] = params['MaxResultsPerPage'];
    }

    mws.createRequest({
        'action': 'ListFinancialEventGroups',
        'config': config,
        'parameters': parameters,
        'type': 'Finances',
        "xml": xml
    }, function(err, data) {
        cb(err, data);
    });
}`
bhushankummar commented 5 years ago

@Xyifeng Here is the workaround available. https://www.npmjs.com/package/amazon-mws