Link to home
Start Free TrialLog in
Avatar of pcalabria
pcalabriaFlag for United States of America

asked on

Need to add shopping cart and payment gateway to my website

I have a lot of experience programming in MS Access VBA and some experience with classic ASP.

I created a website using classic ASP many years ago which uses MS SQL Server as the backend database engine.

Website visitors can enter a part number in a search box I generated and view a list of parts that are returned as search results.

I would like to add a shopping cart and payment gateway to my existing website but do not know where to start.
My existing code determines the item, quantity, and part number that the buyer wants to purchase.

It seems that I should be able to obtain a collection of pages that I can add to my site that will create the shopping cart and provide a payment gateway.
I should have no trouble integrating this "shopping cart code" with my existing code if it allows me to GET or POST to pass data.

Can anyone suggest a product I can use or someone I can hire to complete the project?

Thanks
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

I will have to look for my code.

What you will do is every time somebody selects an item to purchase, add the item id and quantity to the cart. The cart can be a session variable, cookie, or a table in your database and use something like a timestamp with session id as the unique identifier.   Store the data as text that you can extract in pairs.   cart = "123|1][456|2"  This code has 2 items.  product id 123 and 1 qty.  The next item in the cart is product id 456 and 2 qty.

Then on any page such as check out where you need to show the item name and price, use split to convert to an array..

items = split(cart,"]["   creates an array where the first items is "123|1" and the second is "456|2".  Loop through this array with a for each.

Then to get the individual items split again.  item  = split(arrayItems(0) ,"|") and qty = split(arrayItems(1) ,"|").

Lastly, access your database for the item id to look up the name and price. From there you can do the rest.

That is all the cart is.  Using cookies, local storage or the database is a better option for storing the cart data than a session because sessions can die in asp leaving a bad experience.

When it comes time to pay, you will have a page with your items and qty, price and final totals. This should all be calculated and not stored. When payment is submitted, only submit the item id and qty.  Then re do your calculations on the back end processing asp page before submitting to your credit card processor.  The reason is if you submit the price directly, then that data can be manipulated by the user and you could end up selling a $100 item for $1.   This does get a little more confusing if you are using one of the api's for credit card processing that does not require you to be pci compliant. This is because you are sending data directly to the processor instead of going through your server. Cross that bridge when you get there. It is easy to overcome.
Avatar of pcalabria

ASKER

Thanks Scott..

I thought about coding it myself.. but I haven't written code in classic asp for years.. I'm hoping to find some code that I can make work with my existing code..or someone to do it for me! Lol
SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@josh Thank you. I will look for the message.

I have no trouble coding the shopping cart portion, if that makes sense, however the payment gateway is something I'm completely unfamiliar with.

Is the payment gateway part of the WPB and woo commerce systems?
For any of the ready made carts like woo, open cart, shopify and the rest, all you need to bring is your credentials for the gateway you were provided by your processor.   Today, some processors also have their own gateway, but if you can stick to one of the more common gateways like authorize.net there will not be an issue.

https://docs.woocommerce.com/document/premium-payment-gateway-extensions/
https://docs.woocommerce.com/documentation/plugins/woocommerce/getting-started/sell-products/core-payment-options/
https://woocommerce.com/product-category/woocommerce-extensions/payment-gateways/