@@ -341,36 +341,36 @@ export default class CloudPaymentsWebhooks {
341341 return ;
342342 }
343343
344- let accountId = workspace . accountId ;
345-
346- try {
347- if ( ! workspace . accountId ) {
348- accountId = ( await context . accounting . createAccount ( {
349- name : `WORKSPACE:${ workspace . name } ` ,
350- type : AccountType . LIABILITY ,
351- currency : Currency . RUB ,
352- } ) ) . recordId ;
353- await workspace . setAccountId ( accountId ) ;
354- }
355-
356- await context . accounting . payOnce ( {
357- accountId : accountId ,
358- amount : tariffPlan . monthlyCharge * PENNY_MULTIPLIER ,
359- description : `Account replenishment to pay for the tariff plan with id ${ tariffPlan . _id } . CloudPayments transaction ID: ${ body . TransactionId } ` ,
360- } ) ;
361-
362- await context . accounting . purchase ( {
363- accountId,
364- amount : tariffPlan . monthlyCharge * PENNY_MULTIPLIER ,
365- description : `Charging for tariff plan with id ${ tariffPlan . _id } . CloudPayments transaction ID: ${ body . TransactionId } ` ,
366- } ) ;
367- } catch ( e ) {
368- const error = e as Error ;
369-
370- this . sendError ( res , PayCodes . SUCCESS , `[Billing / Pay] Error while creating operations in accounting ${ error . toString ( ) } ` , body ) ;
371-
372- return ;
373- }
344+ // let accountId = workspace.accountId;
345+
346+ // try {
347+ // if (!workspace.accountId) {
348+ // accountId = (await context.accounting.createAccount({
349+ // name: `WORKSPACE:${workspace.name}`,
350+ // type: AccountType.LIABILITY,
351+ // currency: Currency.RUB,
352+ // })).recordId;
353+ // await workspace.setAccountId(accountId);
354+ // }
355+
356+ // await context.accounting.payOnce({
357+ // accountId: accountId,
358+ // amount: tariffPlan.monthlyCharge * PENNY_MULTIPLIER,
359+ // description: `Account replenishment to pay for the tariff plan with id ${tariffPlan._id}. CloudPayments transaction ID: ${body.TransactionId}`,
360+ // });
361+
362+ // await context.accounting.purchase({
363+ // accountId,
364+ // amount: tariffPlan.monthlyCharge * PENNY_MULTIPLIER,
365+ // description: `Charging for tariff plan with id ${tariffPlan._id}. CloudPayments transaction ID: ${body.TransactionId}`,
366+ // });
367+ // } catch (e) {
368+ // const error = e as Error;
369+
370+ // this.sendError(res, PayCodes.SUCCESS, `[Billing / Pay] Error while creating operations in accounting ${error.toString()}`, body);
371+
372+ // return;
373+ // }
374374
375375 try {
376376 await publish ( 'cron-tasks' , 'cron-tasks/limiter' , JSON . stringify ( {
0 commit comments