Fix error when no saved cards
This commit is contained in:
parent
f93632949e
commit
51f7269e69
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user