Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 703571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:50:45+00:00 2026-05-14T03:50:45+00:00

I need an elegant way to implement credit-based purchases for an online store with

  • 0

I need an elegant way to implement credit-based purchases for an online store with a small variety of products which can be purchased using virtual credit or real currency. Alternatively, products could only be priced in credits.

Previous work

I have implemented credit-based purchasing before using different product types (eg. Credit, Voucher or Music) with post-order processing to assign purchased credit to users in the form of real currency, which could subsequently be used to discount future orders’ charge totals.

This worked fairly well as a makeshift solution, but did not succeed in disconnecting the virtual currency from the real currency, which is what I’d like to do, since spending credits is psychologically easier for customers than spending real currency.

Design

I need guidance on designing the database correctly with support for the simultaneous bulk purchase of credits at a discount along with real currency products. Alternatively, should all products be priced in credits and only credit have a real currency value?

Existing Database Design

Partial Products table:

  • ProductId
  • Title
  • Type
  • UnitPrice
  • SalePrice

Partial Orders table:

  • OrderId
  • UserId (related to Users table, not shown)
  • Status
  • Value
  • Total

Partial OrderItems table (similar to CartItems table):

  • OrderItemId
  • OrderId (related to Orders table)
  • ProductId (related to Products table)
  • Quantity
  • UnitPrice
  • SalePrice

Prospective UserCredits table:

  • CreditId
  • UserId (related to Users table, not shown)
  • Value (+/- value. Summed over time to determine saldo.)
  • Date

I’m using ASP.NET MVC and LINQ-to-SQL on a SQL Server database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:50:45+00:00Added an answer on May 14, 2026 at 3:50 am

    You don’t pay your suppliers in Credits, so from an internal accounting perspective it would be better to hold only hard cash values (USD, UKP, whatever) against your products.

    When displaying to your site’s users you need a currency conversion table which translates hard prices into vouchers. Separating the data model from the front end display is a key design strategy. Whether you decide to show both real cash price and virtual credit price or just the credit valuation should have no bearing on how the data is stored in the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to implement vector clocks in a small programming exercise and I decided
Is there an elegant way to write an insert statement, which has a lot
I need to find 2 elegant complete implementations of public static DateTime AddBusinessDays(this DateTime
Need to call a filter function on some options based on a radio selected
I am thinking about elegant way to encapsulate WinAPI callbacks inside a class. Suppose
When parsing text, I frequently need to implement mini-state-machines, in the generic form following
I have a fairly simple requirement for a query API which I need to
I am working in a small educational project where we have to implement a
I have to design and implement a way to deal with long running processes
I need to implement the following pattern in php: class EventSubscriber { private $userCode;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.