From 51f7269e69d22b5ff505eb2a916b1d35b8b42c42 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 28 Jun 2025 11:40:24 -0600 Subject: [PATCH] Fix error when no saved cards --- plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);