Hello, I''m in the process of implementing invoce functionality to my Rails app. The service is monthly billed. I already have an Authorize.NET test account. What I would like to do is bill the customers automatically after a certain interval has passed after the last payment, sending them the invoice to pay for it again and perform some action if the invoice has not been paid in time. What would be the best way to do this? A rails controller running as a cron job? Any help would be much appreciated! Thanks in advance, Marcelo. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rbaldwin, Al Evans - Thank you very much for the help, I really appreaciate it! @Al Evans: You appreach seems simple and flexible, I''ll definetly try it out, thanks for the tip! @rbaldwin: BackgroundRb also seems to be great, as simple as Al Evans approach... I''ll try it too. Once I get everything set up and working, I''ll let you know which one worked best for me. Thanks! Marcelo. On 8/27/07, Al Evans <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Marcelo de Moraes Serpa wrote: > > > What would be the best way to do this? A rails controller running as a > > cron job? > > The best way I''ve found is just to add an OfflineProcessController with > the functionality I need. I use a before_filter to validate only the IP > address on which I''m running cron, so nobody else can access these > methods. > > I use a little shell script like this: > > #!/bin/sh > > WGET=/usr/bin/wget > BASEURL=http://my_site.com/offline_process/ > LOGFILE=<path to log file> > OPTS=''-q --no-check-certificate -O -'' > > if [ ! -f $LOGFILE ]; then > touch $LOGFILE > fi > > ${WGET} ${OPTS} ${BASEURL}do_something | cat >> $LOGFILE > ${WGET} ${OPTS} ${BASEURL}do_something_else | cat >> $LOGFILE > > ...and a crontab entry like... > > 1,31 * * * * /complete/path/to/script/for/offline_process.sh > > I''ve done this several different ways, and this is my favorite at the > moment. > > --Al Evans > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
just to correct some spelling errors: * worked better, not best * approach, not appreach :P On 8/27/07, Marcelo de Moraes Serpa <celoserpa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > rbaldwin, Al Evans - Thank you very much for the help, I really > appreaciate it! > > @Al Evans: You appreach seems simple and flexible, I''ll definetly try it > out, thanks for the tip! > @rbaldwin: BackgroundRb also seems to be great, as simple as Al Evans > approach... I''ll try it too. > > Once I get everything set up and working, I''ll let you know which one > worked best for me. > > Thanks! > > Marcelo. > > On 8/27/07, Al Evans <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > Marcelo de Moraes Serpa wrote: > > > > > What would be the best way to do this? A rails controller running as a > > > cron job? > > > > The best way I''ve found is just to add an OfflineProcessController with > > the functionality I need. I use a before_filter to validate only the IP > > address on which I''m running cron, so nobody else can access these > > methods. > > > > I use a little shell script like this: > > > > #!/bin/sh > > > > WGET=/usr/bin/wget > > BASEURL=http://my_site.com/offline_process/ > > LOGFILE=<path to log file> > > OPTS=''-q --no-check-certificate -O -'' > > > > if [ ! -f $LOGFILE ]; then > > touch $LOGFILE > > fi > > > > ${WGET} ${OPTS} ${BASEURL}do_something | cat >> $LOGFILE > > ${WGET} ${OPTS} ${BASEURL}do_something_else | cat >> $LOGFILE > > > > ...and a crontab entry like... > > > > 1,31 * * * * /complete/path/to/script/for/offline_process.sh > > > > I''ve done this several different ways, and this is my favorite at the > > moment. > > > > --Al Evans > > -- > > Posted via http://www.ruby-forum.com/. > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can get ARB from Authorize.net ($10/mo) and let them charge the customer each period instead of sending them a bill. Does the amount change each month? Then you can use Billing Orchard and load invoices via a simple API. It stores the credit card and bills a.net each month or it can send an invoice via email to your customer. BO has an interface for your customer, too. - http://www.billingorchard.com/default.cfm?pid=a2de1a17 Fred --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I use a little shell script like this:If you prefer to write ruby instead of a shell script, you could also write a custom rake task ( http://railscasts.com/episodes/66 ), and call that using cron. Regards, Chris -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---