DineroMail Gem

Dinero Mail is a client which communicates with the provider API, and interact with it.

It was developed for usage in Ruby on Rails web applications, but it also works as a standalone library

Installation

Add this line to your application's Gemfile:

gem 'dinero_mail'

Living on the edge

gem 'dinero_mail', git: '[email protected]:IcaliaLabs/dinero_mail.git'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dinero_mail

Configuration

If you are on development you are ready to go! Yeeiii

For those who are on production:

DineroMail.configure do |config|
  config.environment = :production
  config.username = '<username>'
  config.password = '<password>'
end

Creating a client

DM_CLIENT = DineroMail::Client.new

Methods

 DM_CLIENT.get_balance unique_message_id: '1', merchant_transaction_id: '1'

 DM_CLIENT.get_operations unique_message_id: '1', merchant_transaction_id: '1', operation_id: '1', 
 start_date: '2012-10-6', end_date: '2012-10-10'

 DM_CLIENT.send_money currency: 'MXN', amount: '100.00', to_email: '[email protected]', pay_off: 'Producto', 
 subject: 'Pago de servicio', message: 'Hola mundo', merchant_transaction_id: '1', unique_message_id: '1'

 DM_CLIENT.do_payment_with_reference merchant_transaction_id: '1', unique_message_id: '1', subject: 'hola', message: 'mensaje',         
                    provider: 'oxxo', items: [{amount: '100.00', code: 'abc', currency: 'MXN', description: 'descricion', name: 'nombre', 
                    quantity: '1'}], buyer: {name: 'abraham', last_name: 'kuri', email: '[email protected]'}

 DM_CLIENT.do_with_draw merchant_transaction_id: '1', method: 'POSTAL', currency: 'MXN', amount: '100.00', 
                    address_detail: {street: 'mordor', number: '666', floor: '1', appartment: '5', zip: '666', city: 'inferno', 
                    state: 'mordorTown'}, bank_account_detail: {bank:'Banco Santander', bank_number: '300', type: 'CC', 
                    name: 'Abraham', last_name: 'Kuri', document_type: 'RFC', document_number: '2019029', branch: '1'}, 
                    unique_message_id: '1'

 DM_CLIENT.do_payment_with_credit_card merchant_transaction_id: '1', items: [{amount: '100.00', code: 'abc', currency: 'MXN',   
                    description: 'descricion', name: 'nombre', quantity: '1'}], buyer: {name: 'abraham', last_name: 'kuri', 
                    email: '[email protected]'}, provider: 'MX_BANORTE_TD', credit_card: {installment: '2', credit_card_number: '123456', 
                    holder: 'adrian', expiration_date: '12/16', security_code: '1234', document_number: '1'}, unique_message_id: '1'

 DM_CLIENT.get_payment_ticket currency: "MXN", amount: "100.0", provider: "oxxo", 
                        merchant_transaction_id: "1", unique_message_id: "1"

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Changelog

  • Current gem version 0.0.1
  • Full integration with Rails

Contributors & Patches & Forks

  • Abraham Kuri Vargas (@kurenn)
  • Adrián González Francke (@Adrian2112)

Future

  • Writing tests (not implemented yet)
  • Add support to communicate with the IPN
  • Add button helpers

Credits

Icalia Labs - [email protected]

Follow us

Like us on Facebook

License

Copyright (c) 2011 Abraham Kuri Vargas

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/gpl.html.