Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

RL Online store help please

Lucinda Bergbahn
Registered User
Join date: 5 Jan 2007
Posts: 124
03-20-2007 15:16
How do I get a purchase on my website (using paypal) to generate delivery of an item inworld? I sell product online in Rl and would like to have to purchase also include and SL version that would be delivered inworld.

I am not a coder so be easy on me. (Baby Steps Please) I use Zencart for my RL webiste. I am only beginning to understand PHP- I design HTML websites in RL. So that is my knowledge very limited.

I appreciate your help.
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
03-20-2007 16:43
Heh...you're asking for something that I charge US$60/hr for in RL and make a living doing. Of course, now that I've said that, someone here will probably throw a free somethin' or other at you.

If you're lookin' for a direction to go:

1--Set up a communication between SL and your website via llHTTPRequest from LSL and email from your website. You will need to keep a listing of what SL products correspond with your website-based purchase.

2--Through your receiving end PHP page on your website, integrate with your ZendCart databases.

3--When someone makes a purchase, send an e-mail to an object in-world that can hand the item purchased off to the person in SL. You will need to be able to identify the person in SL by key in order to make the inventory transfer. You can do that in one of two ways:
a--Force that all persons who shop on your site register their avatar and log in. You will be able to keep their key on a registration database.
b--Attempt to fetch a key from a given name via something like the W-Hat llName2Key database (which is actually rather robust).
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Lucinda Bergbahn
Registered User
Join date: 5 Jan 2007
Posts: 124
03-20-2007 18:11
LOL well I wasn't trying to step on any toes or steal away anyone's business or secrets. I would love to hire you, but cant afford your $60 USD an hour and I really want to learn to do this myself. I just thought it would be cute to offer my RL customers a Sl version of their purchase if they are SL residents. A kind of a promo of SL and a perk for my customers. Not really selling them from SL.
Dustin Widget
Script Monkey for hire
Join date: 15 Feb 2006
Posts: 101
03-20-2007 18:25
No worries about stepping on toes, this is a help forum and if you ask for help, we will try our best. Seeing as this is a help forum, it isn't really our concern as to whether or not we are taking business from for-hire coders. (I don't say this as a dig at anyone, seeing as I am a freelance coder as well).

That being said, Kenn's solution is pretty much what you will need. If you have any other questions, ask along the way.
Lucinda Bergbahn
Registered User
Join date: 5 Jan 2007
Posts: 124
03-20-2007 18:44
Thanks Dustin! We are neighbors I log from South Dakota :) I have a good Idea of how this works. I just dont know where to begin to write it; So I guess I need to think about it a bit more to figure out what my questions might be.
Geuis Dassin
Filming Path creator
Join date: 3 May 2006
Posts: 565
03-20-2007 19:45
you need a "server" in SL. This server has to periodically check in with your website via llHttpRequest and give it a channel number, related to the XMLRPC code.

Now, as long as the server keeps in touch with your website, your website will communicate to your inworld server via XMLRPC, giving it the appropriate info, namely the avatar key you're delivering to inworld. This is easiest if you have made it necessary for the customer to interact with an "atm" type device inworld, which then registers their name and UUID with your website, so you have it on record.

Your server in SL will give whatever item to the avatar inworld via llGiveInventory


this is going to be a lot of work, but these are the main areas you need to look at.

Might I also recommend checking into Cenji Neutra's Apez.biz networked vendor system. I use this system and it works really really well. Plus he already has website integration. There could very well be a way to integrate that into your own site as well. In fact, I believe that's an option he offers.

http://www.apez.biz
Lucinda Bergbahn
Registered User
Join date: 5 Jan 2007
Posts: 124
03-20-2007 20:49
Thanks; Yes I have looked at apez.biz and it seems like a really great product. If I was using a website to sell a SL life product that would be very interesting to me; But as I am selling a RL product already and would simply like to give the buyer an option of getting a free likeness of that product in world when they buy my RL if they are an SL resident, then I think that it is a little overkill for my needs and I would like to do this solely from my site.

I was thinking that perhaps the email that is generated by either paypal to tell me that a sale has occured, or an email generated by my site when a sale occurs might be able to be directed to an object in world to trigger the item server to serve an item Is this possible?

If so, then the question becomes, how then do I communicate the particular item to be served and the key of the avitar that will serve it? Can I script an object (the server) to read the email as though it were a notecard?

I realize these may be silly questions. I am just trying to think this through. I appreciate your patience with my ignorance.
Dustin Widget
Script Monkey for hire
Join date: 15 Feb 2006
Posts: 101
03-20-2007 23:54
To do this via email:

Server exists in-world. This is just an object with deliverable items in it, as well as the script for the server functions.

The server will change its key whenever it is rezed, so the email that you contact it at will also change if it is re-rezed. btw, email format is [email]key@lsl.secondlife.com[/email]

The best way to keep track of this is to have the server, on rez and state entry, send its key to your RL server, via an llHTTPRequest() to a php form.

Now is going to be the part that will most likely give you a hard time. When the item is purchased, you will need to use that stored key, adding @lsl.secondlife.com, to get the email address. Add the data from the sale, probably just what you need to send and to who.

This is the real problem... who...

SL requires a key to deliver anything, so you will need the purchaser's key, not just the name. While there are several services out there that allow you to find the key from the name, they do not always work. Most people do not know their keys off hand, so here is the problem.

One potential solution is to not deliver the item, but have the server store the person's name and item in a CSV, then have them actually come to your server and touch it to receive the item. Since you can get a name on touch event, this takes care of the key problem. At the point they touch it, it would just check if they are in the CSV. If they are, it gives them the product, then strikes their name and the item from the string. If they arent in there, it doesnt do anything.

If you look up the email event and llGetNextEmail() in the wiki, it should give you an idea of how to process that email once you get it. You will basically just be setting up a timer that will call llGetNextEmail(), then the code in the event to parse the data recieved.