GithubHelp home page GithubHelp logo

easypay's Introduction

Easypay

Easypay is a Ruby client for Easypay payment platform that allows payments with credit cards and (MB references to Portugal)

Installation

OK. First, you need to talk with people from Easypay to get your credentials!

Now, let's install the gem via Rubygems:

$ gem install easypay

Or in your Gemfile:

$ gem 'easypay'

After bundle:

$ rails generate easypay
$ rake db:migrate

Check on your initializers folder for easypay.rb and change the parameters:

  # CIN USER and ENTITY, are required
  config.cin = 'cin provided by Easypay'
  config.user = 'user provided by Easypay'
  config.entity = 'entity provided by Easypay'

  # Code is needed only if you don't have validation by IP Address
  config.code = "Code is needed only if you don't have validation by IP Address (Configure on Easypay Backoffice)"
  
  # Change routes in order to work them on your app
  config.easypay_notification_path = '/easypay/notifications.:format'
  config.easypay_forward_path = '/easypay/forwards.:format'
  config.easypay_payment_path = '/easypay/payments.:format'
  config.redirect_after_payment_path = '/easypay/completed'
  config.redirect_payment_notification_path = '/easypay/payment_completed'

Basic configuration

In your model, add:

  acts_as_payable :name => 'your_model_name_attr_if_different_from_name', 
                  :email => 'your_model_email_attr_if_different_from_email', 
                  :mobile => 'your_model_mobile_attr_if_different_from_mobile',
                  :item_description => 'your_model_item_description_attr_if_different_from_item_description', 
                  :item_quantity => 'your_model_item_quantity_attr_if_different_from_item_quantity', 
                  :value => 'your_model_value_attr_if_different_from_value', 
                  :description => 'your_model_description_attr_if_description_from_email', 
                  :obs => 'your_model_obs_attr_if_different_from_obs'

How to?

In your controller:

  payment_reference = @bill.create_payment_reference
  
  # check if success
  
  if payment_reference[:success]
  
  # access your payment_references easy
  
  @bill.payment_references

You can work response (configure your routes on easypay.rb)

  Easypay::PaymentReference.find_by_ep_key(params[:ep_key])

Delete or update payment reference:

  # delete payment reference
  @payment_reference.modify("delete")
  
  # update
  @payment_reference.modify("update")

Check Logs of every request and notification on table easypay_logs

Todo?

Feel free to contact me, you have your say.

I will put in github working project using gem

Copyright

Authors: Guilherme Pereira

easypay's People

Contributors

guiferrpereira avatar jfilipeg avatar patricknpinto avatar x1s avatar

Watchers

James Cloos 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.