Git Product home page Git Product 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/bluetools/active_merchant_mollie.git

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

@gateway = ActiveMerchant::Billing::MollieIdealGateway.new(:partner_id  => your_partner_id)
@response = @gateway.setup_purchase(1000, {
  :return_url       => "http://yourwebsite.com/ideal/return",
  :report_url       => "http://yourwebsite.com/ideal/report",
  :bank_id          => bank_id,
  :description      => "Description of this transaction"
})

# Store the transaction id in your database with a reference to the original order
@transaction_id = @response.token

# Now redirect the user to the selected bank
redirect_to @gateway.redirect_url_for( @response.token )

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 usually sits in the transaction_id GET parameter
@token = params[:transaction_id]

@gateway = ActiveMerchant::Billing::MollieIdealGateway.new(:partner_id  => your_partner_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]

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.