Skip to content

Commit 81a0da4

Browse files
committed
change error message for inactive credit card and fix payment creation logic
1 parent 8b2b0ee commit 81a0da4

3 files changed

Lines changed: 8 additions & 10 deletions

File tree

packages/apps/job-launcher/server/src/common/constants/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
export enum ErrorJob {
55
NotFound = 'Job not found',
66
NotCreated = 'Job has not been created',
7-
NotActiveCard = 'Credit card not found',
7+
NotActiveCard = 'Credit card not found. Please, add a credit card to your account.',
88
ManifestNotFound = 'Manifest not found',
99
ManifestValidationFailed = 'Manifest validation failed',
1010
ResultNotFound = 'Result not found',

packages/apps/job-launcher/server/src/modules/job/job.service.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -878,13 +878,6 @@ export class JobService {
878878
});
879879
}
880880

881-
const paymentEntity = await this.paymentService.createWithdrawalPayment(
882-
user.id,
883-
totalPaymentAmount,
884-
dto.paymentCurrency,
885-
paymentCurrencyRate,
886-
);
887-
888881
const { createManifest } = this.createJobSpecificActions[requestType];
889882

890883
let jobEntity = new JobEntity();
@@ -923,6 +916,13 @@ export class JobService {
923916
jobEntity.manifestHash = hash;
924917
}
925918

919+
const paymentEntity = await this.paymentService.createWithdrawalPayment(
920+
user.id,
921+
totalPaymentAmount,
922+
dto.paymentCurrency,
923+
paymentCurrencyRate,
924+
);
925+
926926
jobEntity.chainId = chainId;
927927
jobEntity.reputationOracle = reputationOracle;
928928
jobEntity.exchangeOracle = exchangeOracle;

packages/apps/job-launcher/server/src/modules/whitelist/whitelist.service.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ export class WhitelistService {
66
constructor(private readonly whitelistRepository: WhitelistRepository) {}
77

88
async isUserWhitelisted(userId: number): Promise<boolean> {
9-
// TODO: Enable it when billing system is active
10-
return true;
119
const user = await this.whitelistRepository.findOneByUserId(userId);
1210
return !!user;
1311
}

0 commit comments

Comments
 (0)