diff --git a/src/providers/sdk/chargebee/charge-bee.service.ts b/src/providers/sdk/chargebee/charge-bee.service.ts index 0d8d2a6..f98e19c 100644 --- a/src/providers/sdk/chargebee/charge-bee.service.ts +++ b/src/providers/sdk/chargebee/charge-bee.service.ts @@ -58,7 +58,6 @@ export class ChargeBeeService implements IChargeBeeService { .request(); return this.customerAdapter.convert(result.customer); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -68,7 +67,6 @@ export class ChargeBeeService implements IChargeBeeService { const result = await chargebee.customer.retrieve(customerId).request(); return this.customerAdapter.convert(result.customer); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -104,7 +102,6 @@ export class ChargeBeeService implements IChargeBeeService { await chargebee.customer.update(customerId, transformedDto).request(); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -113,7 +110,6 @@ export class ChargeBeeService implements IChargeBeeService { try { await chargebee.customer.delete(customerId).request(); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -136,7 +132,6 @@ export class ChargeBeeService implements IChargeBeeService { return this.paymentSource.convert(result.payment_source); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -176,7 +171,6 @@ export class ChargeBeeService implements IChargeBeeService { .request(); return this.invoiceAdapter.convert(result.invoice); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -189,7 +183,6 @@ export class ChargeBeeService implements IChargeBeeService { .request(); return this.paymentSource.convert(result.payment_source); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -197,7 +190,6 @@ export class ChargeBeeService implements IChargeBeeService { try { await chargebee.payment_source.delete(paymentSourceId).request(); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -229,7 +221,6 @@ export class ChargeBeeService implements IChargeBeeService { .request(); return this.invoiceAdapter.convert(result.invoice); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -238,7 +229,6 @@ export class ChargeBeeService implements IChargeBeeService { const result = await chargebee.invoice.retrieve(invoiceId).request(); return this.invoiceAdapter.convert(result.invoice); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -264,7 +254,6 @@ export class ChargeBeeService implements IChargeBeeService { .request(); return this.invoiceAdapter.convert(result.invoice); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } @@ -272,16 +261,14 @@ export class ChargeBeeService implements IChargeBeeService { try { await chargebee.invoice.delete(invoiceId).request(); } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } async getPaymentStatus(invoiceId: string): Promise { try { const result = await chargebee.invoice.retrieve(invoiceId).request(); - return result.invoice.status === 'paid' ? true : false; + return result.invoice.status === 'paid'; } catch (error) { - console.log(error); throw new Error(JSON.stringify(error)); } } diff --git a/src/providers/sdk/chargebee/type/customer.type.ts b/src/providers/sdk/chargebee/type/customer.type.ts index 6665d3a..972e06b 100644 --- a/src/providers/sdk/chargebee/type/customer.type.ts +++ b/src/providers/sdk/chargebee/type/customer.type.ts @@ -2,7 +2,7 @@ import {TCustomer} from '../../../../types'; import {IAddressDto} from './invoice.type'; export interface IChargeBeeCustomer extends TCustomer { - company?: string | undefined; - phone?: string | undefined; - billingAddress?: IAddressDto | undefined; + company?: string; + phone?: string; + billingAddress?: IAddressDto; } diff --git a/src/providers/sdk/chargebee/type/invoice.type.ts b/src/providers/sdk/chargebee/type/invoice.type.ts index e0c7466..0ef41fb 100644 --- a/src/providers/sdk/chargebee/type/invoice.type.ts +++ b/src/providers/sdk/chargebee/type/invoice.type.ts @@ -17,18 +17,18 @@ export interface IChargeBeeInvoice extends TInvoice { } export interface IAddressDto { - firstName?: string | undefined; - lastName?: string | undefined; - email?: string | undefined; - company?: string | undefined; - phone?: string | undefined; + firstName?: string; + lastName?: string; + email?: string; + company?: string; + phone?: string; line1?: string; line2?: string; line3?: string; - city?: string | undefined; - state?: string | undefined; - zip?: string | undefined; - country?: string | undefined; + city?: string; + state?: string; + zip?: string; + country?: string; } export interface ICharge { diff --git a/src/types.ts b/src/types.ts index a46f24e..57f0e9e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -74,15 +74,15 @@ export interface TCustomer { export interface TAddress { id?: string; - firstName?: string | undefined; - lastName?: string | undefined; - email?: string | undefined; - company?: string | undefined; - phone?: string | undefined; - city?: string | undefined; - state?: string | undefined; - zip?: string | undefined; - country?: string | undefined; + firstName?: string; + lastName?: string; + email?: string; + company?: string; + phone?: string; + city?: string; + state?: string; + zip?: string; + country?: string; options?: Options; }