<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Synap Software comments on Making of a Web App: Part 12 - Payment Processing</title>
    <link>http://synapsoftware.com/ndi/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Synap Software comments</description>
    <item>
      <title>"Making of a Web App: Part 12 - Payment Processing": comment by Scott Meade</title>
      <description>&lt;p&gt;Thanks, Zack, for checking in.&lt;/p&gt;


	&lt;p&gt;As Zack points out, with the gem available this is not just for Rails programmers but for any Ruby system.&lt;/p&gt;</description>
      <pubDate>Fri, 13 Jul 2007 12:43:43 EDT</pubDate>
      <guid>http://synapsoftware.com/ndi/articles/2007/07/10/rails-trustcommerce-subscription#comment-576</guid>
      <link>http://synapsoftware.com/ndi/articles/2007/07/10/rails-trustcommerce-subscription#comment-576</link>
    </item>
    <item>
      <title>"Making of a Web App: Part 12 - Payment Processing": comment by Zack</title>
      <description>&lt;p&gt;Glad to see the plugin is getting some good use&amp;#8230; there is also the gem at http://trustcommerce.rubyforge.org&lt;/p&gt;</description>
      <pubDate>Fri, 13 Jul 2007 01:28:50 EDT</pubDate>
      <guid>http://synapsoftware.com/ndi/articles/2007/07/10/rails-trustcommerce-subscription#comment-575</guid>
      <link>http://synapsoftware.com/ndi/articles/2007/07/10/rails-trustcommerce-subscription#comment-575</link>
    </item>
    <item>
      <title>"Making of a Web App: Part 12 - Payment Processing": comment by Scott Meade</title>
      <description>&lt;p&gt;Good point James.  Using the BillingID that Trustcommerce generates, we can modify subscription information without having to know the credit card number.&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jul 2007 18:38:39 EDT</pubDate>
      <guid>http://synapsoftware.com/ndi/articles/2007/07/10/rails-trustcommerce-subscription#comment-571</guid>
      <link>http://synapsoftware.com/ndi/articles/2007/07/10/rails-trustcommerce-subscription#comment-571</link>
    </item>
    <item>
      <title>"Making of a Web App: Part 12 - Payment Processing": comment by James</title>
      <description>&lt;p&gt;Scott,&lt;/p&gt;


	&lt;p&gt;One of the most difficult scenarios I&amp;#8217;ve run into is how to upgrade/downgrade an existing customer. I prefer not to ask for credit card details a second time in an effort to cancel the first and create a second recurring payment schedule. Being able to alter an existing recurring payment is often not easy to do with some solutions.&lt;/p&gt;


	&lt;p&gt;How have you dealt with this?&lt;/p&gt;</description>
      <pubDate>Wed, 11 Jul 2007 14:36:16 EDT</pubDate>
      <guid>http://synapsoftware.com/ndi/articles/2007/07/10/rails-trustcommerce-subscription#comment-570</guid>
      <link>http://synapsoftware.com/ndi/articles/2007/07/10/rails-trustcommerce-subscription#comment-570</link>
    </item>
    <item>
      <title>"Making of a Web App: Part 12 - Payment Processing" by smeade</title>
      <description>&lt;p&gt;Most of the &lt;a href="http://www.synapsoftware.com/blogit/articles/2007/06/06/making-of-a-web-app-introduction"&gt;Making of a Web App&lt;/a&gt; series follows a typical path from idea to implementation.  In that path, payment processing and subscription management is one of the last items to be implemented.  There is no reason to do it now for &lt;a href="http://playbookiq.com"&gt;PlaybookIQ&lt;/a&gt; except that we need subscription (i.e. automatic recurring payment) capability for another project so I deployed it today.&lt;/p&gt;


	&lt;p&gt;For the technically inclined, here are some notes from that experience.&lt;/p&gt;

&lt;p&gt;To implement credit card processing you need a merchant account, a payment gateway, and a secure website for collecting billing details.  It can take some time to compare the merchant account and gateway options available to find the ones that are right for you.  And the paperwork and setup tasks with your selected merchant account provider and payment gateway vendor can take several days, so keep that in mind when planning a project.&lt;/p&gt;


	&lt;p&gt;For these components we used our local bank, TrustCommerce, and Ruby on Rails respectively.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;A Personal Relationship with Our Local Bank&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;When you have a good, existing relationship with a vendor I think it is important to continue with it.  It is important to have someone to sit down with in person if you need help straightening out payment transactions.  So we choose our local bank of ten years to provide our merchant account.  They offer competitive rates and were knowledgeable and helpful in getting us set up with our payment gateway.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;TrustCommerce.com&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://trustcommerce.com"&gt;TrustCommerce&lt;/a&gt; is our payment gateway.  Like our local bank, they are knowledgeable and offer competitive rates.  They have an extensive open-source &lt;span class="caps"&gt;API &lt;/span&gt;&lt;a href="http://www.trustcommerce.com/tclink.php"&gt;library&lt;/a&gt; and good &lt;a href="https://vault.trustcommerce.com/downloads/TCDevGuide.html"&gt;documentation&lt;/a&gt;.   By connecting through their TCLink &lt;span class="caps"&gt;API&lt;/span&gt; we get the benefit of a &lt;a href="http://www.trustcommerce.com/failover.php"&gt;failover&lt;/a&gt; system offers &amp;#8220;virtually&amp;#8221; 100% reliability (e.g. it has no single point of failure).  Finally, they maintain the credit card information for recurring billing so we never retain credit card numbers on our servers.  Instead, they create a six digit billing ID and that billing ID is our reference to the credit card details.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Ruby on Rails TrustCommerce Subscription Plugin&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.depixelate.com/2006/10/20/trustcommerce-subscription-plugin-released"&gt;Here&lt;/a&gt; is Zack Chandler&amp;#8217;s blog entry when he released the plug-in in October, 2006.  Following the steps in that post and in the plugin itself, I was able to run the tests Zack included shortly after starting.  When fully configured, the plugin makes easy to understand code like this possible:&lt;/p&gt;


&lt;pre&gt;
&lt;code&gt;
#Create a $12.00 monthly subscription for Jennifer Smith
response = TrustCommerceGateway::Subscription.create(
  :cc =&amp;gt;        '4111111111111111', 
  :exp =&amp;gt;       '0412', 
  :name =&amp;gt;      'Jennifer Smith',
  :amount =&amp;gt;    1200,
  :cycle =&amp;gt;     '1m',
  :demo =&amp;gt;      'y'
)

if response['status'] == 'approved'
  puts "Customer profile created with 
     Billing ID: #{response['billingid']}" 
else
  puts "An error occurred: #{response['error']}" 
end
&lt;/code&gt;
&lt;/pre&gt;

	&lt;p&gt;&lt;strong&gt;The Devil&amp;#8217;s in the Details&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Though the plugin is great, don&amp;#8217;t let it fool you into thinking that implementing   the code around the plugin is easy.  You still need to build the code to create and manage TrustCommerceGateway::Subscription objects, all the while ensuring everything is done under cover of &lt;span class="caps"&gt;SSL&lt;/span&gt; and with consideration for several other security issues.  For example, don&amp;#8217;t forget to include:&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://api.rubyonrails.com/classes/ActionController/Base.html#M000260"&gt;&lt;code&gt;filter_parameter_logging :cc&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;in your controllers to ensure credit card numbers do not get written out to the logs.&lt;/p&gt;


	&lt;p&gt;As is usually the case with programming, implementation of the blue-sky-all-is-approved case was the easy part.  Wanting to ensure all types of responses from the payment gateway were handled properly (and being hooked on &lt;span class="caps"&gt;TDD&lt;/span&gt;) I spent much more time writing and running tests than I did writing models, views, or controllers.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Questions?&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;Unlike with the Deprec &lt;a href="http://synapsoftware.com/blogit/articles/2007/07/03/making-of-a-web-app-part-11-technical-interlude"&gt;setup&lt;/a&gt;, I did not write detailed notes.  Yet, if you are a Rails programmer implementing the TrustCommerce Subscription Plugin and have any questions, send me an email and I&amp;#8217;ll be happy to try to help out.&lt;/p&gt;</description>
      <pubDate>Tue, 10 Jul 2007 00:21:00 EDT</pubDate>
      <guid>&lt;a href="/ndi/articles/2007/07/10/rails-trustcommerce-subscription"&gt;Making of a Web App: Part 12 - Payment Processing&lt;/a&gt;</guid>
      <link>&lt;a href="/ndi/articles/2007/07/10/rails-trustcommerce-subscription"&gt;Making of a Web App: Part 12 - Payment Processing&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
