Coder Social home page Coder Social logo

fermuch / dineromail Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nicolas-simplex/dineromail

0.0 0.0 0.0 131 KB

Dineromail library for Rails

Home Page: http://soluciones-simplex.com.ar/blog/category/desarrollo/dineromail/

License: Other

Ruby 100.00%

dineromail's Introduction

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.pay_methods = '' #All the available methods
  config.account_number = 'your_account_number'
  config.password = 'your_password'
  config.logo_url = 'http://my-web.com/images/logo.png'
  config.return_url = 'http://my-web.com/success'
  config.error_url = 'http://my-web.com/error'
  config.currency = Dineromail::Configuration::PESO
  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
    notifications = Dineromail::Notification.parse(params[:Notificacion])
    notifications.each do |notify|
      if notify.valid_report? && notify.completed?
        order = Order.find(notify.transaction_id)
        #Allways check the amount
        order.success = order.amount == notify.amount ? 'success' : 'failure'
        order.save
      end
    end
    render :nothing => true
  end
end

Example dineromail forward page

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

Contributing to Dineromail

  • Fork the project.

  • Make your feature addition or bug fix

  • Send me a pull request.

dineromail's People

Contributors

acolin avatar fermuch avatar nicolas-simplex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.