<commit_before>= ActiveMerchantOgone

A plugin for Ogone support in ActiveRecord.

== Installation

=== Requirements

First you need the ActiveMerchant gem / rails-plugin installed. More info about ActiveMerchant installation can be found at http://activemerchant.rubyforge.org/.

=== As a Rails plugin

To install ActiveMerchantOgone in your rails app you can just do:

  > ./script/plugin install git://github.com/DefV/active_merchant_ogone.git

=== As a gem

To install ActiveMerchantOgone in your rails app you can just do:

  config.gem 'active_merchant_ogone'

== Configuration

As Ogone works with in and out signatures, you will have to set these as constants in your configuration file.

  OGONE_ACCOUNT = 'account_name'
  Ogone.setup do |c|
    c.outbound_signature = '094598439859385938958398494' # You can find this under "Data and origin verification" tab
    c.inbound_signature  = '094598439859385938958398494' # You can find this under "Data and origin verification" tab
  end

Make sure that Ogone is set to "Each parameter followed by the pass phrase." as hashed value (under "Global security parameters"). 
If you don't see this setting, then you're probably already in that mode.

== Example Usage

Once you've configured the Ogone settings you need to set up a leaving page with in your view:

  <% payment_service_for @order.ogone_id, OGONE_ACCOUNT,
      :amount   => @order.price * 100 # needs to be in cents
      :currency   => 'EUR',
      :service  => :ogone do |service| %>
    
    <%  service.redirect :accepturl => checkout_url(@order),
               :cancelurl => checkout_url(@order),
               :declineurl => checkout_url(@order),
               :exceptionurl => checkout_url(@order) %>

    <% service.language "nl_NL" %>
    <% service.template "https://secure.ogone.com/ncol/template_standard.htm" %>

    <%= submit_tag "Pay with Ogone!" %>
  <% end %>

And in your controller you should have an enter path:

  class CheckoutsController < ApplicationController
    include ActiveMerchant::Billing::Integrations
    
    def show
      @notification = Ogone::Notification.new(request.query_string)
      
      @order = Order.find_by_ogone_id(@notification.order_id)
      if @notification.complete?
        @order.paid!
      else
        @order.failed!
      end
    end
  end

Copyright (c) 2009 Openminds BVBVA, released under the MIT license<commit_msg>README.rdoc AfterPay example added.<commit_after>= ActiveMerchantOgone

A plugin for Ogone support in ActiveRecord.

== Installation

=== Requirements

First you need the ActiveMerchant gem / rails-plugin installed. More info about ActiveMerchant installation can be found at http://activemerchant.rubyforge.org/.

=== As a Rails plugin

To install ActiveMerchantOgone in your rails app you can just do:

  > ./script/plugin install git://github.com/DefV/active_merchant_ogone.git

=== As a gem

To install ActiveMerchantOgone in your rails app you can just do:

  config.gem 'active_merchant_ogone'

== Configuration

As Ogone works with in and out signatures, you will have to set these as constants in your configuration file.

  OGONE_ACCOUNT = 'account_name'
  Ogone.setup do |c|
    c.outbound_signature = '094598439859385938958398494' # You can find this under "Data and origin verification" tab
    c.inbound_signature  = '094598439859385938958398494' # You can find this under "Data and origin verification" tab
  end

Make sure that Ogone is set to "Each parameter followed by the pass phrase." as hashed value (under "Global security parameters"). 
If you don't see this setting, then you're probably already in that mode.

== Example Usage

Once you've configured the Ogone settings you need to set up a leaving page with in your view:

  <% payment_service_for @order.ogone_id, OGONE_ACCOUNT,
      :amount   => @order.price * 100 # needs to be in cents
      :currency   => 'EUR',
      :service  => :ogone do |service| %>
    
    <% service.redirect :accepturl => checkout_url(@order),
               :cancelurl => checkout_url(@order),
               :declineurl => checkout_url(@order),
               :exceptionurl => checkout_url(@order) %>

    <% service.language "nl_NL" %>
    <% service.template "https://secure.ogone.com/ncol/template_standard.htm" %>

    <%= submit_tag "Pay with Ogone!" %>
  <% end %>

And in your controller you should have an enter path:

  class CheckoutsController < ApplicationController
    include ActiveMerchant::Billing::Integrations
    
    def show
      @notification = Ogone::Notification.new(request.query_string)
      
      @order = Order.find_by_ogone_id(@notification.order_id)
      if @notification.complete?
        @order.paid!
      else
        @order.failed!
      end
    end
  end

== AfterPay(NL) Usage

To use AfterPay in your forms:

  <% service.after_pay :bill_civility => "Mr.",
	:bill_first_name => "Nick",
	:bill_last_name => "<NAME>",
	:bill_street_number => "1098",
	:ship_civility => "Mr.",
	:ship_first_name => "Nick",
	:ship_last_name => "<NAME>",
	:ship_adress => "<NAME>",
	:ship_adress_number => "1098",
	:ship_adress_zip => "2564AZ",
	:ship_adress_city => "Den Haag",
	:ship_adress_country_code => "NL",
	:ship_adress_email => "<EMAIL>",
	:ship_dob => "23/04/1987" %>

Copyright (c) 2009 Openminds BVBVA, released under the MIT license
{'fraction_non_alphanumeric': 0.0981422405704635, 'fraction_numerical': 0.026646650403452807, 'mean_word_length': 3.630755864465682, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 50, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '557818', 'n_tokens_mistral': 1757, 'n_tokens_neox': 1575, 'n_words': 524}