diff --git a/plugin.js b/plugin.js index 7cf20dd..65bc10d 100644 --- a/plugin.js +++ b/plugin.js @@ -591,7 +591,7 @@ exports.init = function () { // Return all saved payment methods tied to the provided customer UUID. var methods = []; var response = await apiRequest(`v2/cards?reference_id=${customerUUID}`, {}, "GET"); - if (Object.keys(response).length == 0) { + if (Object.keys(response).length == 0 || typeof response.cards == "undefined") { return []; } console.log(response);