Update Database After Successful Purchase

General ShopSite user discussion

Update Database After Successful Purchase

Postby itsjimmy91 » Sat Dec 15, 2012 11:51 am

Hello,

I am just wondering if it is possible ( and if so, how ) to post information to my MySQL database after a successful purchase.

On my website, I have "credits" that a user can buy. They come in three different sizes. Upon clicking the Add to Cart button next to a certain pack of Credits, and going through the payment process, I would like to update the user's credits total in my database. I'm just not really sure how I'm going to have to do this. Any help to get me started would be much appreciated.

Thanks.
itsjimmy91
 
Posts: 2
Joined: Sat Dec 15, 2012 11:48 am

Re: Update Database After Successful Purchase

Postby Jim » Sat Dec 15, 2012 12:42 pm

You could use the Order Api feature which allows you to create a script that ShopSite calls when an order is completed. You configure this on Merchandising > Order Api. Help is at http://shopsite.com/help/11.2/en-US/sc/pro/order.api.html for the general configuration and http://shopsite.com/help/11.2/en-US/sc/pro/order.api.spec.html for the specification of how to write a script and what parameters will be passed to it. Note that this feature is only available in the Pro level of ShopSite.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Update Database After Successful Purchase

Postby itsjimmy91 » Sat Dec 15, 2012 1:59 pm

Hmm.. I'm running this with iPage and their built-in ShopSite application. I can't seem to find the link to the Order API.
itsjimmy91
 
Posts: 2
Joined: Sat Dec 15, 2012 11:48 am

Re: Update Database After Successful Purchase

Postby Jim » Sat Dec 15, 2012 7:47 pm

Order api requires that a script be put in the shopping cart cgi directory. Unless you have your own install of ShopSite you probably will not be able to use the feature because hosts are reluctant to allow anyone to put something on the server that could impact others using the server.

The best solution would be to move to a host that does not share the cgis with multiple stores.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah


Return to User Forum

Who is online

Users browsing this forum: No registered users and 144 guests