paidup-commerce-connect
Advanced tools
Comparing version 0.14.13 to 0.14.14
@@ -31,2 +31,12 @@ module.exports = { | ||
required: true | ||
}, | ||
fromDate: { | ||
example: '2016-01-01', | ||
description: 'start date query', | ||
required: false | ||
}, | ||
toDate: { | ||
example: '2016-06-01', | ||
description: 'end date query', | ||
required: false | ||
} | ||
@@ -146,23 +156,33 @@ }, | ||
var config = { | ||
url: '/api/v3/commerce/order/organization/' + inputs.organizationId + '/' + inputs.limit + '/' + inputs.sort, | ||
baseUrl: inputs.baseUrl, | ||
method: 'get', | ||
token: inputs.token | ||
try { | ||
var from = inputs.fromDate ? new Date(inputs.fromDate).toISOString().substr(0, 10) : new Date().getFullYear() + '-01-01'; | ||
var to = inputs.toDate ? new Date(inputs.toDate).toISOString().substr(0, 10) : new Date().toISOString().substr(0, 10); | ||
var config = { | ||
url: '/api/v3/commerce/order/organization/' + inputs.organizationId + '/' + inputs.limit + '/' + inputs.sort , | ||
//+'/'+from+'/'+to, | ||
baseUrl: inputs.baseUrl, | ||
method: 'get', | ||
token: inputs.token | ||
} | ||
Connector.request(config, {}, {}, function (err, resp) { | ||
if (err) { | ||
return exits.error({ | ||
status: err.status, | ||
message: JSON.stringify(err.message) | ||
}) | ||
} else { | ||
return exits.success({ | ||
status: resp.status, | ||
body: resp.body | ||
}) | ||
} | ||
}) | ||
} catch (error) { | ||
return exits.error({ | ||
status: 500, | ||
message: JSON.stringify(err) | ||
}) | ||
} | ||
Connector.request(config, {}, {}, function (err, resp) { | ||
if (err) { | ||
return exits.error({ | ||
status: err.status, | ||
message: JSON.stringify(err.message) | ||
}) | ||
} else { | ||
return exits.success({ | ||
status: resp.status, | ||
body: resp.body | ||
}) | ||
} | ||
}) | ||
} | ||
} |
{ | ||
"name": "paidup-commerce-connect", | ||
"version": "0.14.13", | ||
"version": "0.14.14", | ||
"description": "Connector for PaidUp Microservice Commerce", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93239
3123