<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,8 +1,12 @@
 class PaymentsController &lt; ApplicationController
 
-  def charge
-    response = Moip.authorize(:reason=&gt;&quot;Teste&quot;,:id=&gt;&quot;12&quot;, :value=&gt;1)
+  def direct_charge
+    response = Moip.authorize(:reason=&gt;&quot;Teste&quot;,:id=&gt;&quot;15&quot;, :value=&gt;1)
     redirect_to Moip.charge_url(response)
   end
 
+  def manual_charge
+    @response = Moip.authorize(:reason=&gt;&quot;Teste&quot;,:id=&gt;&quot;14&quot;, :value=&gt;1)
+  end
+
 end
\ No newline at end of file</diff>
      <filename>app/controllers/payments_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 ActionController::Routing::Routes.draw do |map|
-  
-  map.charge &quot;/charge&quot;, :controller=&gt;&quot;payments&quot;, :action=&gt;&quot;charge&quot;
-  
+
+  map.charge &quot;/manual_charge&quot;, :controller=&gt;&quot;payments&quot;, :action=&gt;&quot;manual_charge&quot;
+  map.charge &quot;/direct_charge&quot;, :controller=&gt;&quot;payments&quot;, :action=&gt;&quot;direct_charge&quot;
+
 end</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,8 @@ class Moip
     end
 
     response = post('/EnviarInstrucao/Unica', :body =&gt; xml)[&quot;ns1:EnviarInstrucaoUnicaResponse&quot;]
-    response[&quot;Resposta&quot;][&quot;Status&quot;] == &quot;Falha&quot; ? raise(StandardError, response[&quot;Resposta&quot;][&quot;Erro&quot;]) : response
+    raise(StandardError, &quot;Webservice can't be reached&quot;) if response.nil?
+    (response[&quot;Resposta&quot;][&quot;Status&quot;] == &quot;Falha&quot;) ? raise(StandardError, response[&quot;Resposta&quot;][&quot;Erro&quot;]) : response
   end
 
   def self.charge_url(response)</diff>
      <filename>lib/moip.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/views/payments/index.html.erb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>d149d577beb18715088e6f1869f030ad662869d9</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Lopes</name>
    <email>danielvlopes@gmail.com</email>
  </author>
  <url>http://github.com/danielvlopes/moip_usage/commit/22862e80ab30edf1f548471e21f78eb0d139b5b0</url>
  <id>22862e80ab30edf1f548471e21f78eb0d139b5b0</id>
  <committed-date>2009-10-31T08:00:53-07:00</committed-date>
  <authored-date>2009-10-31T08:00:53-07:00</authored-date>
  <message>add custom exceptions when webservice fail, add a sample when need pay with html link</message>
  <tree>3604818318ea048e5603dff95ed4b3b8a2fe4c70</tree>
  <committer>
    <name>Daniel Lopes</name>
    <email>danielvlopes@gmail.com</email>
  </committer>
</commit>
