<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bobby Warner</title>
	<atom:link href="http://www.bobbywarner.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bobbywarner.com</link>
	<description>A very opinionated web log about all sorts of stuff</description>
	<lastBuildDate>Fri, 19 Apr 2013 06:16:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Building APIs with Grails</title>
		<link>http://www.bobbywarner.com/2013/04/18/building-apis-with-grails/</link>
		<comments>http://www.bobbywarner.com/2013/04/18/building-apis-with-grails/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 05:57:58 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=611</guid>
		<description><![CDATA[I have been developing some APIs with Grails lately as opposed to traditional web apps. I&#8217;m going to be giving a talk at GR8CONF US this summer about this topic too. So, I thought it would be fun to create a screencast with some tips for getting started building APIs with Grails! The screencast covers [...]]]></description>
				<content:encoded><![CDATA[<p>I have been developing some APIs with Grails lately as opposed to traditional web apps. I&#8217;m going to be giving a talk at <a href="http://gr8conf.us/index" target="_blank">GR8CONF US</a> this summer about this topic too.  </p>
<p>So, I thought it would be fun to create a screencast with some tips for getting started building APIs with Grails! The screencast covers content types, API URL mappings, customizing JSON output with marshallers and even <a href="http://blog.freeside.co/" target="_blank">Rob Fletcher&#8217;s</a> GSON plugin.  I unfortunately recorded this screencast on a MacBookPro as opposed to an iMac and there&#8217;s some background noise because of the MBP fan. First and last time I use a MBP for a screencast, ha!  Hopefully it doesn&#8217;t distract from the content too much.  Thanks for watching!</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/BQIEVi66uMI" frameborder="0" allowfullscreen></iframe></p>
<p>The sample app built in the screencast is located on <a href="https://github.com/gr8casts/episode-002" target="_blank">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2013/04/18/building-apis-with-grails/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>GR8CONF US Hackathon</title>
		<link>http://www.bobbywarner.com/2013/04/08/gr8conf-us-hackathon/</link>
		<comments>http://www.bobbywarner.com/2013/04/08/gr8conf-us-hackathon/#comments</comments>
		<pubDate>Mon, 08 Apr 2013 18:19:56 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[gr8conf]]></category>
		<category><![CDATA[geb]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[griffon]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[hackathon]]></category>
		<category><![CDATA[spock]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=582</guid>
		<description><![CDATA[As you might have already heard, Target will be hosting a hackathon as part of the GR8CONF US 2013 conference! If you are not aware of GR8CONF US, it’s a technology conference focused on the Groovy ecosystem (Groovy, Grails, Griffon, Gradle, Spock, Geb, GVM, GPars, Gaelyk, Ratpack and CodeNarc). It will be hosted at the [...]]]></description>
				<content:encoded><![CDATA[<p>As you might have already <a href="http://blog.gr8conf.us/2013/03/target-corporation-sponsoring-gr8conf-us.html" target="_blank">heard</a>, <a href="http://www.target.com" target="_blank">Target</a> will be hosting a hackathon as part of the <a href="http://gr8conf.us" target="_blank">GR8CONF US 2013</a> conference!  If you are not aware of GR8CONF US, it’s a technology conference focused on the Groovy ecosystem (<a href="http://groovy.codehaus.org/" target="_blank">Groovy</a>, <a href="http://grails.org" target="_blank">Grails</a>, <a href="http://griffon.codehaus.org" target="_blank">Griffon</a>, <a href="http://www.gradle.org" target="_blank">Gradle</a>, <a href="http://spockframework.org" target="_blank">Spock</a>, <a href="http://www.gebish.org" target="_blank">Geb</a>, <a href="http://gvmtool.net" target="_blank">GVM</a>, <a href="http://gpars.codehaus.org" target="_blank">GPars</a>, <a href="http://gaelyk.appspot.com" target="_blank">Gaelyk</a>, <a href="https://github.com/ratpack" target="_blank">Ratpack</a> and <a href="http://codenarc.sourceforge.net" target="_blank">CodeNarc</a>). It will be hosted at the Minneapolis Convention Center on July 21-23.  Today, I would like to share some details about the hackathon!  It will take place Sunday night after the workshops on <strong>July 21st from 6:00pm to 10:00pm</strong> at the new <a href="https://corporate.target.com/discover/article/Target-Plaza-Commons-beyond-the-breakroom" target="_blank">Target Plaza Commons</a> at 1011 Nicollet Mall in downtown Minneapolis and all conference attendees are welcome to join at no additional charge!</p>
<p>This isn’t just a regular hackathon though as it will instead be a competition with Target gift card prizes for the top GR8 hackers! The competition will be focused on two categories with $2,400 in total gift card prizes (1st place: $500, 2nd place: $400, 3rd place: $300 in each category). The official contest rules for how the entries will be judged will be published closer to the event. Here is a quick overview of the two categories though:</p>
<ol>
<li>The first category is a bug race on the various open-source GR8 technologies. There will be various points awarded for the types of bugs found, solutions identified, pull requests opened and of course commits made! The judging for this category will be very quantitative and the winners will simply be the ones that get the most points.</li>
<li>The second category will focus on utilizing Target APIs with GR8 technologies. This event will mark the first alpha release of public Target APIs and we are excited to gather feedback from the GR8 developer community! These APIs are used by various applications at Target today. The judging for this category will be qualitative and the Target API team will select the winners based on creativity, APIs used and potential relevance to Target guests.</li>
</ol>
<p>Target will be providing appetizers and refreshments for participants throughout the hackathon as well as have representation from various Target teams if anybody is interested in learning more about technology opportunities at Target.</p>
<p>Target is very excited to be a sponsor of GR8CONF US for 2013 and to host this hackathon as part of the conference for attendees! I look forward to providing you more details about the hackathon as we get closer to the event.  I also will publish an official registration form soon! I hope that as many conference attendees as possible plan to attend and hack at the GR8CONF US hackathon!</p>
<p><em><strong>Disclaimer</strong>: You must be registered as a conference attendee before <strong>Wednesday, July 17th at 5pm CST</strong> to be able to enter Target Plaza Commons for the event. There will be no exceptions. As per Target policy, all attendee names need to be known before the event. Target employees are welcome to participate in the hackathon, but are not eligible to win the gift cards. All participants will need to fill out the registration form and agree to the contest rules. The contest for gift cards starts and ends with the hackathon: July 21st from 6:00pm to 10:00pm.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2013/04/08/gr8conf-us-hackathon/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>GR8CONF</title>
		<link>http://www.bobbywarner.com/2012/07/31/gr8conf/</link>
		<comments>http://www.bobbywarner.com/2012/07/31/gr8conf/#comments</comments>
		<pubDate>Tue, 31 Jul 2012 22:37:37 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=566</guid>
		<description><![CDATA[I gave a talk today called &#8220;Contributing Back To Grails&#8221; at GR8CONF. You can view the presentation slides via the links below. There is a Keynote file and the slides have embedded screencasts that demo the various steps of actually doing a code contribution. I also posted the slides on SlideShare, but the embedded screencasts [...]]]></description>
				<content:encoded><![CDATA[<p>I gave a talk today called &#8220;Contributing Back To Grails&#8221; at <a href="http://gr8conf.us" target="_blank">GR8CONF</a>.  You can view the presentation slides via the links below.  There is a <a href="http://www.apple.com/iwork/keynote/" target="_blank">Keynote</a> file and the slides have embedded screencasts that demo the various steps of actually doing a code contribution.  I also posted the slides on SlideShare, but the embedded screencasts don&#8217;t work unfortunately on SlideShare. As part of the talk, I also created three pull requests for Grails!</p>
<ul>
<li><a href="https://github.com/grails/grails-core/pull/244" target="_blank">grails-core update for GRAILS-9052</a></li>
<li><a href="https://github.com/SpringSource/grails-data-mapping/pull/60" target="_blank">grails-data-mapping simple update for spring-data-mongo library</a></li>
<li><a href="https://github.com/grails/grails-doc/pull/94" target="_blank">grails-doc sipmle update for Java EE Containers</a></li>
</ul>
<p>Thanks to everyone that came to my talk and it was great seeing so many people from the Groovy community at the conference!</p>
<p><a href="http://www.bobbywarner.com/gr8conf-contributing-back-to-grails.key" target="_blank">GR8CONF Contributing Back to Grails Presentation</a> (Keynote)<br />
<br />
<a href="http://www.slideshare.net/bobbywarner/gr8conf-contributing-back-to-grails" target="_blank">GR8CONF Contributing Back to Grails Presentation</a> (SlideShare &#8211; screencasts don&#8217;t work)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2012/07/31/gr8conf/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Add Some PJAX to Grails</title>
		<link>http://www.bobbywarner.com/2012/04/23/add-some-pjax-to-grails/</link>
		<comments>http://www.bobbywarner.com/2012/04/23/add-some-pjax-to-grails/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 00:39:16 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[pjax]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=515</guid>
		<description><![CDATA[Have you used PJAX yet (PushState + AJAX = PJAX)? It&#8217;s a pretty slick way to make AJAX partial updates a lot better compared to the regular g:remoteLink tag. The primary benefits are you don&#8217;t break the back button functionality and it updates the URL! The key to implementing PJAX is that you need to [...]]]></description>
				<content:encoded><![CDATA[<p>Have you used <a href="http://pjax.heroku.com/" target="_blank">PJAX</a> yet (PushState + AJAX = PJAX)? It&#8217;s a pretty slick way to make AJAX partial updates a lot better compared to the regular g:remoteLink tag. The primary benefits are you don&#8217;t break the back button functionality and it updates the URL!</p>
<p>The key to implementing PJAX is that you need to have a &#8220;chrome-less&#8221; view for PJAX requests. This means the view can&#8217;t have the main.gsp layout applied to it (or whatever your layout is called). There are a number of different ways you could do this. First, you could simply look for the HTTP header that PJAX adds to each request called X-Pjax and then apply a different layout in the controller (or no layout at all). The approach I decided to take was a little different though. I decided that I didn&#8217;t want to modify any controllers and instead do it at the framework level. I also didn&#8217;t want to modify any views that already have the meta.layout (&lt;meta name=&#8221;layout&#8221; content=&#8221;main&#8221;/&gt;). My solution was to extend <a href="https://github.com/grails/grails-core/blob/master/grails-web/src/main/groovy/org/codehaus/groovy/grails/web/sitemesh/GrailsLayoutDecoratorMapper.java" target="_blank">GrailsLayoutDecoratorMapper</a> with my own new class called <a href="https://github.com/gr8casts/pjaxsample/blob/master/src/groovy/grails/pjax/PjaxDecoratorMapper.groovy" target="_blank">PjaxDecoratorMapper</a>. I was originally going to create a Grails PJAX plugin to take care of this, but you need to modify sitemesh.xml in order to register this new decorator and I don&#8217;t believe there currently is any programmatic way to do that (like you can with web.xml). Also, the way that I&#8217;m implementing PJAX is certainly not the only way in a Grails app so I&#8217;m not sure how much value a plugin would even really provide. If people like this approach and it provides value, I&#8217;m certainly open to creating a plugin though. Let me know! So, let&#8217;s dive in!</p>
<p>First, we need to get the PJAX JavaScript:</p>
<ul>
<li>grails create-app pjaxsample</li>
<li>cd pjaxsample/web-app/js</li>
<li>curl -O https://raw.github.com/defunkt/jquery-pjax/master/jquery.pjax.js</li>
</ul>
<p>Edit <strong>grails-app/conf/ApplicationResources.groovy</strong> to look like the following:<br />
<script type="text/javascript" src="https://gist.github.com/2473306.js?file=ApplicationResources.groovy"></script></p>
<p>Next, we need to create a layout that will only be used for our PJAX requests.</p>
<p>Create a new <strong>grails-app/views/layouts/pjax.gsp</strong> that looks like this:<script type="text/javascript" src="https://gist.github.com/2473306.js?file=pjax.gsp"></script></p>
<p>As you can see, all this layout is doing is rendering the body wrapped in a div called main. You can obviously call this div whatever you want or have multiple layouts for different divs that you want to use PJAX with if needed. For my needs, I simply wanted to always update one common area with PJAX, so just using one div for this met my needs.</p>
<p>Now let&#8217;s create our new decorator and configure it with sitemesh!</p>
<p>Create a new <strong>src/groovy/grails/pjax/PjaxDecoratorMapper.groovy</strong> file that looks like this:<br />
<script type="text/javascript" src="https://gist.github.com/2473306.js?file=PjaxDecoratorMapper.groovy"></script>Then modify the decorator-mappers part of <strong>web-app/WEB-INF/sitemesh.xml</strong> so it looks like this:<script type="text/javascript" src="https://gist.github.com/2473306.js?file=sitemesh.xml"></script></p>
<p>As you can see in the Groovy code, all it&#8217;s doing is adding a new check for the X-Pjax header and using the pjax.gsp layout if it finds it. Then in sitemesh.xml, we are setting our new class to be the decorator instead of the default one. This is the key to not having to modify any existing controllers or views since this check is happening at the framework level as opposed to in app code. With this stuff in place, now we are ready to use some PJAX! I decided to take the first approach outlined on the <a href="https://github.com/defunkt/jquery-pjax/blob/master/README.md" target="_blank">PJAX README</a> by using a data attribute on any links I&#8217;d like PJAX-ified and then including this JavaScript in <strong>web-app/js/application.js</strong>. You certainly don&#8217;t have to use this approach though and can play with the other ones if you&#8217;d like!</p>
<p><script src="https://gist.github.com/2473306.js?file=application.js"></script></p>
<p>In the screencast below, I will now demonstrate using this PJAX setup in a sample application! You can download all the source for this screencast on GitHub: <a href="https://github.com/gr8casts/pjaxsample" target="_blank">https://github.com/gr8casts/pjaxsample</a>.</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/AAZfv7cp3mo" frameborder="0" allowfullscreen></iframe></p>
<p>I hope you enjoyed this post about using PJAX in Grails!  Please let me know in the comments if you have any suggestions for ways to improve PJAX usage in Grails and if you found this valuable or not.  Thanks for reading &#038; watching!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2012/04/23/add-some-pjax-to-grails/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Making Money with Grails</title>
		<link>http://www.bobbywarner.com/2012/03/19/making-money-with-grails/</link>
		<comments>http://www.bobbywarner.com/2012/03/19/making-money-with-grails/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 04:01:04 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[stripe]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=504</guid>
		<description><![CDATA[What&#8217;s more fun that building a Grails website? Building a Grails website that makes money of course, ha! Back in December, I wrote a couple posts about using Stripe with Grails to process credit cards and released some initial milestones for a plugin. Then last week, I released version 1.0 of the plugin. So, today [...]]]></description>
				<content:encoded><![CDATA[<p>What&#8217;s more fun that building a <a href="http://grails.org/" target="_blank">Grails</a> website? Building a Grails website that makes money of course, ha!</p>
<p>Back in December, I wrote a couple posts about using <a href="https://stripe.com/" target="_blank">Stripe</a> with Grails to process credit cards and released some initial milestones for a plugin. Then last week, I released version 1.0 of the <a href="http://grails.org/plugin/stripe" target="_blank">plugin</a>. So, today I&#8217;m just providing a screencast to go along with that 1.0 release! Please let me know in the comments if you find the screencast valuable or not!</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/W47x1OH_6q0" frameborder="0" allowfullscreen></iframe></p>
<p>Yes, my API keys shown in the video have been invalidated. <img src='http://www.bobbywarner.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2012/03/19/making-money-with-grails/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Another Adventure with Grails and CoffeeScript</title>
		<link>http://www.bobbywarner.com/2012/01/12/another-adventure-with-grails-and-coffeescript/</link>
		<comments>http://www.bobbywarner.com/2012/01/12/another-adventure-with-grails-and-coffeescript/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 07:46:52 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[coffeescript]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=489</guid>
		<description><![CDATA[It&#8217;s amazing how simple the jQuery libraries make complex front-end development. Then if you add in CoffeeScript, using jQuery is even better! In this screencast, I demonstrate creating a AJAX-enabled sortable-list in a Grails 2.0 application. Please let me know in the comments if you find the screen-cast valuable or not! The source-code for this [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s amazing how simple the jQuery libraries make complex front-end development. Then if you add in CoffeeScript, using jQuery is even better!  In this screencast, I demonstrate creating a AJAX-enabled sortable-list in a Grails 2.0 application. Please let me know in the comments if you find the screen-cast valuable or not!</p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/9tyWyhoflxk?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>The source-code for this screencast is available on GitHub: <a href="https://github.com/bobbywarner/grails-coffeescript-demo2" target="_blank">https://github.com/bobbywarner/grails-coffeescript-demo2</a></p>
<p>This screencast was inspired by Ryan Bates’ <a href="http://railscasts.com/episodes/147-sortable-lists-revised" target="_blank">RailsCasts Episode #147</a>. I borrowed some of his excellent CoffeeScript example code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2012/01/12/another-adventure-with-grails-and-coffeescript/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Getting Groovy with CoffeeScript</title>
		<link>http://www.bobbywarner.com/2012/01/09/getting-groovy-with-coffeescript/</link>
		<comments>http://www.bobbywarner.com/2012/01/09/getting-groovy-with-coffeescript/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 03:58:04 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[coffeescript]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=475</guid>
		<description><![CDATA[Have you used CoffeeScript yet? I just started playing with it and so far I think it&#8217;s great! In this screencast, I walk through how to use CoffeeScript in a Grails 2.0 application by building a simple &#8220;continuous-scrolling&#8221; page. Please let me know in the comments if you find the screen-cast valuable or not! The [...]]]></description>
				<content:encoded><![CDATA[<p>Have you used <a href="http://coffeescript.org/" target="_blank">CoffeeScript</a> yet? I just started playing with it and so far I think it&#8217;s great! In this screencast, I walk through how to use CoffeeScript in a Grails 2.0 application by building a simple &#8220;<a href="http://ui-patterns.com/patterns/ContinuousScrolling" target="_blank">continuous-scrolling</a>&#8221; page. Please let me know in the comments if you find the screen-cast valuable or not!</p>
<p><iframe width="480" height="360" src="http://www.youtube.com/embed/Bu2c9cnk_ec?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>The source-code for this screencast is available on GitHub: <a href="https://github.com/bobbywarner/grails-coffeescript-demo" target="_blank">https://github.com/bobbywarner/grails-coffeescript-demo</a></p>
<p>This screencast was inspired by Ryan Bates&#8217; <a href="http://railscasts.com/episodes/114-endless-page-revised" target="_blank">RailsCasts Episode #114</a>. I borrowed some of his excellent CoffeeScript example code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2012/01/09/getting-groovy-with-coffeescript/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Jump Into Grails 2.0</title>
		<link>http://www.bobbywarner.com/2012/01/05/jump-into-grails-2-0/</link>
		<comments>http://www.bobbywarner.com/2012/01/05/jump-into-grails-2-0/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 02:19:39 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=459</guid>
		<description><![CDATA[Do you hate reading? Well today is your lucky day because instead of reading a post, you can watch my first ever Grails screen-cast! It&#8217;s definitely a little rough around the edges though and you&#8217;ll have to watch it full-screen otherwise the text will be too small. The topic is &#8220;Jumping into Grails 2.0&#8243; using [...]]]></description>
				<content:encoded><![CDATA[<p>Do you hate reading? Well today is your lucky day because instead of reading a post, you can watch my first ever Grails screen-cast! It&#8217;s definitely a little rough around the edges though and you&#8217;ll have to watch it full-screen otherwise the text will be too small.</p>
<p>The topic is &#8220;Jumping into Grails 2.0&#8243; using the spring-security-core and resources plugins as well as some unit testing. Please let me know in the comments if you find the screen-cast valuable or not.</p>
<p><iframe width="500" height="281" src="http://www.youtube.com/embed/HCUJuGXZ9A0?fs=1&#038;feature=oembed" frameborder="0" allowfullscreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2012/01/05/jump-into-grails-2-0/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Using Stripe with Grails Continued</title>
		<link>http://www.bobbywarner.com/2011/12/30/using-stripe-with-grails-continued/</link>
		<comments>http://www.bobbywarner.com/2011/12/30/using-stripe-with-grails-continued/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 19:18:30 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[stripe]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=446</guid>
		<description><![CDATA[In my last post, I introduced using Stripe with Grails to process credit cards. I guess I should have waited to write that post though because today I made it a lot easier, ha! As of the 1.0.M6 release, the plugin has a new tag library that takes care of all the JavaScript and credit [...]]]></description>
				<content:encoded><![CDATA[<p>In my <a href="http://www.bobbywarner.com/2011/12/29/using-stripe-with-grails/" target="_blank">last post</a>, I introduced using <a href="https://stripe.com/" target="_blank">Stripe</a> with Grails to process credit cards. I guess I should have waited to write that post though because today I made it a lot easier, ha! <img src='http://www.bobbywarner.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As of the 1.0.M6 release, the plugin has a new tag library that takes care of all the JavaScript and credit card input fields for you!  This is all that&#8217;s required now to create the form:</p>
<p><script src="https://gist.github.com/1535990.js?file=updated%20form"></script></p>
<p>A couple notes about this code compared to my previous post&#8217;s code:</p>
<ul>
<li>You no longer need to declare the resource module <strong>stripe</strong>, the plugin takes care of this.</li>
<li>You no longer need to worry about setting the publishableKey, the plugin takes care of this now too.</li>
<li>&lt;stripe:script formName=&#8221;payment-form&#8221;/&gt; is required to setup all the JavaScript. The formName attribute needs to match the <strong>name</strong> attribute on your &lt;g:form&gt; tag.</li>
<li>&lt;stripe:creditCardInputs cssClass=&#8221;form-row&#8221;/&gt; is optional if you want the plugin to create the credit card fields (number, cvc, exp-month &#038; exp-year). The cssClass attribute is what class you want the plugin to put for the div tag surrounding each credit card field. You don&#8217;t have to use this though and can include these fields manually in your form if you&#8217;d prefer.</li>
</ul>
<p>This will all be covered in the <a href="http://bobbywarner.github.com/grails-stripe/" target="_blank">plugin documentation</a> which will be done with the 1.0 final release. Thanks to those who already provided feedback! Please let me know what you think of these new updates as well as any other features you&#8217;d like included!</p>
<p>Also, a quick note that I forgot to mention about Stripe in my last post is that you can accept payments from any country (Visa, MasterCard, American Express, Discover, JCB, and Diners Club cards) and customers can use pretty much any currency, but you currently have to be based in the US to receive payments. Sounds like they are working to expand to other countries though.  Check out their <a href="https://stripe.com/help/faq" target="_blank">FAQ</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2011/12/30/using-stripe-with-grails-continued/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Stripe with Grails</title>
		<link>http://www.bobbywarner.com/2011/12/29/using-stripe-with-grails/</link>
		<comments>http://www.bobbywarner.com/2011/12/29/using-stripe-with-grails/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 20:54:00 +0000</pubDate>
		<dc:creator>bobby</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[stripe]]></category>

		<guid isPermaLink="false">http://www.bobbywarner.com/?p=427</guid>
		<description><![CDATA[How do you usually process credit cards in your web applications? There are obviously lots of options available and each has pros and cons. One that I am really starting to like though is Stripe. It has great client libraries, makes PCI compliance really easy and is incredibly easy to use! So, I decided to [...]]]></description>
				<content:encoded><![CDATA[<p>How do you usually process credit cards in your web applications?  There are obviously lots of options available and each has pros and cons.  One that I am really starting to like though is <a href="https://stripe.com/" target="_blank">Stripe</a>. It has great client libraries, makes PCI compliance really easy and is incredibly easy to use! So, I decided to build a <a href="http://grails.org/plugin/stripe" target="_blank">Grails plugin for Stripe</a>! The purpose of this post is to introduce people to the plugin and hopefully get feedback on it before releasing a &#8220;1.0 Final&#8221; version. I am NOT affiliated with Stripe Inc, I just like it, ha! Let&#8217;s dive in!</p>
<p>First, you will need a sample Grails 2.0 application.  You could certainly use Grails 1.3.7 too as there&#8217;s nothing limiting the plugin to 2.0, but it does require the <a href="http://grails.org/plugin/resources" target="_blank">resources plugin</a> and I just figure most new Grails apps will be 2.0.</p>
<p><code><br />
grails create-app stripesample<br />
cd stripesample<br />
grails install-plugin stripe<br />
grails create-controller checkout<br />
</code></p>
<p>We will need to set two configuration items in Config.groovy. Before we can add these though, we need to register for a Stripe account. So, head on over to <a href="https://stripe.com/" target="_blank">Stripe</a> and create your account. Once you&#8217;re logged in, click on the top-right link for <strong>Your Account</strong> and then <strong>Account Settings</strong>.  This will pop open a box where you can find your <strong>API Keys</strong>. Stripe provides each account with separate publishable and secret keys for testing and live. We only care about the testing ones for now. Let&#8217;s add these two values to our sample application&#8217;s config file:</p>
<p>stripesample/grails-app/Config.groovy<br />
<code><br />
grails.plugins.stripe.secretKey = 'YOUR_TEST_SECRET_KEY'<br />
grails.plugins.stripe.publishableKey = 'YOUR_TEST_PUBLISHABLE_KEY'<br />
</code></p>
<p>You will obviously want to put these config values in the appropriate environment in Config.groovy. The plugin takes care of setting the secret key for you in the Stripe abstract class and the publishable key will be set from our JavaScript which we&#8217;ll cover in a bit.</p>
<p>Next we need to include the JavaScript library provided by Stripe. The plugin exposes this library as a standard resource module called <strong>stripe</strong>. So, you need to include this in your resource modules declaration. Make sure you use modules (plural) if you have more than one as opposed to module (singular).</p>
<p><code><br />
&lt;r:require modules="application, stripe"/&gt;<br />
</code><br />
or<br />
<code><br />
&lt;r:require module="stripe"/&gt;<br />
</code></p>
<p>The way Stripe works is that it uses JavaScript to capture the credit card details and creates a token. So, the credit card details never actually hit the server which makes it really easy to be PCI compliant. The JavaScript then creates a hidden field on the form with the token as the value and submits the form to the server. Once on the server, we will use Groovy to capture the amount from the form, the token and create a Stripe Charge. Piece of cake! </p>
<p>Create a new file called <strong>index.gsp</strong> in <strong>stripesample/grails-app/views/checkout</strong> and put the following for the contents of the file:</p>
<p><script src="https://gist.github.com/1535990.js?file=grails-stripe-gsp"></script></p>
<p>Next we need to modify the CheckoutController we created. Put the following for the contents of this file:</p>
<p><script src="https://gist.github.com/1535990.js?file=grails-stripe-controller"></script></p>
<p>And finally, we need to create a simple <strong>confirmation.gsp</strong> in <strong>stripesample/grails-app/views/checkout</strong> and put the following for the contents of the file:</p>
<p><script src="https://gist.github.com/1535990.js?file=gistfile1.txt"></script></p>
<p>This is obviously a really simple example and can be improved greatly with styling, validation, flash message, etc, but I did this on purpose just to keep it really simple.  A couple things to notice in the sample code:</p>
<ol>
<li>The JavaScript is pulling in your publishable key from Config.groovy</li>
<li>The JavaScript then takes the credit-card details and creates a token and inserts this into a hidden-field on the form</li>
<li>The server never sees the credit-card details, only the token created by the Stripe JavaScript library and the amount to charge</li>
</ol>
<p>Let&#8217;s try it out!  Here are some sample values that will work for testing:</p>
<ul>
<li>Credit Card Number: 4242424242424242</li>
<li>CVC: 123</li>
<li>Expiration Month: 12</li>
<li>Expiration Year: 2015</li>
</ul>
<p>You can use whatever you want for the amount. Enter it as you normally would in dollars like 12.99 for example. The controller converts this to an integer of cents since Stripe deals in cents.  If goes well, you should see the confirmation page with the success message! If something goes wrong and you receive the error message, you can comment out the try/catch block around the <strong>Charge.create(chargeParams)</strong> to see the actual error message from the Stripe API.  Once you have successfully submitted the form and received the confirmation message, go to your <a href="https://manage.stripe.com" target="_blank">Stripe account</a> and click on <strong>Payments</strong> to verify that it shows up!</p>
<p>This post is just barely touching the surface of the Stripe capabilities! We did a one-time charge here, but you can do all sorts of stuff with the Stripe API with Groovy like subscriptions / plans for recurring payments. You can also do standard stuff like issue refunds or coupons. Take a look at the <a href="https://stripe.com/docs/api?lang=java" target="_blank">Java API documentation</a> for more details.</p>
<p>Well that concludes my walk-through of using Stripe for processing credit cards in a Grails application.  I hope you found this post interesting and consider trying out my plugin!  Here are links to the source for the plugin and the plugin portal page.</p>
<ul>
<li><a href="https://github.com/bobbywarner/grails-stripe" target="_blank">https://github.com/bobbywarner/grails-stripe</a></li>
<li><a href="http://grails.org/plugin/stripe" target="_blank">http://grails.org/plugin/stripe</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bobbywarner.com/2011/12/29/using-stripe-with-grails/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
