Receiving and storing credit card details w/SSL

Discussion in 'PHP' started by blueparukia, Jul 6, 2008.

  1. #1
    Right, I have a shopping cart all finished and set up, and need a way to process the credit card details and store them securely for later access.

    The site has an SSL certificate.

    So say I set up the HTML code like:

    
    <form action="process.php" method="post">
        <fieldset>
            <input type="text" name="ccnumber"/>
            <input type="submit" />
        </fieldset>
    </form>
    
    Code (markup):
    I want to add the credit card details - to the existing database preferably - securely, but still able to access for later.

    Cheers,

    BP
     
    blueparukia, Jul 6, 2008 IP
  2. zerofill

    zerofill Member

    Messages:
    34
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #2
    I thought you had to be like CISP certified or something to store CC numbers? Atleast Visa anyway?
     
    zerofill, Jul 7, 2008 IP
  3. shallowink

    shallowink Well-Known Member

    Messages:
    1,218
    Likes Received:
    64
    Best Answers:
    2
    Trophy Points:
    150
    #3
    OSCommerce gets around this by storing the first and last digit sets and allowing the middle set to be sent to an email address. Storing the complete cc number is against the payment gateways/CCs TOS. And I wouldn't want the liability of storing the CC #s anyway.
     
    shallowink, Jul 7, 2008 IP
  4. ipro

    ipro Active Member

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    you can save the numbers to a file like this

    
    if(isset($_POST["ccnumber"))
    {
       $cc = $_POST["ccnumber"];
    
      $fp = fopen("db/order-".time().".txt", "x");
      fwrite($fp, $cc);
     fclose($fp);
    
    }
    
    PHP:
    that would be the most secure way.

    cheers
     
    ipro, Jul 7, 2008 IP
  5. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #5
    Storing in a text file?That seems secure...

    I am.

    Awesome. Thanks :D
     
    blueparukia, Jul 7, 2008 IP
  6. ahmadfarhan

    ahmadfarhan Peon

    Messages:
    211
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    PLEASE PLEASE PLEASE don store CC number in a text file.. It's not secure.. it's not even trying to be secure..

    in fact don't store CC at all.. let your payment processor do that kind of stuff
     
    ahmadfarhan, Jul 8, 2008 IP
  7. fouadz

    fouadz Peon

    Messages:
    132
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    sotring de cc number in a text file it's the worst thing you can do..
     
    fouadz, Jul 8, 2008 IP
  8. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You'd surely want them in an encrypted file, sitting on another machine which has no real Internet access. Isn't that default, to have an "offline" machine do the storing??
     
    Stomme poes, Jul 8, 2008 IP