CardSwap – A Multi-Currency Gift Card Exchange Platform

A case study detailing the project's challenges, solutions, and outcomes.

Gift Card Exchange Platform - Project Overview

Project Title:

CardSwap – A Multi-Currency Gift Card Exchange Platform

Project Description:

CardSwap is a full-stack web application that allows users to sell their unused gift cards for cash. The platform supports multiple currencies (USD, GBP, EUR, NGN) and dynamically calculates exchange rates based on card type, country, and value. Users can submit physical cards or e-codes, track transactions, and withdraw funds via bank transfer or cryptocurrency.

Built with Django (Python) for the backend and Bootstrap 5 for the frontend, the platform features:
✅ Multi-currency wallet system
✅ Dynamic pricing engine
✅ Admin dashboard for fraud detection
✅ Email verification for withdrawals
✅ Responsive dark-mode UI

Live Demo: https://giftcard.lagoswebdev.com 
GitHub Repo: https://github.com/Teejayskillz/giftcard


Key Features

1. User Authentication & Profiles

  • Secure registration/login with email verification.

  • KYC integration for high-value transactions.

  • Dashboard showing wallet balances, transaction history, and pending submissions.

2. Gift Card Submission Flow

  • Step 1: Select card type (Amazon, Apple, Steam, etc.).

  • Step 2: Enter card details (value, PIN, images for physical cards).

  • Step 3: Real-time offer calculation based on:

    • Card value range (e.g., $20–$50 = ₦800/$, $100+ = ₦1200/$).

    • Country-specific rates (US vs. UK Apple cards).

  • Step 4: Submission tracking (Pending → Approved → Paid).

3. Multi-Currency Wallet

  • Supports NGN, USD, GBP, EUR.

  • Auto-conversion rules (e.g., "Convert USD to NGN at 90% market rate").

  • Withdrawal requests with email verification.

4. Admin Panel

  • Approve/reject submissions.

  • Detect fraud (duplicate card submissions).

  • Set exchange rates manually or via API.

5. Security

  • CSRF protection.

  • Two-factor authentication for withdrawals.

  • Automated email alerts for suspicious activity.


Technical Stack

Backend

  • Django (Python) – Core framework.

  • MysqlSQL – Database for transactions.

  • Celery – Async tasks (email, rate updates).

  • Django REST Framework – API endpoints for AJAX.

Frontend

  • Bootstrap 5 – Responsive dark-mode UI.

  • JavaScript (Vanilla) – Dynamic form validation.

  • Chart.js – Transaction analytics.

APIs & Integrations

  • Fixer.io – Live currency exchange rates.

  • Paystack/Flutterwave – Payout processing.

  • Google reCAPTCHA – Anti-bot protection.

 


Challenges & Solutions

1. Dynamic Pricing Complexity

Problem: Rates vary by card type, country, and value range.
Solution: Built a rule engine using Django’s Q objects to match submissions with optimal rates.

2. Multi-Currency Math Errors

Problem: Floating-point precision issues in financial calculations.
Solution: Used Python’s Decimal for all monetary operations.

3. Fraud Prevention

Problem: Users submitting duplicate or invalid cards.
Solution: Implemented:

  • Image hashing for physical card photos.

  • Automated checks against a blacklist of known bad cards.


Lessons Learned

  • Financial apps demand extreme precision – Discovered Django’s DecimalField was essential for accurate calculations.

  • User trust is critical – Added transparent status updates (e.g., "Your Apple gift card is being reviewed").

  • Rate flexibility matters – Allowed admins to tweak rates without code changes via the dashboard.


Future Improvements

  • Mobile App – React Native version for iOS/Android.

  • Bulk Submissions – Allow users to upload multiple cards at once.

  • Affiliate Program – Reward users for referrals.


Why This Project Stands Out

Unlike basic gift card markets, CardSwap handles multi-currency conversions, automated fraud checks, and real-time pricing—making it a scalable solution for global users.


Back to All Projects