Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
branch: master

This branch is 40 commits ahead, 10 commits behind nicolas-simplex:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.rdoc
Rakefile
dineromail.gemspec

README.rdoc

Dineromail / Rails

Dineromail is an unofficial library for interacting with the Dineromail payment api.

Getting Started

Dineromail is released as a Ruby Gem. The gem is to be installed within a Ruby on Rails 3 application. To install, simply add the following to your Gemfile:

# Gemfile
gem 'dineromail'

General Configuration

You need to create a config file (config/initializers/dineromail.rb) with:

Dineromail.configure do |config|
  config.payment_method_available = 'all' #All the available methods
  config.account_number = 'your_account_number'
  config.seller_name = 'Your Company Name'
  config.password = 'your_password'
  config.header_url = 'http://my-web.com/images/logo.png'
  config.ok_url = 'http://my-web.com/success'
  config.pending_url = 'http://my-web.com/pending'
  config.error_url = 'http://my-web.com/error'
  config.currency = Dineromail::Currency::PESO_AR
  config.country_id = Dineromail::Country::ARGENTINA
  config.ipn_webservice_url = 'https://argentina.dineromail.com/Vender/Consulta_IPN.asp'
  config.payment_url = 'https://argentina.dineromail.com/Shop/Shop_Ingreso.asp'
  config.button_image_url = 'https://argentina.dineromail.com/imagenes/vender/boton/comprar-gris.gif'
end

Example rails controller

class DineromailController < ApplicationController
  def ipn
    notification = Dineromail::Notification.parse(params[:Notificacion])
    report = notification.report
    if report.valid?
      report.operations.each do |operation|
        if operation.completed?
          order = Order.find(notify.transaction_id)
          #Allways check the amount
          order.success = order.amount == notify.amount ? 'success' : 'failure'
          order.save
        end
      end
    end
    render :nothing => true
  end
end

Example dineromail forward page

<%= dineromail_button('Item name', price, quantity, :transaction_id => @transaction_id) %>

Contributing to Dineromail

  • Fork the project.

  • Make your feature addition or bug fix

  • Send me a pull request.

Something went wrong with that request. Please try again.