8 / 8
Dec 2009

I'm a little confused over the options to access external scripts. I have a custom registration design built around a trial version of my software. Customers download the software and have to run it to confirm it is compatible with their computer before they can buy. This creates a Local Machine code. I then provide a purchase link within the software which is not otherwise accessible from a store front. This link needs to offer a payment method (PayPal Pro) and then, on a successful transaction, forward the user to a script (.php) where they enter their unique Local Machine code and get a corresponding registration code in return.



To fend of freeloaders, I need to make sure people can't just type in the .php URL and enter their local machine code free of charge! Thus my current plan is to have the registration script check a Post variable to determine if the access is from a legitimate purchase or not.



This is where I get confused with eJunkie's options. http://www.e-junkie.com/ej/help.keygen.htm is about generating a custom code, but doesn't forward the user to a custom webpage where they can put in their local computer code. http://www.e-junkie.com/ej/help.redirection.htm sounds about right, where I would direct the users to a custom page. My concern here is using the GET method, the URL could be used by other people. Is there a hidden POST method I could test instead? I can't really limit each user to one registration code through a database lookup as buyers may want several copies for several machines. Then there's Send Transaction Data to a URL (http://www.e-junkie.com/ej/help.integration.htm) which also sound right, uses POST, but seems to be geared towards payment gateways, and so wouldn't operate in response to a PayPal purchase but would instead go from the buyer clicking the Pay button to my .php script without the whole payment thing.



Would you be able to advise me on the correct way to integrate my scheme? In simple terms, the steps are...



1 Customer downloads software

2 Customer runs software

3 Software generates Local Machine Code (LMC)

4 Software enables purchase button

5 Customer clicks purchase button

6 Website opens on eJunkie cart with software added (Buy Now button equivalent)

7 Buyer pays

8 Transaction complete

9 Buyer directed to custom .php page that only opens on successful purchase through eJunkie. Enters LMC and gets script generates Registration code

10 Customer enters code and software is unlocked for their LMC.



It's step 8 to 9 that I'm having trouble with. And sorry for the epic post! Hope that isn't too much information!

  • created

    Nov '09
  • last reply

    Dec '09
  • 7

    replies

  • 1.5k

    views

  • 3

    users

  • 4

    links

While generating the purchase button for your software, enable the "Variations" option and creat a variation option called machine code. That way, users will be able to enter the code before purchase. This code will then be passed on to your keygen and you can generate the registration code based on that.



Regsitration code will be emailed to the buyer and you can also customize the thankyou page to show the code there.

Thanks for your support. I've just got a test product up and running and it's very easy and painless. You've clearly thought about what sellers need. eJunkie is an excellent cart solution for download software vendors like myself, especially when the technical support to help integration is as prompt as yours. I'll be switching over to eJunkie this week.



I have one little question remaining. In the "Custom Thankyou" message I tried to embed the purchase details of user code and registration code using this "Optional Email Message" of the product details page :



---

Extra thankyou message.

Thank you for buying this lovely thing.



Your computer key is : [%o1%]

Your registration code is: [%codes%]

---





The email contains the code tags and not the actual user and registration codes. Is there a way to include these data?

I am glad that you like our service and features :)



Can you please check if you have checked the "Enabled templated email" checkbox in your product's settings?

13 days later

I'm still having some integration issues.



In my .php code, I use :



$s = encrypt($_POST['usercode']);

echo ($s);



...where encrypt() is a local function. I'm not sure where I got the variable 'usercode' from though! My product variation is called 'PZAMM User Code.' How should I access this in the .php code generator?



The template HTML/email is set to use template, but is continuing to print the codes and not the actual values. [%first_name%] works, but [%gross%] is printed as the token, while [%on1%] and [%codes%] are blank.



I expect the code faults are because my returned code is a blank as a result of reading a null string because I'm not referencing the correct POSTed variable.

The user-entered code would be in variable os0, so:

$_POST['os0']



Regarding thank-you page/email template tokens, note how our documentation makes distinctions as to which tokens are supported where.



The [%gross%] token is not supported in the Message (HTML) field for individual products; it only works in thank-you emails and in the Common Thank-you Page HTML field (in Admin > Account Prefs). Anything in your Common Thank-you Page HTML field gets inserted at the bottom of the thank-you page, after product-specific information. You may find this sample thank-you page helpful to see where things go:

1https://www.e-junkie.com/ecom/rp.php?t=jg-kqswfja3e6cfcfd&c=fup1



You have only one Option configured for this product using Variations, so you would only have [%on0%] (think of this as "Option Name 0") and its corresponding user-submitted [%os0%] ("Option Specified 0"). There is no on1/os1, etc. as you are not using a 2nd or 3rd option for the product.



The [%codes%] token is null because your keygen URL is not outputting any string to insert for that value.

10 days later

Edit for clarity :



I've simplified for password creation code to help track the problem of it not returning a code. I've just tried returning the 'os0' variable, with this .php code...



if ($_POST['handshake']!==md5("email@address.com".md5("********"))){

echo ('handshake failed');

exit;

}else{

// Return registration code

$a='os0 '.$_POST['os0'];

echo ($a);

}



After a transaction, the response email includes [%os0%] and [%codes%]. [%os0%] returns my cariation value. [%codes%] prints "os0 " with no actual property value, so it seems like my .php script isn't receiving it.



What is preventing my .php receiving the correct POSTed value?