UNPKG

@cocalc/server

Version:

CoCalc server functionality: functions used by either the hub and the next.js server

16 lines 557 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const client_1 = require("@cocalc/server/stripe/client"); const misc_1 = require("@cocalc/util/misc"); async function getCustomer(account_id) { if (!(0, misc_1.isValidUUID)(account_id)) { throw Error("invalid uuid"); } const stripe = new client_1.StripeClient({ account_id }); if (!(await stripe.get_customer_id())) { return {}; } return await stripe.get_customer(); } exports.default = getCustomer; //# sourceMappingURL=get-customer.js.map