Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawk.api",
"version": "1.1.13",
"version": "1.1.14",
"main": "index.ts",
"license": "UNLICENSED",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/billing/cloudpayments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import { ComposePaymentPayload } from './types/composePaymentPayload';

interface ComposePaymentRequest extends express.Request {
query: ComposePaymentPayload & { [key: string]: any };

Check warning on line 49 in src/billing/cloudpayments.ts

View workflow job for this annotation

GitHub Actions / ESlint

Unexpected any. Specify a different type
context: import('../types/graphql').ResolverContextBase;
};

Expand Down Expand Up @@ -173,7 +173,7 @@
});
}

/**

Check warning on line 176 in src/billing/cloudpayments.ts

View workflow job for this annotation

GitHub Actions / ESlint

Missing JSDoc @returns for function
* Generates invoice id for payment
*
* @param tariffPlan - tariff plan to generate invoice id
Expand All @@ -196,7 +196,7 @@
const context = req.context;
const body: CheckRequest = req.body;
let data;

console.log('💎 CloudPayments /check request', body);

try {
Expand Down Expand Up @@ -290,7 +290,7 @@
telegram.sendMessage(`✅ [Billing / Check] All checks passed successfully «${workspace.name}»`, TelegramBotURLs.Money)
.catch(e => console.error('Error while sending message to Telegram: ' + e));

HawkCatcher.send(new Error('[Billing / Check] All checks passed successfully'), body as any);

Check warning on line 293 in src/billing/cloudpayments.ts

View workflow job for this annotation

GitHub Actions / ESlint

Unexpected any. Specify a different type

res.json({
code: CheckCodes.SUCCESS,
Expand Down Expand Up @@ -609,7 +609,7 @@

this.handleSendingToTelegramError(telegram.sendMessage(`✅ [Billing / Fail] Transaction failed for «${workspace.name}»`, TelegramBotURLs.Money));

HawkCatcher.send(new Error('[Billing / Fail] Transaction failed'), body as any);

Check warning on line 612 in src/billing/cloudpayments.ts

View workflow job for this annotation

GitHub Actions / ESlint

Unexpected any. Specify a different type

res.json({
code: FailCodes.SUCCESS,
Expand Down Expand Up @@ -772,7 +772,7 @@
* @param errorText - error description
* @param backtrace - request data and error data
*/
private sendError(res: express.Response, errorCode: CheckCodes | PayCodes | FailCodes | RecurrentCodes, errorText: string, backtrace: { [key: string]: any }): void {

Check warning on line 775 in src/billing/cloudpayments.ts

View workflow job for this annotation

GitHub Actions / ESlint

Unexpected any. Specify a different type
res.json({
code: errorCode,
});
Expand Down Expand Up @@ -837,7 +837,7 @@
promise.catch(e => console.error('Error while sending message to Telegram: ' + e));
}

/**

Check warning on line 840 in src/billing/cloudpayments.ts

View workflow job for this annotation

GitHub Actions / ESlint

Missing JSDoc @returns for function
* Parses body and returns card data
* @param request - request body to parse
*/
Expand Down
8 changes: 7 additions & 1 deletion src/resolvers/workspace.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,13 @@ module.exports = {
throw new UserInputError('There is no subscription for provided workspace');
}

await cloudPaymentsApi.cancelSubscription(workspaceModel.subscriptionId);
try {
await cloudPaymentsApi.cancelSubscription(workspaceModel.subscriptionId);
} catch (err) {
console.log('\nლ(´ڡ`ლ) Error [resolvers:workspace:cancelSubscription]: \n\n', err, '\n\n');

throw new ApolloError('Unable to cancel subscription');
}

await workspaceModel.setSubscriptionId(null);

Expand Down
Loading