/    Sign up×
Community /Pin to ProfileBookmark

How to generate unique registration code?

Hi,

I am developing a website with which to distribute a Palm application. The plan is to have the buyer make the purchase through Paypal and upon returning automatically to my site, the buyer will enter his Palm Username and email address. My VBscript code (I have the algorithm) will generate a registration code based on the Palm Username.

The problem I am having is how to generate the code ONCE for each buyer. I don’t want someone to find the generation page and enter his Palm Username and get a code without buying.

How do others handle this problem?
Thanks,
Bryon

to post a comment
Full-stack Developer

5 Comments(s)

Copy linkTweet thisAlerts:
@svidgenDec 02.2008 — There's more than one way to do it. I think the ideal method would use steps similar to the following:

[LIST=1]
  • [*]Generate the registration code.

  • [*]Store the registration code with an associated NOT_ACTIVE status.

  • [*]Submit the registration code as an item along with the paypal cart/transaction.

  • [*]Activate the registration code when paypal posts the transaction successful.

  • [*]Email a notice and link when the code has been activated.

  • [/LIST]

    Ideally, the registration code is hidden from the user, and they just deal with clicking on links at various stages.

    Does that make sense?
    Copy linkTweet thisAlerts:
    @bryonauthorDec 02.2008 — Thanks for the reply.

    Yes, this makes sense. Paypal's shopping cart system sends a notification to the merchant to inform him whether the transaction was completed or not. I suppose I could just generate the registration code upon successfully receiving this notice.

    I just realized something though. If I put my code generator routine in VB script, anyone can see it with a "view source", no? Do I have to go with a cgi script or something?

    I may be in over my head here...
    Copy linkTweet thisAlerts:
    @svidgenDec 03.2008 — You'll want/need some back-end scripting (or compiled code) at some point. It's generally best to make all of your crucial code server-side anyway.
    Copy linkTweet thisAlerts:
    @bryonauthorDec 04.2008 — I found a great PHP script written by Micah Carrick which I modified to do the job. When PayPal sends its Instant Payment Notification saying a payment has been verified, I have a function in the script calculate the Reg code and then email it to the client.

    Thanks again,

    bryon
    Copy linkTweet thisAlerts:
    @felgallDec 05.2008 — If the vbScript is running on the server then no one will be able to view the source.

    If you are trying to run it in the browser then it isn't going to run at all in most browsers since IE is the only browser that understands it.
    ×

    Success!

    Help @bryon spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.28,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...