Skip to main content

Overview

PC Fix implements a flexible payment system that accepts multiple payment methods to maximize customer convenience and conversion rates. The platform supports online payments through MercadoPago, cryptocurrency payments via USDT, and traditional offline payment methods.

Supported Payment Methods

MercadoPago

Credit/debit cards and digital wallet payments

USDT Crypto

Tether (USDT) cryptocurrency via Binance

Bank Transfer

Traditional wire transfer with proof of payment

Cash

Cash on delivery or at pickup location

Viumi

Alternative digital payment platform

Offline

Manual payment verification by admin

MercadoPago Integration

Payment Preference Creation

MercadoPago is integrated as the primary online payment gateway. The system creates payment preferences with order details:
packages/api/src/shared/services/MercadoPagoService.ts

Webhook Processing

MercadoPago sends webhook notifications when payment status changes. The system processes these automatically:
packages/api/src/modules/sales/sales.service.ts
Webhooks are only configured in production environments to prevent issues during local development.

Dynamic Pricing

Payment Method Discounts

PC Fix offers an 8% discount for payments made outside of MercadoPago to offset transaction fees:
packages/api/src/modules/sales/sales.service.ts

Payment Method Updates

Customers can change their payment method before completing payment. Prices are recalculated automatically:
packages/api/src/modules/sales/sales.service.ts
Changing payment methods recalculates all line item prices and the total order amount. This happens in a database transaction to ensure consistency.

Cryptocurrency Payments (USDT)

Dynamic Exchange Rate

PC Fix accepts USDT (Tether) cryptocurrency payments. The exchange rate is automatically updated every 4 hours:
packages/api/src/shared/services/cron.service.ts

USDT Configuration

The system stores USDT payment information in the configuration:
packages/api/prisma/schema.prisma

Bank Transfer Payments

Bank Account Information

For traditional bank transfers, the system displays account details stored in configuration:
packages/api/prisma/schema.prisma

Payment Receipt Upload

Customers upload proof of payment which triggers admin review:
packages/api/src/modules/sales/sales.service.ts

Viumi Payment Platform

PC Fix also integrates with Viumi as an alternative payment processor:
packages/api/src/modules/sales/sales.service.ts

Order Status Flow

Payment States

packages/api/prisma/schema.prisma

Status Updates

When order status changes, customers receive email notifications:
packages/api/src/modules/sales/sales.service.ts
When orders are rejected or cancelled, inventory is automatically restored in a database transaction.

Payment Method Storage

Database Schema

packages/api/prisma/schema.prisma
The medioPago field stores the selected payment method:
  • MERCADOPAGO - MercadoPago payments
  • TRANSFERENCIA - Bank transfer
  • BINANCE - USDT cryptocurrency
  • EFECTIVO - Cash payment

Security Considerations

Webhook Verification

MercadoPago webhooks verified before processing

Receipt Validation

Payment receipts reviewed by admin before approval

Transaction Safety

All payment operations use database transactions

Stock Protection

Stock decremented only after payment confirmation

Environment Variables

Required environment variables for payment processing:

API Endpoints

The 8% discount for non-MercadoPago payments helps offset the cost of payment processor fees while incentivizing direct payment methods.