Giter VIP home page Giter VIP logo

active_merchant_mollie's Introduction

Active Merchant for Mollie iDeal

This gem contains an extension of ActiveMerchant [www.activemerchant.org] with support for the Dutch payment service provider Mollie [www.mollie.nl]. The extension allows you to make iDeal transactions based on the Mollie iDeal API.

Installation

To install as a gem using Bundler, add the following to your Gemfile:

gem "active_merchant_mollie"

Run bundle install to install the gem.

You can also install as a Rails plugin:

./script/plugin install git://github.com/joris/active_merchant_mollie.git

Setup the gateway in the appropriate environment configuration files:

config/environments/development.rb config/environments/test.rb

config.after_initialize do
  ActiveMerchant::Billing::Base.mode = :test
  ::GATEWAY = ActiveMerchant::Billing::MollieIdealGateway.new(:login  => your_partner_id)
end

And for production use: config/environments/production.rb

config.after_initialize do
  ::GATEWAY = ActiveMerchant::Billing::MollieIdealGateway.new(:login  => your_partner_id)
end

Usage

Before you start using this gem, please read the API documentation of Mollie on their website: www.mollie.nl/beheer/betaaldiensten/documentatie/ideal. Make sure you have a Mollie account and know your ‘partner id’.

Create a new purchase

response = GATEWAY.setup_purchase(1000, {
  :return_url       => "http://yourwebsite.com/ideal/return",
  :report_url       => "http://yourwebsite.com/ideal/report",
  :issuer_id        => bank_id,
  :description      => "Description of this transaction"
})

# Store the transaction token in the order:
# @order = Order.find(params[:id])
# @order.payment_token = response.token

# Now redirect the user to the selected bank
redirect_to response.url

Receive details of purchase

After the user returns on your website or Mollie requests you report URL, you should check the state of the purchase. Based in the transaction id you can update the state of your order in your database.

# The token sits in the transaction_id GET parameter
token = params[:transaction_id]

@details_response = GATEWAY.details_for( token )

if @details_response.success?
  # The payment was successfull, update the state in your database
else
  # Something went wrong, inspect the error message
  puts @details_response.message
end

Maintainer

This gem is based on ActiveMerchant and abstracted from the MoneyBird [www.moneybird.nl] project. For more information ask the MoneyBird team via [email protected]

active_merchant_mollie's People

Contributors

edwinv avatar joris avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.