Skip to content
Open
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
8 changes: 5 additions & 3 deletions src/shared/services/payment-info.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ export class PaymentInfoService {
if (!dto.asset) throw new NotFoundException('Asset not found');
if (jwt && !dto.asset.isBuyableOn(jwt.blockchains)) throw new BadRequestException('Asset blockchain mismatch');

// Credit card payments disabled
if ('paymentMethod' in dto && dto.paymentMethod === FiatPaymentMethod.CARD) {
if (!dto.currency.cardSellable) throw new BadRequestException('Currency not sellable via Card');
if (!dto.asset.cardBuyable) throw new BadRequestException('Asset not buyable via Card');
} else if ('paymentMethod' in dto && dto.paymentMethod === FiatPaymentMethod.INSTANT) {
throw new BadRequestException('Credit card payments are currently disabled');
}

if ('paymentMethod' in dto && dto.paymentMethod === FiatPaymentMethod.INSTANT) {
if (!dto.currency.instantSellable) throw new BadRequestException('Currency not sellable via Instant');
if (!dto.asset.instantBuyable) throw new BadRequestException('Asset not buyable via Instant');
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export enum QuoteError {
LIMIT_EXCEEDED = 'LimitExceeded',
NATIONALITY_NOT_ALLOWED = 'NationalityNotAllowed',
NAME_REQUIRED = 'NameRequired',
PAYMENT_METHOD_NOT_ALLOWED = 'PaymentMethodNotAllowed',
VIDEO_IDENT_REQUIRED = 'VideoIdentRequired',
IBAN_CURRENCY_MISMATCH = 'IbanCurrencyMismatch',
TRADING_NOT_ALLOWED = 'TradingNotAllowed',
Expand Down
17 changes: 5 additions & 12 deletions src/subdomains/supporting/payment/services/transaction-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -826,13 +826,14 @@ export class TransactionHelper implements OnModuleInit {
if (!DisabledProcess(Process.TRADE_APPROVAL_DATE) && user?.userData && !user.userData.tradeApprovalDate)
return QuoteError.TRADING_NOT_ALLOWED;

// Credit card payments disabled
if (paymentMethodIn === FiatPaymentMethod.CARD) return QuoteError.PAYMENT_METHOD_NOT_ALLOWED;

if (isSell && ibanCountry && !to.isIbanCountryAllowed(ibanCountry)) return QuoteError.IBAN_CURRENCY_MISMATCH;

if (
nationality &&
((isBuy && !nationality.bankEnable) ||
(paymentMethodIn === FiatPaymentMethod.CARD && !nationality.checkoutEnable) ||
((isSell || isSwap) && !nationality.cryptoEnable))
((isBuy && !nationality.bankEnable) || ((isSell || isSwap) && !nationality.cryptoEnable))
)
return QuoteError.NATIONALITY_NOT_ALLOWED;

Expand Down Expand Up @@ -870,14 +871,6 @@ export class TransactionHelper implements OnModuleInit {
if (user && txAmountChf > kycLimitChf) return QuoteError.LIMIT_EXCEEDED;

// verification checks
if (
paymentMethodIn === FiatPaymentMethod.CARD &&
user &&
!user.userData.completeName &&
!user.userData.verifiedName
)
return QuoteError.NAME_REQUIRED;

if (
txAmountChf > Config.tradingLimits.monthlyDefaultWoKyc &&
user?.userData?.accountType === AccountType.ORGANIZATION &&
Expand All @@ -886,7 +879,7 @@ export class TransactionHelper implements OnModuleInit {
return QuoteError.VIDEO_IDENT_REQUIRED;

if (
((isSell && to.name !== 'CHF') || paymentMethodIn === FiatPaymentMethod.CARD || isSwap) &&
((isSell && to.name !== 'CHF') || isSwap) &&
user &&
!user.userData.hasBankTxVerification &&
txAmountChf > Config.tradingLimits.monthlyDefaultWoKyc
Expand Down