@adyen/api-library
Version:
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
32 lines • 1.46 kB
JavaScript
;
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
Object.defineProperty(exports, "__esModule", { value: true });
async function getJsonResponse(resource, jsonRequest, requestOptions = {}) {
const request = typeof jsonRequest === "string" ? jsonRequest : JSON.stringify(jsonRequest);
const response = await resource.request(request, requestOptions);
try {
return typeof response === "string" ? JSON.parse(response) : response;
}
catch (e) {
return response;
}
}
exports.default = getJsonResponse;
//# sourceMappingURL=getJsonResponse.js.map