Skip to content

Commit 1a621af

Browse files
committed
Lint
1 parent df8a23a commit 1a621af

3 files changed

Lines changed: 15 additions & 17 deletions

File tree

src/billing/cloudpayments.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ import PlanModel from '../models/plan';
4545
import { ClientApi, ClientService, CustomerReceiptItem, ReceiptApi, ReceiptTypes, TaxationSystem } from 'cloudpayments';
4646
import { ComposePaymentPayload } from './types/composePaymentPayload';
4747

48-
4948
interface ComposePaymentRequest extends express.Request {
5049
query: ComposePaymentPayload & { [key: string]: any };
51-
context: import('../types/graphql').ResolverContextBase
50+
context: import('../types/graphql').ResolverContextBase;
5251
};
5352

5453
/**
@@ -129,13 +128,13 @@ export default class CloudPaymentsWebhooks {
129128
await this.getMember(userId, workspace);
130129
} catch (e) {
131130
const error = e as Error;
132-
131+
133132
this.sendError(res, 1, `[Billing / Compose payment] Can't compose payment due to error: ${error.toString()}`, req.query);
134-
133+
135134
return;
136135
}
137136
const invoiceId = this.generateInvoiceId(tariffPlan, workspace);
138-
137+
139138
const isCardLinkOperation = workspace.tariffPlanId.toString() === tariffPlanId && !this.isPlanExpired(workspace);
140139

141140
let checksum;
@@ -150,7 +149,7 @@ export default class CloudPaymentsWebhooks {
150149
userId: userId,
151150
tariffPlanId: tariffPlan._id.toString(),
152151
shouldSaveCard: shouldSaveCard === 'true',
153-
}
152+
};
154153

155154
checksum = await checksumService.generateChecksum(checksumData);
156155
} catch (e) {
@@ -187,9 +186,8 @@ export default class CloudPaymentsWebhooks {
187186
planExpiracyDate = lastChargeDate.setDate(lastChargeDate.getDate() + 1);
188187
} else {
189188
planExpiracyDate = lastChargeDate.setMonth(lastChargeDate.getMonth() + 1);
190-
191189
}
192-
190+
193191
const isPlanExpired = planExpiracyDate < Date.now();
194192

195193
return isPlanExpired;
@@ -803,7 +801,7 @@ export default class CloudPaymentsWebhooks {
803801
tariffPlanId: workspace.tariffPlanId.toString(),
804802
userId,
805803
shouldSaveCard: false,
806-
isCardLinkOperation: false
804+
isCardLinkOperation: false,
807805
};
808806
}
809807

src/resolvers/billingNew.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ export default {
138138
*/
139139
async payWithCard(_obj: undefined, args: PayWithCardArgs, { factories, user }: ResolverContextWithUser): Promise<any> {
140140
const paymentData = checksumService.parseAndVerifyChecksum(args.input.checksum);
141-
141+
142142
if (!('tariffPlanId' in paymentData)) {
143143
throw new UserInputError('Invalid checksum');
144144
}
145-
145+
146146
const fullUserInfo = await factories.usersFactory.findById(user.id);
147147

148148
const workspace = await factories.workspacesFactory.findById(paymentData.workspaceId);

src/utils/checksumService.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ interface PlanPurchaseChecksumData {
2424

2525
interface CardLinkChecksumData {
2626
/**
27-
* Workspace Identifier
28-
*/
27+
* Workspace Identifier
28+
*/
2929
workspaceId: string;
3030
/**
3131
* Id of the user making the payment
@@ -66,15 +66,15 @@ class ChecksumService {
6666
return {
6767
workspaceId: payload.workspaceId,
6868
userId: payload.userId,
69-
isCardLinkOperation: payload.isCardLinkOperation
70-
}
69+
isCardLinkOperation: payload.isCardLinkOperation,
70+
};
7171
} else {
7272
return {
7373
workspaceId: payload.workspaceId,
7474
userId: payload.userId,
7575
tariffPlanId: payload.tariffPlanId,
76-
shouldSaveCard: payload.shouldSaveCard
77-
}
76+
shouldSaveCard: payload.shouldSaveCard,
77+
};
7878
}
7979
}
8080
}

0 commit comments

Comments
 (0)