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.customer
.update(id, customer)
.request((error: any, result: any) => {
if (error) return reject(error);
resolve(result.customer as Customer);
});
});
return new Promise((resolve, reject) => {
chargebee.customer
.create(customer)
.request((error: any, result: Customer) => {
if (error) return reject(error);
const stripeCustomerId = result.customer.id;
updateOrganization(organizationId, { stripeCustomerId })
.then(() => {
resolve(result);
})
.catch(error => reject(error));
});
});
};
new Promise((resolve, reject) => {
chargebee.customer.retrieve(id).request((error: any, result: any) => {
if (error) return reject(error);
resolve(result.customer as Customer);
});
});