Ruby on Rails Monday, August 1, 2011

On 1 August 2011 16:56, bertly_the_coder <muchira@gmail.com> wrote:
> I have an interesting problem that I'm trying to wrap my head around.
>
> I'm creating a subscription based service that will charge extra for
> premium products. What does this mean?...ok, let's say I've created a
> subscription based service that allows you to get any 5 standard
> magazines of your choice shipped to you per month, where a standard
> magazine is any magazine that costs less than $7.99. Magazines more
> expensive than that are considered premium.
>
> Now if a subscriber selects a standard magazine, this is fine, the
> order is created and the magazine is shipped, this order falls within
> the terms of the subscription. However, if the subscriber selects a
> premium magazIne, then I have to charge them the difference of the
> magazine price from 7.99. So if they order a magazine worth 9.99, I
> have to charge them 2 bucks, etc etc.
>
> Now, I can't figure out where to put this logic check. What I've
> started with was this.  I created another controller method to check
> the price, if it's standard, send to the create method(is that even
> possible??). If the magazine price is high, I redirect to a confirm
> page then back to the create method....this means that I have to store
> my order in a session, right? Which just seems like over kill.

Add it to the order in the normal way but mark it as not confirmed,
then get the user to confirm it (or not).

Colin

>
> Has anyone had a problem like this before? How did you go about
> solving it?
>
> Thanks a bunch in advance,
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment