in SmartCoolerCharge/index.js [41:59]
function charge(payload, headers) {
// console.log('-------------[Charge]-------------');
client.apiCall({
method: 'POST',
urlFragment: 'in-store/v1/charge',
payload: payload,
headers: headers
}).then(function (result) {
console.log('statusCode=' + result.statusCode);
const responseObject = JSON.parse(result.body);
console.dir(responseObject, { depth: null });
callback(null, responseObject);
}).catch(err => {
console.error('statusCode=' + err.statusCode);
console.dir(JSON.parse(err.body), { depth: null });
const errorObject = JSON.parse(err.body);
callback(null, errorObject);
});
}