c++ program for credit card transaction.

Can anybody give me a sample program for credit card transaction? I don't have any idea on using credit cards. Thanks!
Last edited on
Can anybody give me a sample program for credit card transaction?

No, this isn't a "do my homework" site.

I don't have any idea on using credit cards

Well, they are used to buy things. You go to the store, grab what you want, and then get in line to buy it. The cashier puts all of your items through the scanner and gives you the total. You hand him/her the credit card, and he/she swipes it through the machine. If your card has enough credit on it, then the card is approved and you can buy the items.
1
2
3
4
5
6
7
8
if (check_card()=true) { // card is OK
  if card_has_enough_balance(payment_amount) { // card has enough balance to use it
    use_card_balance(payment_amount);  // make payment from the card balance
    tell_cashier_transaction_successful();
  }
} else {
  tell_to_customer_transaction_failed();
}


Now make the implemetations :)
Thanks eraggo!
If you can't help just shut up and go fuck yourself!

That'll get people to help you. Generally forum etiquette is to ask a question calmly and politely, describe your issue in a descriptive yet concise manner, tell what you've done already to resolve the issue, and post some related code to the issue.

You did none of these. From what I can tell, you want to handle real-life credit card transactions which isn't necessary an easy thing. You'll need to look into SSL, TCP, learn how credit card numbers are validated, etc. So giving a "sample" program of this is kind of an unrealistic request.

Now since this is in a beginner forum, it could be deduced that you are wanting just a simple simulation like eraggo posted, but you also gave no details so how could we know? Now go read this:
http://cplusplus.com/forum/beginner/1/
well; i'm sorry.
Topic archived. No new replies allowed.