PHP
  Home arrow PHP arrow Page 7 - Building an E-Commerce Site Part 3: Catalogs and Shopping Carts
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
PHP

Building an E-Commerce Site Part 3: Catalogs and Shopping Carts
By: Ying Zhang
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 48
    2000-06-08


    Table of Contents:
  • Building an E-Commerce Site Part 3: Catalogs and Shopping Carts
  • Assumptions and Requirements
  • Overview of The Process
  • MyMarket Shopping Experience
  • The Product Catalog
  • The Shopping Cart
  • Payment Processing
  • Step 1: Database Changes
  • Step 2: Extracting the New Scripts
  • Step 3: General Script Changes from Tutorial 2
  • Step 4: New Shopping Scripts
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Building an E-Commerce Site Part 3: Catalogs and Shopping Carts - Payment Processing
    ( Page 7 of 12 )

    Payment processing is the part of this tutorial that I can't really write code to explain. The reason is that each transaction clearing / payment processing company is different. The basic idea is this:

    1. Your PHP script sends billing information to the transaction clearing company. This basically includes the customer's name, address, credit card information, and the amount to charge.
    2. The transaction clearing company will verify (1) that the credit card information is valid and (2) there are sufficient funds for the purchase. If all goes well, the customer's credit card is billed for the purchase amount and a result is sent back to your script.
    3. Your script takes the result of the transaction and determine what should be done. If it was successful, do whatever else is necessary to fulfill the order. If payment did not go through, have the customer re-enter their payment information.

    That is the process when you use a processing company that does real-time payment authorization. The other option is to do batch processing where you gather up all the orders and process a together at some later time -- something for you to think about.

    Anyhow, there are lots of payment processing companies. You can search the web for a list of them, for example, you can look at a Yahoo directory of these places:

    http://dir.yahoo.com/Business_and_Economy/Business_to_Business/ Financial_Services/Transaction_Clearing/

    There's lots of them, so you will have to pick one that meets your needs and follow their documentation to get your scripts working properly.

    Some tips:

    • PHP4 has Cybercash support (can anyone share their experience with this?)
    • PHP cannot natively make outgoing HTTPS requests, so if you need to be able to do that, you will have to call another program to do it (like CURL or maybe write a Perl script)

    The sample script (shopping/complete_order.php) included here will by default assume that the transaction was authorized (see the authorize_payment() function). You will have to modify this function according to how your payment processing company works. Basically it should return true or false, depending on if the transaction was approved or not. You will have to extend it to meet your needs.

    Order Fulfillment

    Once you've accepted payment for the products that were ordered, you have to get them to the customer. If you are selling physical goods, this means getting the products from your warehouse shipped to the customer. If you are selling something software, you have to let the customer download what they ordered, or supply them with the serial number. Whatever, is relevant in your case.

    Again this is a topic we won't dicuss too much because it depends on how your operation is setup.

    That's enough theory for now, you must be bored :) So let's get on to the database changes and then we will look at the new scripts. On with the show!



     
     
    >>> More PHP Articles          >>> More By Ying Zhang
     

       

    PHP ARTICLES

    - Getting Data from Yahoo Site Explorer Inboun...
    - Method Chaining: Adding More Selecting Metho...
    - How to Split a File During an FTP Upload Usi...
    - Expanding a Custom CodeIgniter Library with ...
    - Using the Yahoo Site Explorer Inbound Links ...
    - Building a CodeIgniter Custom Library with M...
    - Building an E-mini Trading System Using PHP ...
    - Completing the MySQL Class with Method Chain...
    - Building Dynamic Queries with Chainable Meth...
    - PHP Encryption and Decryption Methods
    - Building a MySQL Abstraction Class with Meth...
    - Completing a Sample String Processor with Me...
    - Mastering WHILE Loops for PHP and MySQL
    - Method Chaining: Adding More Methods to the ...
    - Method Chaining in PHP 5





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek