--- !ruby/object:RI::ClassDescription 
attributes: []

class_methods: 
- !ruby/object:RI::MethodSummary 
  name: notification
- !ruby/object:RI::MethodSummary 
  name: return
comment: 
- !ruby/struct:SM::Flow::P 
  body: To start with Nochex, follow the instructions for installing ActiveMerchant as a plugin, as described on http://www.activemerchant.org/.
- !ruby/struct:SM::Flow::P 
  body: The plugin will automatically add the ActionView helper for ActiveMerchant, which will allow you to make the Nochex payments. The idea behind the helper is that it generates an invisible forwarding screen that will automatically redirect the user. So you would collect all the information about the order and then simply render the hidden form, which redirects the user to Nochex.
- !ruby/struct:SM::Flow::P 
  body: "The syntax of the helper is as follows:"
- !ruby/struct:SM::Flow::VERB 
  body: "  &lt;% payment_service_for 'order id', 'nochex_user_id',\n                                :amount =&gt; 50.00,\n                                :service =&gt; :nochex,\n                                :html =&gt; { :id =&gt; 'nochex-form' } do |service| %&gt;\n\n     &lt;% service.customer :first_name =&gt; 'Cody',\n                        :last_name =&gt; 'Fauser',\n                        :phone =&gt; '(555)555-5555',\n                        :email =&gt; 'cody@example.com' %&gt;\n\n     &lt;% service.billing_address :city =&gt; 'Ottawa',\n                               :address1 =&gt; '21 Snowy Brook Lane',\n                               :address2 =&gt; 'Apt. 36',\n                               :state =&gt; 'ON',\n                               :country =&gt; 'CA',\n                               :zip =&gt; 'K1J1E5' %&gt;\n\n     &lt;% service.invoice '#1000' %&gt;\n     &lt;% service.shipping '0.00' %&gt;\n     &lt;% service.tax '0.00' %&gt;\n\n     &lt;% service.notify_url url_for(:action =&gt; 'notify', :only_path =&gt; false) %&gt;\n     &lt;% service.return_url url_for(:action =&gt; 'done', :only_path =&gt; false) %&gt;\n     &lt;% service.cancel_return_url 'http://mystore.com' %&gt;\n   &lt;% end %&gt;\n"
- !ruby/struct:SM::Flow::P 
  body: "The notify_url is the URL that the Nochex IPN will be sent. You can handle the notification in your controller action as follows:"
- !ruby/struct:SM::Flow::VERB 
  body: "  class NotificationController &lt; ApplicationController\n    include ActiveMerchant::Billing::Integrations\n\n    def notify\n      notification =  Nochex::Notification.new(request.raw_post)\n\n      begin\n        # Acknowledge notification with Nochex\n        raise StandardError, 'Illegal Notification' unless notification.acknowledge\n          # Process the payment\n      rescue =&gt; e\n          logger.warn(&quot;Illegal notification received: #{e.message}&quot;)\n      ensure\n          head(:ok)\n      end\n    end\n  end\n"
constants: []

full_name: ActiveMerchant::Billing::Integrations::Nochex
includes: []

instance_methods: []

name: Nochex
superclass: 
