Bundle deals, mass license generation and FastSpring

29 views
Skip to first unread message

Russell Gray

unread,
Nov 16, 2010, 4:08:41 PM11/16/10
to potion...@googlegroups.com
I am also trying to implement support for MUPromo, did these enhancements ever get shared anywhere publicly?

Russell

unread,
Nov 16, 2010, 4:13:58 PM11/16/10
to Potion Store Discussions
This was intended as a reply to this thread:
http://groups.google.com/group/potion-store/browse_thread/thread/5707e055f4bdc35d


but for some reason, I could not add a reply to it....?

Tony Arnold

unread,
Nov 17, 2010, 3:50:58 AM11/17/10
to potion...@googlegroups.com
Hi Russell,

On 17/11/2010, at 8:08 AM, Russell Gray wrote:

> I am also trying to implement support for MUPromo, did these enhancements ever get shared anywhere publicly?

Sorry, that's totally my bad. I keep meaning to clean up my changes to PotionStore and open pull requests, but I never allocate the time to it.

http://cl.ly/1j3h0G1t391p271g2I0e

That's a link to my promo_controller.rb (put it in app/controllers/store) - you'll need to add a randomly generated string (just md5 some private file on your hard disk and use that) into your store.yml under the key 'promo_salt'. Hopefully you know a bit of Rails and this can get you up and running - I don't see myself getting to that cleanup anytime shortly. I used this when Hyperspaces was part of MUPromo's bundle earlier this year - I ran it up on Heroku with 2 dynos on a Shared database plan while the promo was active without any load issues.

Feel free to ask any questions on list – hopefully if anyone else has the same problem in future, they will find this conversation and it can help them get started (at least until someone rolls this into the main app).

thanks,


Tony

----------
Tony Arnold
http://thecocoabots.com/

Russell Gray

unread,
Nov 17, 2010, 4:43:10 AM11/17/10
to potion...@googlegroups.com
Thanks Tony,

to be honest, I have no idea where to start....
Ruby/Rails and http POST requests are all foreign to me. (geez, writing apps is the easy part)

What else do I need to do, to get this working?
I'm guessing I need to set up some kind of listener for the POST requests.

Russell

SweetP Productions
www.sweetpproductions.com

> --
> You received this message because you are subscribed to the Google Groups "Potion Store Discussions" group.
> To post to this group, send email to potion...@googlegroups.com.
> To unsubscribe from this group, send email to potion-store...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/potion-store?hl=en.
>

Tony Arnold

unread,
Nov 17, 2010, 5:03:19 AM11/17/10
to potion...@googlegroups.com
Hi Russell,

On 17/11/2010, at 20:43 PM, Russell Gray wrote:

> to be honest, I have no idea where to start....
> Ruby/Rails and http POST requests are all foreign to me. (geez, writing apps is the easy part)
>
> What else do I need to do, to get this working?
> I'm guessing I need to set up some kind of listener for the POST requests.

No, it's just a Rails controller so no listener required - if you pop the file into your development potion store install at:

app/controllers/store/

and add a random string to store.yml for the 'promo_salt' key - something like:

promo_salt: "60790980e253aca748e1dc98fea1af7d"

(don't use that exact string - make something else up)

Then restart your development rails environment, you should be set. Here's what I sent to MacUpdate a few months ago about how to interact with this controller:


The URL will be: http://YOURHOST/store/promo/newserial


Form Parameters
===============

You will need to pass the following form parameters. I prefer that MacUpdate POST rather than GET, but it should make no difference. All parameters are required.

* salt: This must be whatever you entered into the 'promo_salt' key (without the quotes). It is the magic key, and without it the controller will not respond. Please do not share this key with anyone - if someone gets it, they can generate as many licenses for your apps as they please;
* source: This should be 'MacUpdate' - (or MacUpdate Bundle, or something that you can use later to identify these users as having come from your promotion;
* transaction_id: This is a unique code that I will store in my database - I'm use it for the PayPal transaction ID, but anything is OK so long as it is unique. I use this so that if the request is fired twice from MacUpdate, the user will get the same serial number/order each time (and I'm not creating duplicates);
* product_id: This should be your product's PotionStore code (without the quotes);
* email: The user's (valid) email address.
* firstname: The user's first name.
* lastname: The user's last name.

So the end result will be something like:

http://YOURHOST/store/promo/newserial?salt=fds89fyuidshfuikdshaj&source=MacUpdate&transaction_id=437894738&product_id=APPL100&email=bi...@galactica.com&firstname=William&lastname=Adama


Responses
=========

If the details are accepted, you'll get a license key as a plain text response - the status code will be "201" (created) if it's a brand new order, and "200" (OK) if the order already exists.

If anything goes wrong, or the details are invalid, you will get an empty response and either a HTTP status code of "404" (content not found) or "400" (bad request).

The guys at MacUpdate have worked with this setup before with me, so they should be able to set things up to test from their end pretty easily.

I hope this helps.

Russell Gray

unread,
Nov 17, 2010, 5:09:40 AM11/17/10
to potion...@googlegroups.com
wow, so simple.
I thought there would be a lot more to it.
I really ought to spend some time learning some ruby/Rails.


thanks for all your help, and time. i'll update my site, and run a couple of tests, to check if it works out.

Russell

SweetP Productions
www.sweetpproductions.com

Russell Gray

unread,
Nov 17, 2010, 6:38:46 AM11/17/10
to potion...@googlegroups.com
Iv'e tried it out, and I get the following message:
ActionController::RoutingError (No route matches "/promo/newserial" with {:method=>:get}):

have I missed something?

Russell

SweetP Productions
www.sweetpproductions.com


On 17/11/2010, at 9:03 PM, Tony Arnold wrote:

Tony Arnold

unread,
Nov 17, 2010, 7:00:45 AM11/17/10
to potion...@googlegroups.com
Hi Russell,

On 17/11/2010, at 22:38 PM, Russell Gray wrote:

> Iv'e tried it out, and I get the following message:
> ActionController::RoutingError (No route matches "/promo/newserial" with {:method=>:get}):
>
> have I missed something?

You should use /store/promo/newserial, not /promo/newserial.

Russell Gray

unread,
Nov 17, 2010, 7:06:08 AM11/17/10
to potion...@googlegroups.com
bingo!

I had to use:
http://sweetpproductions.com/store/store/promo/newserial?salt=...........

I am using a modified version of potionStore to run from a directory, rather than a subdomain.


Thanks again for all your help Tony.

Russell

SweetP Productions
www.sweetpproductions.com

Russell

unread,
Nov 17, 2010, 8:22:24 AM11/17/10
to Potion Store Discussions
Iv'e uploaded my amended promo_controller.rb.

I tweaked it a little, so figured, I might as well upload it here also
(cloudApp is great by the way, thx for the link)
http://cl.ly/3H1p

I have added in a price parameter, so that my "Orders Total" for each
promo sale more accurately reflects my true proceeds.


Russell
www.sweetpproductions.com
Reply all
Reply to author
Forward
0 new messages