Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new Promise((resolve, reject) => {
chargebee.payment_source
.list({
"customer_id[is]": id
})
.request((error: any, result: any) => {
if (error) return reject(error);
resolve(result.list as any);
});
});
new Promise((resolve, reject) => {
chargebee.payment_source
.create_card({
customer_id: id,
card
})
.request((error: any, result: any) => {
if (error) return reject(error);
resolve(result as any);
});
});
new Promise((resolve, reject) => {
chargebee.payment_source
.update_card(cardId, data)
.request((error: any, result: any) => {
if (error) return reject(error);
resolve(result as any);
});
});